Skip to content
99tests Blog
Real devices and browsers

Android Background Restrictions: Testing HyperOS, ColorOS, One UI

What Doze, App Standby and each phone maker's own battery manager do to background work, and how to test an app against them on Redmi, Realme, Vivo and Galaxy phones.

Android background restrictions cover: sketches of two phones, one showing a low battery and one a sleeping moon, with an alarm clock
In this article
  1. What Android background restrictions are on stock Android
  2. Why the same build behaves differently on four phones
  3. The four switches to find on every skin
  4. HyperOS on Redmi phones: autostart, battery saver and locked apps
  5. ColorOS and realme UI on OPPO and Realme: auto-launch and quick freeze
  6. Funtouch OS and OriginOS on Vivo: autostart and background power
  7. One UI on Galaxy: sleeping, deep sleeping and never sleeping apps
  8. How to test Android background restrictions with adb
  9. A worked test matrix for one feature
  10. What to put in the bug report
  11. What a pass looks like under Android background restrictions
  12. Frequently asked questions

A QA engineer in Hyderabad signs off build 5.3.0 of a medicine reminder app on a Tuesday. On her Pixel 8 the 8:00 am reminder has fired on time five mornings out of five, and the refill alert has arrived within seconds of the pharmacy packing an order.

By Friday the one-star reviews are in, and they name phones: a Redmi Note 13, a Realme Narzo 60, a Vivo Y28, a Galaxy A15. The reminder came at 8:40. It came only when the phone was picked up. On one phone it stopped altogether after the app was cleared from the recents screen.

The code was the same on every handset. The rules it ran under were not. Each of those makers puts its own battery and background limits on top of Android's, and a tester who only uses a Pixel never meets them. This guide covers what Android background restrictions are, what HyperOS, ColorOS, Funtouch OS and One UI add to them, and how to test an app against each one before your users do it for you.

What Android background restrictions are on stock Android

Android has limited background work since version 6.0, and the limits come in layers. Knowing which layer stopped your app is half of the bug report.

Doze applies to the whole phone. It starts when the device has been unplugged, still and screen-off for a while, and ends when the user moves it, turns on the screen or connects a charger. While it lasts, the system suspends network access, ignores wake locks, holds back jobs and syncs, and defers ordinary alarms to short maintenance windows that come less often the longer the phone sits (Android's Doze and App Standby guide).

App Standby applies to one app at a time. Since Android 9 every app sits in a bucket: Active, Working set, Frequent or Rare, with a Restricted bucket added in Android 12. The lower the bucket, the less often the app's jobs and alarms run. An app in the Restricted bucket gets one 10-minute batch of jobs a day and one alarm a day, and on Android 13 and later an app the user has not touched for 8 days is moved there unless it is exempt (App Standby Buckets).

Battery saver applies when the user or the phone switches it on. On stock Android builds it pushes apps into standby sooner, cuts network access for background apps and may turn off location while the screen is off (Android 9 power management).

Background restriction is the per-app switch in battery settings. A restricted app still opens when the user taps it, but in the background it cannot run jobs, alarms or foreground services or use the network (Android's app power management notes).

LayerWhat switches it onWhat the app loses
DozePhone unplugged, still, screen offNetwork, wake locks, jobs, syncs and ordinary alarms until the next maintenance window
App Standby bucketHow recently and how often the user opens the appJob and alarm frequency; in Rare, internet access too
Restricted bucketNo interaction for 8 days on Android 13 and later, or too many broadcasts or bindings in a dayAll but one 10-minute job session and one alarm a day
Battery saverThe user, or a low batteryBackground network; location may stop with the screen off
Background restrictionThe user, per appBackground jobs, alarms, network and foreground services

One line in those pages matters more than the rest for anyone testing in India. Google's bucket page says every manufacturer can set its own criteria for which bucket an app lands in, and its battery saver notes say the device maker decides the exact restrictions. The table is the floor. The phone in your hand may add to it.

Why the same build behaves differently on four phones

Xiaomi, OPPO, Realme, Vivo and Samsung each ship Android under their own skin, and each skin carries its own power manager. The community site dontkillmyapp.com tracks them maker by maker and gives each what it calls a negative score. Stock Android scores 0. Xiaomi, Samsung and OnePlus score 5, OPPO 4, Vivo and Realme 3.

Phone makers are allowed to do this, inside limits that Google writes down. The Android 16 Compatibility Definition, the list of requirements a device must meet to be called compatible, has a section on proprietary app restrictions (section 3.5.1). When a maker's mechanism is stricter than the Restricted bucket, the phone must:

  • show the user the list of restricted apps, with an on and off switch for each one;

  • not restrict an app automatically without evidence that it harms system health, and never on grounds such as low popularity;

  • tell the user in the 24 hours before a restriction is applied automatically;

  • leave alone any app whose restrictions the user has switched off by hand;

  • never restrict the app the user is using in the foreground;

  • answer true when the app calls ActivityManager.isBackgroundRestricted();

  • publish a clear public document on when and how apps are restricted and how they can be exempted.

Section 3.5 itself says a maker must not keep normal API behaviour only for a list of apps it has picked.

Two things follow for a tester. A restriction is not a defect in the phone, so "works on Pixel" closes no tickets. And the rules give you things to check: was there a list, a switch and a warning? If your app was put to sleep without them, say so in the report.

SkinPhonesNames to look for in Settingsdontkillmyapp score
HyperOS, and MIUI on older modelsRedmi, XiaomiBackground autostart; Battery saver per app with No restrictions; lock in recents5
ColorOS, realme UIOPPO, RealmeAllow auto-launch; Allow background activity; App quick freeze4 and 3
Funtouch OS, OriginOSVivoAutostart; High background power consumption3
One UISamsung GalaxySleeping apps; Deep sleeping apps; Never sleeping apps5

The four switches to find on every skin

The names change from maker to maker, but the same four controls turn up on nearly every skin. Find all four on each test phone before you run a single case.

Four switches to find on every Android skin: start in the background, per-app battery mode, recents behaviour, and savers and cleaners
  1. Start in the background. A permission, usually called autostart or auto-launch, that decides whether the app may start itself when the user has not opened it.

  2. Per-app battery mode. A setting that runs from unrestricted to restricted. The generous end is called No restrictions on Xiaomi, Allow background activity on realme UI and Never sleeping on Galaxy.

  3. Recents behaviour. On several skins, swiping an app off the recents screen can end its background work as well. A lock or pin on the app's card is the usual protection.

  4. Savers and cleaners that act on their own. System battery saver, "super" saver modes, sleep-time optimisers and features that put unused apps to sleep after some days.

Practical rule: run every background case twice on each skin, once with the phone exactly as it came out of the box and once with everything granted. The gap between the two runs is what your users live with.

HyperOS on Redmi phones: autostart, battery saver and locked apps

dontkillmyapp's Xiaomi page describes the company's skin as one of the most restrictive, with background limits that have no public API or documentation, and says background processing does not work properly by default. Three controls matter.

  • Background autostart. Xiaomi's own support pages give the path as Settings, Apps, Background autostart. On MIUI 14, dontkillmyapp found it inside each app's App permissions screen, so expect the path to move between versions.

  • Battery saver, per app. Each app has its own battery saver setting, and the choice that lifts the limits is No restrictions.

  • Lock in recents. Dragging the app's card down in the recents screen, or long-pressing it and tapping the padlock, locks the app so the system is less likely to close it.

The clearest evidence that the defaults bite comes from Xiaomi itself. The FAQ for its Smart Band tells owners of Xiaomi and Redmi phones to set the Mi Fitness app's background use to unlimited, lock it in the background and turn off power saving mode. If the maker's own companion app needs three changes to keep working, yours does too.

ColorOS and realme UI on OPPO and Realme: auto-launch and quick freeze

OPPO's ColorOS and Realme's realme UI share a vocabulary. dontkillmyapp's Realme page finds everything under Battery, in an App battery management screen where each app has its own switches, among them Allow auto-launch, Allow foreground activity and Allow background activity.

The same page names features that act without asking the app:

  • Power saving mode may terminate background processes, and Super power saving mode allows at most six apps to run.

  • App quick freeze stops the apps on its list from running in the background and from sending or receiving notifications.

  • Sleep standby optimization sits among the power saver options. The site's OnePlus page, which covers a setting of the same name, says it prevents push notifications from being delivered.

That last one deserves its own case. Send a test push at 2 am to a Realme that has sat on a bedside table since 11 pm, and note the minute it arrives. Our guide on how to test push notifications has the checks to run alongside it.

Funtouch OS and OriginOS on Vivo: autostart and background power

dontkillmyapp's Vivo page admits that Vivo's restrictions have not been fully mapped. It does document three things.

  • Autostart, under Settings, More settings, Applications on recent versions. An app that has to load from the background needs it.

  • High background power consumption, under Settings, Battery, also labelled Background power consumption management. The app has to be switched on in this list.

  • A lock on the app's card in the recents screen, as on Xiaomi.

Vivo adds one more variable. OriginOS 6, based on Android 16, began reaching Vivo phones in India in November 2025, starting with the X200 series, and 91mobiles reported that it marks the end of Funtouch OS in India. A device pool will hold both skins for some time. Read the skin name and version from About phone and put it in every finding.

One UI on Galaxy: sleeping, deep sleeping and never sleeping apps

Samsung publishes its thresholds, which makes One UI the easiest of the four to test against. Its developer guide to app management describes three lists under Battery, in Background usage limits.

ListHow an app gets thereWhat happens to it
Sleeping appsNot used for about 3 days and hurting system health, such as battery; or added by the userJobs, alarms and foreground services are restricted
Deep sleeping appsNot used for a long period, currently 16 days; or added by the userActive only while open; no notifications or updates in the background
Never sleeping appsAdded by the userExempt from both
Timeline of what happens to an Android app nobody opens: Sleeping apps on Galaxy at day 3, Restricted bucket on Android 13 and later at day 8, Deep sleeping apps on Galaxy at day 16

The guide also gives developers an intent that opens these lists, so an app can take the user straight to Never sleeping apps instead of describing a menu path. It records one change too: since One UI 6 on Android 14, foreground services of apps that target Android 14 and follow Android's foreground service rules are guaranteed to work as intended.

Because a user can add an app to the Sleeping or Deep sleeping list by hand, a tester can too. That turns a 16-day wait into a two-minute setup. dontkillmyapp's Samsung page adds a warning: Samsung may put apps back on the restricted lists after a firmware update, so a Galaxy that passed last month needs a recheck after it updates.

How to test Android background restrictions with adb

Android's own layers can be forced from a laptop, which saves hours of waiting. These commands come from Android's power testing guide and the Doze guide linked above. Replace com.example.app with your package name. In order, the groups below simulate an unplugged phone, force Doze and leave it, mark the app idle and check, move it to the Rare bucket and read that back, apply and remove a background restriction, switch battery saver on, and put the battery state back.

adb shell dumpsys battery unplug

adb shell dumpsys deviceidle force-idle
adb shell dumpsys deviceidle unforce

adb shell am set-inactive com.example.app true
adb shell am get-inactive com.example.app

adb shell am set-standby-bucket com.example.app rare
adb shell am get-standby-bucket com.example.app

adb shell cmd appops set com.example.app RUN_ANY_IN_BACKGROUND ignore
adb shell cmd appops set com.example.app RUN_ANY_IN_BACKGROUND allow

adb shell settings put global low_power 1

adb shell dumpsys battery reset

After each one, repeat the user action and watch the app. Does the reminder fire? Does the order status refresh? Then open the app and check that it catches up. Android's guidance is to make sure the app recovers gracefully, and not to try to influence which bucket it is given.

What adb does not reach is the skin's own switches. None of the sources above documents a command for Background autostart, auto-launch or Samsung's sleeping lists, and dontkillmyapp lists no developer-side fix for Samsung, Realme or Vivo. Those states are set by hand, on the phone. A stock emulator image has none of them, one of several gaps covered in emulator vs real device testing.

A worked test matrix for one feature

Take the 8:00 am reminder from the opening and run it through seven phone states. The expected result is the same in every row: the reminder shows at 8:00. The last column is one illustrative run on a Redmi, to show what a filled-in sheet looks like. It is not a prediction for your app.

#Phone stateSetupExample result
1Out of the boxFresh install, reminder set, Home pressed, screen locked8:00
2Left overnightUnplugged and untouched from 11 pm8:00
3Cleared from recentsApp swiped away at 11 pmNot shown until the app was opened at 9:12
4RestartedPhone rebooted at 11 pm, app not openedNot shown
5Battery saverSaver switched on at 11 pm8:00
6UnusedApp not opened for 3 days8:26 on day 4
7Everything grantedAutostart on, No restrictions, locked in recents; rows 3 and 4 repeated8:00 both times

Rows 3 and 4 fail and row 7 passes, so the cause is the skin's switches and not the alarm code.

Run the same seven states for every background feature the app has: a push notification, a location update with the screen off, a background upload, and the half minute the app spends in the background while the user approves a payment in a UPI app. The last of these is walked through in how to test a UPI payment flow.

For devices, one phone per skin family is the minimum: a Redmi, an OPPO or Realme, a Vivo, a Galaxy, and one stock Android phone such as a Pixel as the control. Our guides to choosing devices for mobile app testing in India and Android application testing across devices and OS versions cover the wider selection.

What to put in the bug report

A background finding needs more environment detail than any other kind. Add these lines to the usual build, device and network block.

  • Skin and version, read from About phone: "HyperOS 2.0", not "Xiaomi".

  • Android version.

  • Autostart or auto-launch: on or off.

  • Per-app battery mode: the exact label on the screen.

  • System battery saver: on or off, with the battery percentage.

  • Recents: left open, swiped away or locked.

  • Idle time: how long since the app was last opened, and whether the phone was on charge.

  • Recovery: what the app showed when it was next opened.

Practical rule: a background failure is only a finding when the report says which switch was in which position. "Notification late on Vivo" is a complaint. "Autostart off, app swiped from recents, push shown 43 minutes later when the app was opened" is a bug report.

The wider craft of writing steps a second person can follow is in steps to reproduce a bug, and the full field list is in our bug report template.

What a pass looks like under Android background restrictions

A test needs a pass mark, and "works with every restriction switched on" is not a fair one. These four are.

User-facing alerts use the channels Android protects. The Doze guide says Firebase Cloud Messaging is built to work with Doze and App Standby, that alarms set with setAlarmClock() still fire in Doze, and that other alarms allowed during idle fire no more than once every nine minutes per app. A reminder built on an ordinary alarm will be late by design.

The app does not ask for an exemption it is not entitled to. The same guide states that Google Play policy prohibits apps from requesting direct exemption from Doze and App Standby unless their core function is adversely affected. Its examples: a safety app or a task automation app may qualify, and a chat app that could use FCM does not.

The app knows when it is restricted, and says so. The compatibility rules require isBackgroundRestricted() to tell the truth. An app can check it on opening and show one screen that names the setting to change on that brand, with Samsung's intent as the shortcut on a Galaxy.

The app catches up when opened. Whatever was missed in the background should appear within a few seconds of the next launch: the right order status, the missed reminder marked as missed, the upload resumed.

Frequently asked questions

Is it a bug in my app if the phone's battery manager stops it? It is a finding either way. The phone is doing what its maker designed. The question is whether the user loses something the app promised, such as a reminder, an OTP or a delivery update, and whether the app recovers or explains. File it with the switch positions and let the team decide how to design around it.

Can the app send users to the battery settings? Yes. Android provides an intent that opens the battery optimisation list, and the Doze guide says most apps can use it. Asking for direct exemption through a system dialog is the part Google Play limits to apps whose core function depends on it.

Do emulators and cloud device farms show these limits? Only partly. An emulator can be forced into Doze or a bucket with adb, but it has no skin. A real phone in a rack has the skin, but Doze ends when a charger is connected and plugging in releases apps from standby, so a phone that is always on charge never reaches those states by itself. We compared the options in cloud based software testing.

Do the settings survive an OS update? Not reliably. dontkillmyapp reports that OnePlus phones have reset them with firmware updates and that Samsung may re-add apps to its restricted lists. Rerun rows 3, 4 and 7 of the matrix after every major update to a phone in your pool.


Background limits only show up on the phones that have them, with the switches where real users leave them. 99tests runs your test cases on tester-owned Redmi, Realme, Galaxy, Vivo and iPhone handsets on Jio, Airtel and Vi, and a reviewer verifies every finding before it reaches you, with steps, expected and actual results, environment details and a screenshot or recording. Read a sample report, start from the free test case library of 950 cases across 25 flows, or look at the fixed-price packages.