Work Manager on chinese ROMs like Xiaomi and oppo, when under battery optimization, increase the scheduled delay of work by several hours

前端 未结 6 1723
星月不相逢
星月不相逢 2020-12-06 08:20

Work Manager on Chinese ROMs like Xiaomi and Oppo, when under battery optimization, increase the scheduled delay of work by several hours., however, I have noticed some apps

6条回答
  •  时光取名叫无心
    2020-12-06 08:59

    Similar questions have best asked in the past here and here.

    This has been also asked on WorkManager's issue tracker: are the Chinese manufacturers (Huawei, Oppo, Xiaomi...) supported?

    To summarize: this is a known issue with some Android OEM that heavily modify this part of Android for battery optimization. There's nothing that WorkManager can do to solve this issue.

    Aside having you application added to the whitelist, you can really only report the issue:

    • to the OEM (Xiaomi in this case) to avoid this kind of breaking changes.
    • to Google, to add a test in the CTS and avoid these behaviours by the OEMs. Please open an issue here to document the problem to Google.

    You can take a look at the exact instruction to add to your app in a whitelist for the different devices on the amazing website don't kill my app, also I've seen this library on github that can be useful to simplify the process for your users.

提交回复
热议问题