-
Notifications
You must be signed in to change notification settings - Fork 406
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
Android partial wakelock for 75%+ time drains battery #417
Comments
I also tried the distance filter but that was even worse in terms of wakelocks. It showed the phone being continually awake. |
Yeah I agree, it's time to investigate if those CPU wakeLocks are still necessary. |
Relevant discussion from react-native variant #417 |
The link is just to this issue... can you double-check it? |
Oh you are right. ;) Should be this one. mauron85/react-native-background-geolocation#180 |
I removed the wakelock from the activity provider and it works like a charm in Android. 5% awake time! Now, my worry is that we don't keep a wakelock when firing the Javascript |
I would say, this only affects Android, as no wakeLocks are used in iOS. I know that cordova keeps js timers running in background, so it's possible that we don't need any wakelocks at all. I don't have any actual recommendation. Maybe bit of testing. Keep in mind that plugin core is shared with react-native too. |
I've removed the wakelocks in both providers and it works fine for me in Android. It's still calling the Javascript callback and even allowing an AJAX post from within the callback. Did you want a PR? |
@grassick Yes, you're very welcome to do so ;) |
fixed in 3.0.0-alpha.29 |
Your Environment
cordova -v
): 8.0.0cordova platform ls
): Android 6.4.0Context
Both distance and activity provider drain battery much more quickly than expected (12+%/hr). Using BetterBatteryStats and other tools show that the phone is almost continually awake when BackgroundGeolocation is running.
Expected Behavior
I expected the phone to be asleep mostly between location detections.
Actual Behavior
Phone was awake 77% of time due to plugin.
Possible Fix
Only wake up every N minutes to get a location?
Steps to Reproduce
The text was updated successfully, but these errors were encountered: