Doze mode and foreground service

前端 未结 2 1207
清歌不尽
清歌不尽 2020-11-28 14:53

Checking my app\'s behavior on M Preview device, it seems that its foreground (with active notification) service playing music is not affected by Doze mode.

相关标签:
2条回答
  • 2020-11-28 15:26

    In this post's comments on Sep 17 Dianne Hackborn writes:

    Apps that have been running foreground services (with the associated notification) are not restricted by doze.

    So yes, your findings seem to be the intended behavior.

    0 讨论(0)
  • 2020-11-28 15:41

    Attention, Foreground service can prevent your app never into app standby, but not doze.

    Here use adb cmd to test

    $ adb shell dumpsys battery unplug    
    $ adb shell am set-inactive <packageName> true
    
    0 讨论(0)
提交回复
热议问题