[Oukitel (All phone models)] SwedishForenger:
Messages and Notification
​

Do to Oukitel's STRANGE power management settings in their phones, getting permissions to run apps in the background, ore just NOT having the lock-screen kill all running apps, can be a challenge. Although there are usually different solutions built into the firmware, like edited android settings app, this works poorly, or not at all, leaving you, the user, with apps you can't receive notifications from, or app shut down in the background when you lock the phone with the lockscreen. But since this is Android, we can fix most of the problems Oukitel creates in their heavily edited Android versions for their phones.

Since Android 9, there is an implemented API for the power management system. This API we can manipulate and adapt our changes to. Since Android 9 you can define your apps status and permissions, depending on how often you use the apps. the system normally takes care of this problem, by pausing and deleting persituins to the unused app, to preserve power. However, Oukitel have turnd off the self-automated system, and replace it with their own.

App Standby Buckets​

Android 9 introduces a new battery management feature, App Standby Buckets. App Standby Buckets helps the system prioritize apps' requests for resources based on how recently and how frequently the apps are used. Based on the app usage patterns, each app is placed in one of five priority buckets. The system limits the device resources available to each app based on which bucket the app is in.

Bucket 1:

Active :

adb shell am set-standby-bucket <package-name> 10

bucketAn app is in the active bucket if the user is currently using the app, for example:

The app has launched an activity

The app is running a foreground service

The app has a sync adapter associated with a content provider used by a foreground app

The user clicks on a notification from the app

If an app is in the active bucket, the system does not place any restrictions on the app's jobs, alarms, or FCM messages.

Bucket 2:

Working :

adb shell am set-standby-bucket <package-name> 20

An app is in the working set bucket if it runs often but it is not currently active. For example, a social media app that the user launches most days is likely to be in the working set. Apps are also promoted to the working set bucket if they're used indirectly. If an app is in the working set, the system imposes mild restrictions on its ability to run jobs and trigger alarms.

Bucket 3:

Frequent :

adb shell am set-standby-bucket <package-name> 30

An app is in the frequent bucket if it is used regularly, but not necessarily every day. For example, a workout-tracking app that the user runs at the gym might be in the frequent bucket. If an app is in the frequent bucket, the system imposes stronger restrictions on its ability to run jobs and trigger alarms, and also imposes a cap on high-priority FCM messages.

Bucket 4:

Rare :

adb shell am set-standby-bucket <package-name> 40

An app is in the rare bucket if it is not often used. For example, a hotel app that the user only runs while they're staying at that hotel might be in the rare bucket. If an app is in the rare bucket, the system imposes strict restrictions on its ability to run jobs, trigger alarms, and receive high-priority FCM messages. The system also limits the app's ability to connect to the internet.

Bucket 5:

Never :

adb shell am set-standby-bucket <package-name> 0

Apps that have been installed but never run are assigned to the never bucket. The system imposes severe restrictions on these apps.

To add a app to a specific bucket, you add the apps by using adb:

adb shell am set-standby-bucket packagename active|working_set|frequent|rare

adb shell am set-standby-bucket net.homesafe active ore
adb shell am set-standby-bucket net.homesafe 10

adb shell am set-standby-bucket org.telegram.messenger working_set ore
adb shell am set-standby-bucket org.telegram.messenger 20
Etc Etc Etc

To check what bucket your app is current running in.

adb shell am get-standby-bucket [packagename] :

adb shell am get-standby-bucket org.telegram.messenger

You can undo your manual device settings with this command:

adb shell dumpsys battery reset

____________________________________________________________

Automate "rooted" --
​

The video below is from 2016 and a lot has changed technically since then, but the principle is the same. Download the new version of Script Manager here!.

View attachment 6047447 View attachment 6047449 View attachment 6047450 View attachment 6047451

View attachment 6047452 View attachment 6047453 View attachment 6047454 View attachment 6047455

.