Skip to content

Commit

Permalink
No battery options for G7 (#3295)
Browse files Browse the repository at this point in the history
* No battery options for G7

* Cleanup

* Try exception added

---------

Co-authored-by: Navid <[email protected]>
  • Loading branch information
Navid200 and Navid200 authored Mar 10, 2024
1 parent 46acfd6 commit bedcb2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ public static boolean shortTxId() {
return getTransmitterID().length() < 6;
}


private static Ob1Work enqueueCommand(BaseMessage tm, String msg) {
if (tm != null) {
final Ob1Work item = new Ob1Work(tm, msg);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.eveningoutpost.dexdrip.utils;

import static com.eveningoutpost.dexdrip.utils.DexCollectionType.getBestCollectorHardwareName;
import static com.eveningoutpost.dexdrip.xdrip.gs;

import android.Manifest;
Expand Down Expand Up @@ -1731,6 +1732,16 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
}
}

if (getBestCollectorHardwareName().equals("G7")) { // Remove battery options, from G5/G6/Dex1/G7 Debug Settings, if we are using G7 or One+
try {
PreferenceScreen screen = (PreferenceScreen) findPreference("xdrip_plus_g5_extra_settings");
Preference pref = getPreferenceManager().findPreference("dex_battery_category");
screen.removePreference(pref);
} catch (Exception e) {
UserError.Log.wtf(TAG, "Failed to remove G7 battery options");
}
}

//Remove CL prefs for NON CLFollower
if (collectionType != DexCollectionType.CLFollow) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@
<string name="summary_ob1_initiate_bonding_flag">OB1 collector can initiate bonding.</string>
<string name="title_ob1_initiate_bonding_flag">Allow OB1 initiate bonding</string>
<string name="title_old_g5_options">Old G5 Collector Settings</string>
<string name="title_g5g6_battery_options">G5/G6/G7/1 battery options</string>
<string name="title_g5g6_battery_options">G5/G6/Dex1 battery options</string>
<string name="title_g5_battery_warning_level">Adjust battery warning level</string>
<string name="title_plugins_and_features">Plugins and Features</string>
<string name="title_color_heart_rate1">Heart rate monitor</string>
Expand Down

0 comments on commit bedcb2e

Please sign in to comment.