-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: fix-xiaomi-battery-safe-mode #3537
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
fix: fix-xiaomi-battery-safe-mode #3537
Conversation
Hello. I see that this PR is not following the Contributing Guidelines you also did not provide any context on what is this change about, and made changes on the pubspec files. Please address those or we will have to close this one. |
The PR is still draft. |
return if (mode != -1) { | ||
mode == POWER_SAVE_MODE_XIAOMI_VALUE | ||
} else { | ||
null | ||
checkPowerServiceSaveMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On some newer android version of xiaomi devices, the power safe mode is not available by querying POWER_SAVE_MODE_XIAOMI_NAME
.
This PR fallbacks to the default power safe mode. We are doing something similar for samsung as well.
@miquelbeltran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title according to our guidelines.
Also, I would appreciate if you revert the formatting. We have editor config file in the project with rules for formatting, so would be good if you use it for lines formatting.
As to the change itself - that is great that Xiaomi finally gets on track to use the default Android APIs. Thanks for dealing with this.
Looks like there is no reply to review and no access to edit the PR despite the request in the contributors guide. Not the first time from this contributor, even though the change is useful. Closing this PR and will open a fixed one instead. |
Description
This PR fixes a bug where the battery safe mode or power safe mode was not correctly fetched on Xiaomi devices. I added a comment in the PR at the important code that resolved the issue.
Related Issues
This resolves #3540
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!
in the title as explained in Conventional Commits).