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
Merged
Changes from 1 commit
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 @@ -18,13 +18,15 @@
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;

import java.util.ArrayList;
import java.util.List;

import static com.eveningoutpost.dexdrip.services.Ob1G5CollectionService.getTransmitterID;
import static com.eveningoutpost.dexdrip.utils.DexCollectionType.getBestCollectorHardwareName;

/**
* Created by Emma Black on 11/5/14.
Expand Down Expand Up @@ -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

this.nav_drawer_options.add(context.getString(R.string.stop_sensor));
this.nav_drawer_intents.add(new Intent(context, StopSensor.class));
}
} else {
this.nav_drawer_options.add(context.getString(R.string.start_sensor));
this.nav_drawer_intents.add(new Intent(context, StartNewSensor.class));
Expand Down
Loading