-
-
Notifications
You must be signed in to change notification settings - Fork 972
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(battery_plus): Implement not charging battery state #2275
fix(battery_plus): Implement not charging battery state #2275
Conversation
Thanks for your contribution, but I can't accept this PR as it is only covering Android platform. |
I think what @vbuberen was trying to say is, that we appreciate the work that you have done, but that we have decided to only accept PRs that provide feature parity for the mobile platforms. As such you (or someone else) would need to add the same functionality for iOS for this PR to move out of a draft status and into the review phase. @codercengiz are you planning on creating an iOS implementation as well? |
There were no request to translate or interpret what I wrote there. Also, I would ask you to not use |
This can't be added because currently iOS has no separate state for |
@vbuberen if it cannot be added to iOS, imho this would imply that this PR is already feature complete, because, even if a feature cannot be added for all platforms it should still be ok to add it to the ones which support it. If I remember correctly thats how it is handled in some of the other plugins. |
I would like to do some tests to check a few assumptions first. Will get back to this PR later today when have more time. |
855f239
to
227da29
Compare
After an additional research I found out that there is a possibility to implement same |
Description
Normally, there are 5 different states to define the battery state on the Android side:
https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_CHARGING
full
,charging
,discharging
,not _charging
,unknown
. But in the current code base,discharging
andnot_charging
are considered the same, and both are parsed asdischarging
.With this change, if the Android SDK has a
not_charging
state, the Flutter side will also see this state.On Samsung phones, if we enable battery protection, the phone charges up to 85%. When it reaches 85%, the status changes from
charging
tonot_charging
. When I checked, the current used is almost 0 mA.Related Issues
Fix #2274
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.