Skip to content

Commit 6e1f065

Browse files
committed
2 parents e0e4267 + aceda70 commit 6e1f065

File tree

13 files changed

+50
-42
lines changed

13 files changed

+50
-42
lines changed

app/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,12 @@ dependencies {
369369
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
370370
exclude group: 'com.android.support', module: 'support-annotations'
371371
}
372-
androidTestImplementation 'androidx.test.ext:junit:1.1.1', {
372+
androidTestImplementation 'androidx.test.ext:junit:1.1.5', {
373373
exclude group: 'com.android.support', module: 'support-annotations'
374374
}
375+
androidTestImplementation 'androidx.test:rules:1.2.0'
376+
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
377+
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
375378
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
376379
// add this for intent mocking support
377380
//androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.1'

app/proguard-rules.pro

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
# to depend on it.
7575
-dontwarn kotlinx.serialization.Serializable
7676

77+
# The lib net.sf.kxml:kxml2:2.3.0 is referenced in same required libraries used for
78+
# Android testing. R8 is showing missing classes warnings which can be safely ignored.
79+
-dontwarn org.kxml2.io.KXmlParser
80+
-dontwarn org.kxml2.io.KXmlSerializer
81+
7782
-dontwarn java.util.concurrent.**
7883

7984
-keep class rx.schedulers.Schedulers {

app/src/androidTest/java/com/eveningoutpost/dexdrip/HomeEspressoTest.java

+18-17
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,28 @@
55
*/
66

77

8+
import static androidx.test.espresso.Espresso.onView;
9+
import static androidx.test.espresso.action.ViewActions.click;
10+
import static androidx.test.espresso.assertion.ViewAssertions.matches;
11+
import static androidx.test.espresso.matcher.RootMatchers.isDialog;
12+
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
13+
import static androidx.test.espresso.matcher.ViewMatchers.withId;
14+
import static androidx.test.espresso.matcher.ViewMatchers.withText;
15+
import static com.schibsted.spain.barista.BaristaClickActions.click;
16+
import static com.schibsted.spain.barista.BaristaScrollActions.scrollTo;
17+
import static com.schibsted.spain.barista.custom.NestedEnabledScrollToAction.scrollTo;
18+
import static org.hamcrest.core.AllOf.allOf;
19+
820
import android.app.Activity;
921
import android.content.Context;
10-
import android.support.test.InstrumentationRegistry;
11-
import android.support.test.annotation.UiThreadTest;
12-
import android.support.test.espresso.ViewInteraction;
13-
import android.support.test.rule.ActivityTestRule;
14-
import android.support.test.runner.AndroidJUnit4;
1522
import android.view.WindowManager;
1623

24+
import androidx.test.InstrumentationRegistry;
25+
import androidx.test.annotation.UiThreadTest;
26+
import androidx.test.espresso.ViewInteraction;
27+
import androidx.test.rule.ActivityTestRule;
28+
import androidx.test.runner.AndroidJUnit4;
29+
1730
import com.schibsted.spain.barista.flakyespresso.AllowFlaky;
1831

1932
import org.junit.After;
@@ -26,18 +39,6 @@
2639

2740
import java.io.File;
2841

29-
import static android.support.test.espresso.Espresso.onView;
30-
import static android.support.test.espresso.action.ViewActions.click;
31-
import static android.support.test.espresso.assertion.ViewAssertions.matches;
32-
import static android.support.test.espresso.matcher.RootMatchers.isDialog;
33-
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
34-
import static android.support.test.espresso.matcher.ViewMatchers.withId;
35-
import static android.support.test.espresso.matcher.ViewMatchers.withText;
36-
import static com.schibsted.spain.barista.BaristaClickActions.click;
37-
import static com.schibsted.spain.barista.BaristaScrollActions.scrollTo;
38-
import static com.schibsted.spain.barista.custom.NestedEnabledScrollToAction.scrollTo;
39-
import static org.hamcrest.core.AllOf.allOf;
40-
4142
@RunWith(AndroidJUnit4.class)
4243
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
4344
public class HomeEspressoTest {

app/src/main/java/com/eveningoutpost/dexdrip/MegaStatus.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private void addAsection(String section, String title) {
119119
}
120120

121121
private static final String G4_STATUS = "BT Device";
122-
public static final String G5_STATUS = "G5/G6/G7 Status";
122+
public static final String G5_STATUS = "Dex Status";
123123
private static final String MEDTRUM_STATUS = "Medtrum Status";
124124
private static final String IP_COLLECTOR = "IP Collector";
125125
private static final String XDRIP_PLUS_SYNC = "Followers";
@@ -168,7 +168,7 @@ private void populateSectionList() {
168168
}
169169
if (dexCollectionType.equals(DexcomG5)) {
170170
if (Pref.getBooleanDefaultFalse(Ob1G5CollectionService.OB1G5_PREFS)) {
171-
addAsection(G5_STATUS, "OB1 G5/G6/G7 Collector and Transmitter Status");
171+
addAsection(G5_STATUS, "G6/Dex1/G7/1+ Collector/Transmitter Status");
172172
} else {
173173
addAsection(G5_STATUS, "G5 Collector and Transmitter Status");
174174
}

app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.eveningoutpost.dexdrip.utilitymodels.CollectionServiceStarter;
1919
import com.eveningoutpost.dexdrip.utilitymodels.Experience;
2020
import com.eveningoutpost.dexdrip.stats.StatsActivity;
21-
import com.eveningoutpost.dexdrip.utilitymodels.Pref;
2221
import com.eveningoutpost.dexdrip.utils.DexCollectionType;
2322
import com.eveningoutpost.dexdrip.utils.Preferences;
2423

@@ -103,7 +102,7 @@ public NavDrawerBuilder(final Context context) {
103102
}
104103
}
105104
}
106-
if (!getBestCollectorHardwareName().equals("G7") || Pref.getBooleanDefaultFalse("engineering_mode")) { // If we are using G7, offer the stop sensor option in engineering mode only
105+
if (!getBestCollectorHardwareName().equals("G7")) { // If we are using G7, there will be no stop sensor option in the menu.
107106
this.nav_drawer_options.add(context.getString(R.string.stop_sensor));
108107
this.nav_drawer_intents.add(new Intent(context, StopSensor.class));
109108
}

app/src/main/java/com/eveningoutpost/dexdrip/services/UiBasedCollector.java

+2
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ public class UiBasedCollector extends NotificationListenerService {
9191
coOptedPackages.add("com.medtronic.diabetes.simplera.eu");
9292
coOptedPackages.add("com.senseonics.gen12androidapp");
9393
coOptedPackages.add("com.senseonics.androidapp");
94+
coOptedPackages.add("com.microtech.aidexx.mgdl"); // Experiment
9495

9596
coOptedPackagesAll.add("com.dexcom.dexcomone");
9697
coOptedPackagesAll.add("com.dexcom.d1plus");
9798
coOptedPackagesAll.add("com.medtronic.diabetes.guardian");
9899
coOptedPackagesAll.add("com.medtronic.diabetes.simplera.eu");
99100
coOptedPackagesAll.add("com.senseonics.gen12androidapp");
100101
coOptedPackagesAll.add("com.senseonics.androidapp");
102+
coOptedPackagesAll.add("com.microtech.aidexx.mgdl"); // Experiment
101103

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

app/src/main/java/com/eveningoutpost/dexdrip/tables/BgReadingTable.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public void onNavigationDrawerItemSelected(int position) {
6262

6363
private void getData() {
6464
final List<BgReading> latest = BgReading.latest(5000);
65-
parseDataForStats(latest);
66-
ListAdapter adapter = new BgReadingAdapter(this, latest);
67-
this.setListAdapter(adapter);
6865
try {
66+
parseDataForStats(latest);
67+
ListAdapter adapter = new BgReadingAdapter(this, latest);
68+
this.setListAdapter(adapter);
6969
if (total > 0) {
7070
this.getActionBar().setSubtitle(String.format(Locale.getDefault(), "%d in 24h, bf:%d%% mis:%d", total, ((backfilled * 100) / total), missing));
7171
}

app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java

+2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ private static void legacySettingsFix() {
149149
Pref.setBoolean("ob1_g5_fallback_to_xdrip", false);
150150
Pref.setBoolean("always_unbond_G5", false);
151151
Pref.setBoolean("always_get_new_keys", true);
152+
Pref.setBoolean("run_ble_scan_constantly", false);
153+
Pref.setBoolean("run_G5_ble_tasks_on_uithread", false);
152154
}
153155
private static void legacySettingsMoveLanguageFromNoToNb() {
154156
// Check if the user's language preference is set to "no"

app/src/main/java/com/eveningoutpost/dexdrip/utils/Preferences.java

+5
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
12751275

12761276
final Preference shFollowUser = findPreference("shfollow_user");
12771277
final Preference shFollowPass = findPreference("shfollow_pass");
1278+
final Preference shFollowServerUS = findPreference("dex_share_us_acct");
12781279

12791280
if (collectionType == DexCollectionType.SHFollow) {
12801281
final Preference.OnPreferenceChangeListener shFollowListener = new Preference.OnPreferenceChangeListener() {
@@ -1289,6 +1290,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
12891290
try {
12901291
shFollowUser.setOnPreferenceChangeListener(shFollowListener);
12911292
shFollowPass.setOnPreferenceChangeListener(shFollowListener);
1293+
shFollowServerUS.setOnPreferenceChangeListener(shFollowListener);
12921294
} catch (Exception e) {
12931295
//
12941296
}
@@ -1297,6 +1299,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
12971299
try {
12981300
collectionCategory.removePreference(shFollowUser);
12991301
collectionCategory.removePreference(shFollowPass);
1302+
collectionCategory.removePreference(shFollowServerUS);
13001303
} catch (Exception e) {
13011304
//
13021305
}
@@ -2522,6 +2525,8 @@ private void removeLegacyPreferences() {
25222525
// removePreferenceFromCategory("ob1_g5_fallback_to_xdrip", "ob1_options");
25232526
// removePreferenceFromCategory("always_unbond_G5", "ob1_options");
25242527
// removePreferenceFromCategory("always_get_new_keys", "ob1_options");
2528+
// removePreferenceFromCategory("run_ble_scan_constantly", "ob1_options");
2529+
// removePreferenceFromCategory("run_G5_ble_tasks_on_uithread", "ob1_options");
25252530
}
25262531

25272532
private void removePreferenceFromCategory(final String preference, final String category) {

app/src/main/res/layout/activity_system_status.xml

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129

130130
<LinearLayout
131131
android:id="@+id/layout_sensor"
132+
app:showIfTrue="@{ms.bluetooth()}"
132133
android:layout_width="match_parent"
133134
android:layout_height="wrap_content"
134135
android:orientation="horizontal"

app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@
621621
<string name="short_speak_readings_shortcut">Show a shortcut in the ☰ menu to toggle Speak Readings</string>
622622
<string name="speak_readings_shortcut">Speak Readings Shortcut</string>
623623
<string name="battery_optimization_off">On Android 6+ ensure battery optimization is switched off (recommended).</string>
624-
<string name="battery_optimization_on">Don\'t keep asking about battery optimization (not recommended).</string>
624+
<string name="battery_optimization_on">Will not keep asking about battery optimization when enabled (not recommended).</string>
625625
<string name="battery_optimization_prompt">Battery Optimization prompt</string>
626626
<string name="advanced_bluetooth_settings">Advanced Bluetooth Settings</string>
627627
<string name="bluetooth_settings">Bluetooth Settings</string>

app/src/main/res/xml/pref_advanced_settings.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1494,8 +1494,7 @@
14941494
<CheckBoxPreference
14951495
android:defaultValue="false"
14961496
android:key="requested_ignore_battery_optimizations_new"
1497-
android:summaryOff="@string/battery_optimization_off"
1498-
android:summaryOn="@string/battery_optimization_on"
1497+
android:summary="@string/battery_optimization_on"
14991498
android:title="@string/battery_optimization_prompt" />
15001499
<CheckBoxPreference
15011500
android:defaultValue="true"

app/src/main/res/xml/pref_data_source.xml

+5-14
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
android:singleLine="true"
233233
android:summary="Login password for Dex Share Following"
234234
android:title="Share Password" />
235+
<CheckBoxPreference
236+
android:defaultValue="true"
237+
android:key="dex_share_us_acct"
238+
android:summary="Your account and follower app are from the USA"
239+
android:title="US Servers" />
235240

236241
<ListPreference
237242
android:defaultValue="gb"
@@ -410,20 +415,6 @@
410415
android:summary="@string/summary_dex_specified_slot"
411416
android:title="@string/title_dex_specified_slot" />
412417
</PreferenceCategory>
413-
<PreferenceCategory
414-
android:key="old_g5_options"
415-
android:title="@string/title_old_g5_options">
416-
<CheckBoxPreference
417-
android:defaultValue="false"
418-
android:key="run_ble_scan_constantly"
419-
android:summary="@string/g5_scan_constantly"
420-
android:title="@string/scan_for_g5_constantly" />
421-
<CheckBoxPreference
422-
android:defaultValue="false"
423-
android:key="run_G5_ble_tasks_on_uithread"
424-
android:summary="@string/g5_force_ui_thread"
425-
android:title="@string/force_g5_ui_thread" />
426-
</PreferenceCategory>
427418
<PreferenceCategory
428419
android:key="dex_battery_category"
429420
android:title="@string/title_g5g6_battery_options">

0 commit comments

Comments
 (0)