3

I made an app to display battery and network info in the status bar. For over 10 months the app did a 100% reliable job on a Nexus 6P (Marshmallow).

After I switched to a Pixel (Nougat 7.1.2) I recognised that the service seems to be getting stopped by the OS. The values in the status bar showing some old state.

Sadly I do not get an error and the issue comes up very rarely (less than once a week). I already updated to buildToolsVersion '25.0.2'

The project on GitHub.

Please let me know, if you have any idea how to fix or investigate.

Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68
  • 1
    Did you read the documentation about [the changes that were made in Android 7.0](https://developer.android.com/about/versions/nougat/android-7.0-changes.html#bg-opt)? You might also want to consider [migrating to `JobScheduler`, per the Android O background processing limitations](https://developer.android.com/preview/features/background.html). – CommonsWare Mar 21 '17 at 23:35
  • Thanks CommonsWare. Unfortunately there is no BCR registered in the manifest and none of the three "critical" BRC is in use. But your comment was helpful nevertheless. Following your links I found https://developer.android.com/training/monitoring-device-state/doze-standby.html#testing_doze_and_app_standby. The "ugly": After waking up the device, logcat outputs the method-calls like it should. – Martin Pfeffer Mar 22 '17 at 02:27
  • I'm having the exact same problem. Any updates on how to resolve this? – Mahorad Sep 14 '17 at 19:22
  • Hmm, hard to say. Did you try other phones? I made only small refactorings / improvements and the app seems to run fine. But I recently tested on a bunch of Samsung devices (S8, Galaxy Tab 2016). Sold the Pixel early. I guess it's some kind of OS-related. – Martin Pfeffer Sep 14 '17 at 20:00

0 Answers0