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

New battery optimization request permissions popup. #209

Merged

Conversation

louisg1337
Copy link
Contributor

Integrated the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission so that users will just get a pop up now asking them to turn off battery optimization instead of having to go dig through their settings as per issue 980.

This is also an extension of this closed PR. I created this new PR to clean up the commit history as the previous PR was really hard to understand.

Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

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

Nice clean PR! Note that the issue is not fully done. Once I have merged this PR, I will create a new release on e-mission-data-collection. You will then need to submit a PR on e-mission-phone to bump up the version number in package.cordovabuild.json so that the new version of the plugin is actually used in the UI

@@ -93,6 +93,8 @@ void requestPermission() {
String.format("After iterating over all entries in %s shouldShowRequest = %s", currPermissions, shouldShowRequestRationaleBefore));
if (openAppSettings) {
SensorControlForegroundDelegate.this.openAppSettingsPage(cordovaCallback, permissionStatusConstant);
} else if (permissionStatusConstant == SensorControlConstants.IGNORE_BATTERY_OPTIMIZATIONS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat! I like the reuse of the existing permissions mechanism. In a future cleanup, we may want to also change openAppSettings from a separate boolean to using a separate constant and clean up that interface...

@shankari shankari merged commit 6a4d0d1 into e-mission:master Sep 29, 2023
@shankari
Copy link
Contributor

@louisg1337 louisg1337 deleted the battery_optimization_plugin_rework branch October 2, 2023 18:42
Abby-Wheelis pushed a commit to JGreenlee/e-mission-phone that referenced this pull request Oct 6, 2023
As a result of e-mission/e-mission-data-collection#209, we now have a popup for this permission, so all the user needs to do is allow it!

Translate PR to follow with this small change to en.json
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.

2 participants