android-appstandby

how to turn off doze mode for specific apps in marshmallow devices programmatically

馋奶兔 提交于 2020-01-23 02:44:48
问题 Marshmallow APIs are very different from previous android OS. When screen is off, devices are in doze mode and unable to sync network. So for doing background operations with network we have to prevent from doze mode. 回答1: Add below permission to manifest.xml <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> Call below method public void turnOffDozeMode(Context context){ //you can use with or without passing context if(Build.VERSION.SDK_INT >= Build

Remove app from whitelist in android marshmallow

自古美人都是妖i 提交于 2019-12-02 18:46:49
问题 I didn't find useful info how to programically or using device's settings remove specific app from white-listed. In android 6.0 was introduced doze-mode and while-listed, the last term allows ignore partially doze-mode. To put app in white-listed apps need to perform code: Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); I tried next actions to remove the app

Remove app from whitelist in android marshmallow

一笑奈何 提交于 2019-12-02 11:42:27
I didn't find useful info how to programically or using device's settings remove specific app from white-listed. In android 6.0 was introduced doze-mode and while-listed, the last term allows ignore partially doze-mode. To put app in white-listed apps need to perform code: Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); I tried next actions to remove the app from white-listed, which it has just been put, but nothing help me: clear data application in settings