Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/Xiaomi_MissedReadings
Browse files Browse the repository at this point in the history
# Conflicts (solved):
#	app/src/androidTest/java/com/eveningoutpost/dexdrip/HomeEspressoTest.java
  • Loading branch information
NiK27711 committed Jul 5, 2024
2 parents 7fee3d1 + f418d5b commit 472ad96
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 66 deletions.
5 changes: 4 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,12 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'androidx.test.ext:junit:1.1.1', {
androidTestImplementation 'androidx.test.ext:junit:1.1.5', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
androidTestImplementation 'androidx.test:rules:1.5.0'
// add this for intent mocking support
Expand Down
5 changes: 5 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
# to depend on it.
-dontwarn kotlinx.serialization.Serializable

# The lib net.sf.kxml:kxml2:2.3.0 is referenced in same required libraries used for
# Android testing. R8 is showing missing classes warnings which can be safely ignored.
-dontwarn org.kxml2.io.KXmlParser
-dontwarn org.kxml2.io.KXmlSerializer

-dontwarn java.util.concurrent.**

-keep class rx.schedulers.Schedulers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
*/


import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.RootMatchers.isDialog;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static com.schibsted.spain.barista.BaristaClickActions.click;
import static com.schibsted.spain.barista.BaristaScrollActions.scrollTo;
import static com.schibsted.spain.barista.custom.NestedEnabledScrollToAction.scrollTo;
import static org.hamcrest.core.AllOf.allOf;

import android.app.Activity;
import android.content.Context;
import androidx.test.test.InstrumentationRegistry;
import androidx.test.test.annotation.UiThreadTest;
import androidx.test.test.espresso.ViewInteraction;
import androidx.test.test.rule.ActivityTestRule;
import androidx.test.test.runner.AndroidJUnit4;
import android.view.WindowManager;

import androidx.test.InstrumentationRegistry;
import androidx.test.annotation.UiThreadTest;
import androidx.test.espresso.ViewInteraction;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import com.schibsted.spain.barista.flakyespresso.AllowFlaky;

import org.junit.After;
Expand All @@ -26,18 +39,6 @@

import java.io.File;

import static androidx.test.test.espresso.Espresso.onView;
import static androidx.test.test.espresso.action.ViewActions.click;
import static androidx.test.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.test.espresso.matcher.RootMatchers.isDialog;
import static androidx.test.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.test.espresso.matcher.ViewMatchers.withText;
import static com.schibsted.spain.barista.BaristaClickActions.click;
import static com.schibsted.spain.barista.BaristaScrollActions.scrollTo;
import static com.schibsted.spain.barista.custom.NestedEnabledScrollToAction.scrollTo;
import static org.hamcrest.core.AllOf.allOf;

@RunWith(AndroidJUnit4.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class HomeEspressoTest {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/eveningoutpost/dexdrip/MegaStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void addAsection(String section, String title) {
}

private static final String G4_STATUS = "BT Device";
public static final String G5_STATUS = "G5/G6/G7 Status";
public static final String G5_STATUS = "Dex Status";
private static final String MEDTRUM_STATUS = "Medtrum Status";
private static final String IP_COLLECTOR = "IP Collector";
private static final String XDRIP_PLUS_SYNC = "Followers";
Expand Down Expand Up @@ -168,7 +168,7 @@ private void populateSectionList() {
}
if (dexCollectionType.equals(DexcomG5)) {
if (Pref.getBooleanDefaultFalse(Ob1G5CollectionService.OB1G5_PREFS)) {
addAsection(G5_STATUS, "OB1 G5/G6/G7 Collector and Transmitter Status");
addAsection(G5_STATUS, "G6/Dex1/G7/1+ Collector/Transmitter Status");
} else {
addAsection(G5_STATUS, "G5 Collector and Transmitter Status");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.eveningoutpost.dexdrip.utilitymodels.CollectionServiceStarter;
import com.eveningoutpost.dexdrip.utilitymodels.Experience;
import com.eveningoutpost.dexdrip.stats.StatsActivity;
import com.eveningoutpost.dexdrip.utilitymodels.Pref;
import com.eveningoutpost.dexdrip.utils.DexCollectionType;
import com.eveningoutpost.dexdrip.utils.Preferences;

Expand Down Expand Up @@ -103,7 +102,7 @@ public NavDrawerBuilder(final Context context) {
}
}
}
if (!getBestCollectorHardwareName().equals("G7") || Pref.getBooleanDefaultFalse("engineering_mode")) { // If we are using G7, offer the stop sensor option in engineering mode only
if (!getBestCollectorHardwareName().equals("G7")) { // If we are using G7, there will be no stop sensor option in the menu.
this.nav_drawer_options.add(context.getString(R.string.stop_sensor));
this.nav_drawer_intents.add(new Intent(context, StopSensor.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ public class UiBasedCollector extends NotificationListenerService {
coOptedPackages.add("com.medtronic.diabetes.simplera.eu");
coOptedPackages.add("com.senseonics.gen12androidapp");
coOptedPackages.add("com.senseonics.androidapp");
coOptedPackages.add("com.microtech.aidexx.mgdl"); // Experiment

coOptedPackagesAll.add("com.dexcom.dexcomone");
coOptedPackagesAll.add("com.dexcom.d1plus");
coOptedPackagesAll.add("com.medtronic.diabetes.guardian");
coOptedPackagesAll.add("com.medtronic.diabetes.simplera.eu");
coOptedPackagesAll.add("com.senseonics.gen12androidapp");
coOptedPackagesAll.add("com.senseonics.androidapp");
coOptedPackagesAll.add("com.microtech.aidexx.mgdl"); // Experiment

companionAppIoBPackages.add("com.insulet.myblue.pdm");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public void onNavigationDrawerItemSelected(int position) {

private void getData() {
final List<BgReading> latest = BgReading.latest(5000);
parseDataForStats(latest);
ListAdapter adapter = new BgReadingAdapter(this, latest);
this.setListAdapter(adapter);
try {
parseDataForStats(latest);
ListAdapter adapter = new BgReadingAdapter(this, latest);
this.setListAdapter(adapter);
if (total > 0) {
this.getActionBar().setSubtitle(String.format(Locale.getDefault(), "%d in 24h, bf:%d%% mis:%d", total, ((backfilled * 100) / total), missing));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ private static void legacySettingsFix() {
Pref.setBoolean("ob1_g5_fallback_to_xdrip", false);
Pref.setBoolean("always_unbond_G5", false);
Pref.setBoolean("always_get_new_keys", true);
Pref.setBoolean("run_ble_scan_constantly", false);
Pref.setBoolean("run_G5_ble_tasks_on_uithread", false);
}
private static void legacySettingsMoveLanguageFromNoToNb() {
// Check if the user's language preference is set to "no"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1184,11 +1184,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
final Preference collectionMethod = findPreference("dex_collection_method");
final Preference runInForeground = findPreference("run_service_in_foreground");
final Preference g5nonraw = findPreference("g5_non_raw_method");
final Preference g5extendedsut = findPreference("g5_extended_sut");
final Preference scanConstantly = findPreference("run_ble_scan_constantly");
final Preference runOnMain = findPreference("run_G5_ble_tasks_on_uithread");
final Preference reAuth = findPreference("always_get_new_keys");
final Preference reBond = findPreference("always_unbond_G5");
final Preference wifiRecievers = findPreference("wifi_recievers_addresses");
final Preference predictiveBG = findPreference("predictive_bg");
final Preference interpretRaw = findPreference("interpret_raw");
Expand Down Expand Up @@ -1275,6 +1270,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {

final Preference shFollowUser = findPreference("shfollow_user");
final Preference shFollowPass = findPreference("shfollow_pass");
final Preference shFollowServerUS = findPreference("dex_share_us_acct");

if (collectionType == DexCollectionType.SHFollow) {
final Preference.OnPreferenceChangeListener shFollowListener = new Preference.OnPreferenceChangeListener() {
Expand All @@ -1289,6 +1285,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
shFollowUser.setOnPreferenceChangeListener(shFollowListener);
shFollowPass.setOnPreferenceChangeListener(shFollowListener);
shFollowServerUS.setOnPreferenceChangeListener(shFollowListener);
} catch (Exception e) {
//
}
Expand All @@ -1297,6 +1294,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
collectionCategory.removePreference(shFollowUser);
collectionCategory.removePreference(shFollowPass);
collectionCategory.removePreference(shFollowServerUS);
} catch (Exception e) {
//
}
Expand Down Expand Up @@ -2522,6 +2520,8 @@ private void removeLegacyPreferences() {
// removePreferenceFromCategory("ob1_g5_fallback_to_xdrip", "ob1_options");
// removePreferenceFromCategory("always_unbond_G5", "ob1_options");
// removePreferenceFromCategory("always_get_new_keys", "ob1_options");
// removePreferenceFromCategory("run_ble_scan_constantly", "ob1_options");
// removePreferenceFromCategory("run_G5_ble_tasks_on_uithread", "ob1_options");
}

private void removePreferenceFromCategory(final String preference, final String category) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_system_status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@

<LinearLayout
android:id="@+id/layout_sensor"
app:showIfTrue="@{ms.bluetooth()}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings-es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
<string name="short_speak_readings_shortcut">Mostrar acceso directo en el menú ☰ para conmutar Lecturas Habladas</string>
<string name="speak_readings_shortcut">Acceso directo Lecturas Habladas</string>
<string name="battery_optimization_off">En Android 6+ garantiza que la optimización de la batería está apagada. Recomendado</string>
<string name="battery_optimization_on">No sigas preguntando por la optimización de la batería (no recomendable)</string>
<string name="battery_optimization_on">No insistir sobre la optimización de batería. No recomendado.</string>
<string name="battery_optimization_prompt">Aviso de optimización de Batería</string>
<string name="advanced_bluetooth_settings">Ajustes Bluetooth Avanzados</string>
<string name="bluetooth_settings">Ajustes Bluetooth</string>
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/res/values-et/strings-et.xml
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
<string name="turn_bluetooth_on">Lülitage Bluetooth sisse</string>
<string name="reset_bluetooth">Taaskäivita Bluetooth sisse-välja lülitades, kui 20 min jooksul andmeid ei saa</string>
<string name="bluetooth_watchdog">Bluetoothi jälgija</string>
<string name="reset_bluetooth_g5">Lähtesta Bluetooth sisse-välja lülitades, et hoida G5 andmeallikas töös. Ilma selleta võib G5 vastuvõtja üles öelda.</string>
<string name="reset_bluetooth_g5">Lähtesta Bluetooth, lülitades seda välja ja sisse, et andmeallikat töös hoida. Ilma selleta võib vastuvõtja töö seiskuda.</string>
<string name="g5_bluetooth_watchdog">Dex Bluetooth jälgija</string>
<string name="close_gatt">Kui bluetoothi jälgija aktiveerub tihti, võite proovida selle valiku tühistada, et näha kas see aitab</string>
<string name="older_bluetooth_wakelocks">Vanemad Bluetooth wakelockid, mis võivad akut rohkem kulutada, aga võivad olla vajalikud bluetooth-vastuvõtuks</string>
Expand Down Expand Up @@ -655,7 +655,7 @@
<string name="show_total_insulin">Näita insuliini kogust kokku</string>
<string name="total_insulin">Insuliini kokku</string>
<string name="received_readings_percentage">Sensorilt vastu võetud näitude protsent</string>
<string name="received_realtime_readings_percentage">Reaalajas saadud sensori näitude protsent (tagasi täitmata). AINULT G5 algne režiim</string>
<string name="received_realtime_readings_percentage">Reaalajas saadud sensori näitude protsent (tagasi täitmata). AINULT algse režiimi korral</string>
<string name="capture_percentage">Andmepakettide vastuvõtuprotsent</string>
<string name="realtime_capture_percentage">Andmepakettide vastuvõtuprotsent reaalajas</string>
<string name="show_calibration_accuracy">Kuva viimase 3 päeva kalibreerimistäpsuse hinnang</string>
Expand Down Expand Up @@ -697,11 +697,11 @@
<string name="low_level_value">Madala taseme diagnostiline/prototüüp-väärtus</string>
<string name="transmitter_id">Teie Dexcomi saatja ID, nt. 12AB3</string>
<string name="advanced_g5_settings">Täiendavad Dexcom seaded harvaesinevateks olukordadeks</string>
<string name="g5_debug_settings">G5/G6/G7/Dex1 silumisseaded</string>
<string name="g5_debug_settings">Dexcom silumisseaded</string>
<string name="g5_scan_constantly">Mõned seadmed töötavad paremini pidevalt skaneerides, teised mitte. Kui see säte pole valitud ja andmed on usaldusväärsed, siis peaks aku tööiga olema pikem. Tavaliselt on parem see mitte valida</string>
<string name="scan_for_g5_constantly">Skaneeri G5-saatjat pidevalt</string>
<string name="scan_for_g5_constantly">Skaneeri saatjat pidevalt</string>
<string name="g5_force_ui_thread">See on oluline mõnede Android seadmete ühenduvuse jaoks, kuid andmed võivad jääda lugemata muude UI intensiivste tegevuste kasutamisel.</string>
<string name="force_g5_ui_thread">Sunni G5 kasutajaliidese lõimele</string>
<string name="force_g5_ui_thread">Sunni kasutajaliidese lõimele</string>
<string name="authentificate_before_reading">Autentida enne igat lugemist</string>
<string name="g5_full_authentification">See proovib täielikku autentimist igal lugemiskatsel. Vajalik uuemate G5 saatja versioonide jaoks.</string>
<string name="unbond_g5_before_read">Enne iga vastuvõttu katkesta ühendus G5-ga</string>
Expand Down Expand Up @@ -1178,12 +1178,12 @@
<string name="summary_send_bridge_battery_to_nightscout">Saada oma vastuvõtja aku tase Nightscouti. Tühjendage märkeruut kui akuandur ei tööta.</string>
<string name="title_send_bridge_battery_to_nightscout">Laadi üles vastuvõtja aku seis</string>
<string name="summary_send_dexcom_transmitter_battery_to_nightscout">Saada Nightscouti Dexcomi saatja aku statistika. Sealhulgas kõik vastuvõtja oleku ekraanil kuvatavad andmed.</string>
<string name="title_send_dexcom_transmitter_battery_to_nightscout">Laadi üles OB1G5/G6/G7/1 saatja akuandmed</string>
<string name="title_send_dexcom_transmitter_battery_to_nightscout">Laadi üles Dexcom saatja akuandmed</string>
<string name="summary_send_treatments_to_nightscout">Saada raviandmed Nightscouti. Tühjendage märkeruut kui hooldusportaal ei toimi.</string>
<string name="title_send_treatments_to_nightscout">Laadi üles raviandmed</string>
<string name="summary_warn_nightscout_failures">Kui Nightscouti üleslaadimine ebaõnnestub, anna ekraanil ja heliga märku.</string>
<string name="title_warn_nightscout_failures">Hoiata tõrgete korral</string>
<string name="summary_nightscout_device_append_source_info">G5 puhul saadab Nightscouti vastuvõtu tüübi (nt OB1) ja näitude järeltäitmise oleku (algupärase režiimi jaoks).</string>
<string name="summary_nightscout_device_append_source_info">Dexcom puhul saadab Nightscouti vastuvõtu tüübi (nt OB1) ja näitude järeltäitmise oleku (algupärase režiimi jaoks).</string>
<string name="title_nightscout_device_append_source_info">Lisa seadme nimele andmeallika info</string>
<string name="summary_tap_to_send_historical_data">Puuduta vanade andmete saatmiseks Nightscouti</string>
<string name="title_back_fill_data">Täienda ajalugu</string>
Expand Down Expand Up @@ -1322,7 +1322,7 @@
<string name="summary_clfollow_download_meals">Laadi CareLink\'ist alla eined</string>
<string name="title_clfollow_download_notifications">Teavitused</string>
<string name="summary_clfollow_download_notifications">Laadi alla CareLink teavitused</string>
<string name="title_ob1_options">OB1 G5/G6/G7 vastuvõtja seaded</string>
<string name="title_ob1_options">OB1 Dexcom vastuvõtja seaded</string>
<string name="summary_use_ob1_g5_collector_service">Täielik ülekirjutamine, peaks töötama op-süsteemides Android 4.4–9, toetab algupärast režiimi ja palju muud</string>
<string name="title_use_ob1_g5_collector_service">Kasuta OB1 vastuvõtjat</string>
<string name="summary_ob1_g5_use_transmitter_alg">Võimalusel kasuta VS väärtuste arvutamiseks saatja sisemist algoritmi.</string>
Expand All @@ -1337,14 +1337,14 @@
<string name="title_ob1_g5_fallback_to_xdrip">Tagasi xDrip\'pi</string>
<string name="summary_ob1_minimize_scanning">Kasutage heuristikat, et minimeerida Bluetooth skaneerimist ja säästa energiat</string>
<string name="title_ob1_minimize_scanning">Minimaalne skaneerimine</string>
<string name="summary_using_g6">Kasutan G6, G7 või Dexcom One sensorit</string>
<string name="title_using_g6">G6/G7/Dex1 tugi</string>
<string name="summary_using_g6">Kasutan G6, G7, Dexcom 1või One+ sensorit</string>
<string name="title_using_g6">G6/G7/Dex1/One+ tugi</string>
<string name="summary_ob1_g5_allow_resetbond">OB1 vastuvõtja võib ühenduse katkestada kui arvab, et andmete töötlemine ebaõnnestus. Kui teil tekib ühenduse katkestamisel probleeme, keelake see valik. Kui te seejärel ühenduse täielikult kaotate, veenduge, et see oleks lubatud.</string>
<string name="title_ob1_g5_allow_resetbond">Luba OB1 lahtiühendamine</string>
<string name="summary_ob1_initiate_bonding_flag">OB1 vastuvõtja võib alustada ühendamist.</string>
<string name="title_ob1_initiate_bonding_flag">Luba OB1 siduda</string>
<string name="title_old_g5_options">Vana G5 vastuvõtja seaded</string>
<string name="title_g5g6_battery_options">G5/G6/Dex1 aku valikud</string>
<string name="title_old_g5_options">Vanad Dexcom vastuvõtja seaded</string>
<string name="title_g5g6_battery_options">G6/Dex1 aku valikud</string>
<string name="title_g5_battery_warning_level">Reguleeri aku hoiatuse taset</string>
<string name="title_plugins_and_features">Liidesed ja funktsioonid</string>
<string name="title_color_heart_rate1">Pulsimõõtja</string>
Expand Down
Loading

0 comments on commit 472ad96

Please sign in to comment.