我有一個前臺通知服務,它使用ActivityRecognition持續監視用戶的操作,並在用戶狀態發生變化時將其寫入AWS。它在一段時間內運行良好。不過,我注意到,當用戶閒置較長時間,例如用戶在一夜之間睡覺時,應用程序(活動和服務)就會無聲無息地死去。我認爲這是因爲打盹模式(因爲我在同一個應用程序在不同的手機上列入白名單,現在工作正常,已超過2天)Android M:如何以編程方式禁用打盹模式
How to WhiteList app in Doze mode Android 6.0給出了關於如何通過用戶干預禁用打盹模式的好概述。但@commonsware博客下方提示關於谷歌「可能」禁止,顯示相應的彈出框 https://commonsware.com/blog/2015/11/11/google-anti-trust-issues.html
Note: Google Play policies prohibit apps from requesting direct exemption from Power Management features in Android 6.0+ (Doze and App Standby) unless the core function of the app is adversely affected.
有人可以幫助我瞭解什麼功能都不可能包括「核心功能」的應用,因此谷歌不會禁止我的應用程序我們知道,休眠模式不會影響例如WhatsApp
編輯
一些應用程序我見到這對三星手機6.0.1
https://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases是我所知道的關於該主題的唯一文檔。 – CommonsWare