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

Offer to stop a G7 in engineering mode only #3319

Merged
merged 2 commits into from Feb 17, 2024

Conversation

Navid200
Copy link
Collaborator

We have already started to see posts of people asking for help who have stopped a G7.
Under normal circumstances, there is no reason to ever stop a G7.

This PR will not show the stop option in the main menu if we are using a G7 unless engineering mode is enabled.

I have tested this with a G7 and verified that enabling engineering mode shows the stop option and disabling engineering mode removes the stop option.
I have tested it with a G6 and confirmed that the stop sensor option is available regardless of engineering mode.

@Navid200
Copy link
Collaborator Author

This is an example of a post that worries me about xDrip offering to stop a G7.

Screenshot 2024-01-27 085008

@@ -101,8 +103,10 @@ public NavDrawerBuilder(final Context context) {
}
}
}
this.nav_drawer_options.add(context.getString(R.string.stop_sensor));
this.nav_drawer_intents.add(new Intent(context, StopSensor.class));
if (getBestCollectorHardwareName() != "G7" || Pref.getBooleanDefaultFalse("engineering_mode")) { // If we are using G7, offer the stop sensor option in engineering mode only
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should use equals() for string comparisons as otherwise it is comparing the object reference rather than the content.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the guidance.
Done

@Navid200
Copy link
Collaborator Author

Navid200 commented Feb 7, 2024

Tested again after correcting the syntax.
Tested with G7 and G6.

@jamorham jamorham merged commit 3381fe9 into NightscoutFoundation:master Feb 17, 2024
1 check passed
@Navid200
Copy link
Collaborator Author

Thanks

@Navid200 Navid200 deleted the Navid_2024_01_27 branch February 17, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants