3 ms·
Very possible on Android versions that are closer to AOSP. Shitty vendor forks, probably not.
by oynqr 3y ago
Very possible on Android versions that are closer to AOSP. Shitty vendor forks, probably not.
- charcircuit 3y agoNot really, unless the user goes to the settings and disables battery optimization for the app. If the device is idling the app will only be able to wake up periodically. Starting at 15 minutes and exponentially grows to up to 6 hours [0]. Element works around this by abusing exact alarms, which require the user to grant a permission, together with a wakelock, but this approach will probably not last forever. [0] https://cs.android.com/android/platform/superproject/+/master:frameworks/base/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java;l=1041?q=force-idle https://cs.android.com/android/platform/superproject/+/maste...
- kelnos 3y ago> Not really, unless the user goes to the settings and disables battery optimization for the app That sounds "very possible" to me. Apps can even pop up a dialog on first run instructing the user to disable battery optimization, and then load up that settings page when the user taps a button in the dialog. Certainly some people will be confused by it, still not know what to do, or not want to do it, but it's still quite possible. And if the user won't do it, the app can still spin up a service with a foreground notification if they really want to keep things working decently well, and use Android's scheduled jobs mechanism to restart the service every 10 minutes (or however often) to catch cases where the service still ends up getting killed.