Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No battery options for G7 #3295

Merged
merged 4 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,12 @@ 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+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good idea to wrap this with a try{} catch{} pair and log at wtf level if an exception is generated, otherwise future changes to preferences structure can cause crashes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks. It will be done.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

PreferenceScreen screen = (PreferenceScreen) findPreference("xdrip_plus_g5_extra_settings");
Preference pref = getPreferenceManager().findPreference("dex_battery_category");
screen.removePreference(pref);
}

//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 @@ -1388,7 +1388,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
Loading