Battery & Power Quiz

PERFORMANCE › Runtime

An app schedules a WorkManager request with no constraints while the device is deep in Doze. When does the work most likely run?

Answer: During the next Doze maintenance window or after Doze ends

WorkManager uses JobScheduler, whose jobs are deferred by Doze and run during periodic maintenance windows or once the device leaves Doze. The work is deferred, not cancelled.

Which conditions must all hold for the system to put a device into Doze mode?

Answer: Unplugged, still, and screen off for some time

Doze engages when the device is unplugged from power, stationary (not moving), and has the screen off for an extended period. Movement, screen-on, or plugging in exits Doze.

An app falls into the Restricted standby bucket. What is the approximate limit on its jobs?

Answer: About one batched job session per day, grouped with other apps

The Restricted bucket allows roughly one batched job session per day (coalesced with other apps), about one alarm per day, and severely limited network, even while charging on a metered connection.

A messaging app needs to deliver a time-critical call notification to a device that is in Doze. What is the recommended approach?

Answer: Send an FCM high-priority message

FCM high-priority messages temporarily wake the app from Doze with network access and a wake lock, and are intended exactly for time-sensitive, user-visible notifications like incoming calls.

What is true about Doze maintenance windows over a long idle period?

Answer: They happen less often the longer the device stays idle

To maximize battery savings, the system schedules maintenance windows progressively less often the longer the device remains in Doze, so deferred work runs in fewer, spaced-out bursts.

Which WorkManager Constraint would you add so a large upload only runs when it won't hurt the user's battery or data?

Answer: setRequiresCharging(true) with setRequiredNetworkType(UNMETERED)

Requiring charging plus an unmetered (e.g., Wi-Fi) network ensures the heavy upload defers until the device is plugged in and not on cellular data, the battery- and data-friendly choice.

Which statement about setAndAllowWhileIdle()/setExactAndAllowWhileIdle() alarms is correct?

Answer: They can fire during Doze, but only about once every 9 minutes per app

These special alarm methods are allowed to fire while the device is idle, but the system rate-limits them to roughly once every 9 minutes per app to preserve battery; no whitelist is required.

Regarding WorkManager expedited work (setExpedited) on modern Android, which statement is accurate?

Answer: They run at foreground-like importance but draw from a standby-limited quota

Expedited jobs get elevated importance and run as soon as possible, but each app has an expedited-work quota that depends on its App Standby Bucket, and an OutOfQuotaPolicy decides what happens when the quota is exhausted.

What is true about asking users to exempt your app from battery optimizations via REQUEST_IGNORE_BATTERY_OPTIMIZATIONS?

Answer: Play limits it to a few justified categories; most apps should work within Doze

Google Play policy limits REQUEST_IGNORE_BATTERY_OPTIMIZATIONS to a small set of justified use cases, so the recommended approach for the vast majority of apps is to schedule work that respects Doze and App Standby rather than seek an exemption.

Which factor most directly determines which App Standby Bucket the system assigns to an app?

Answer: How recently and how often the user actually uses the app

The system assigns buckets based on observed usage patterns (recency and frequency of user interaction), using on-device heuristics; APK size, target SDK, and signing key do not drive bucketing.

You want to analyze what kept the device awake and drained the battery overnight. What is the correct way to get data into Battery Historian?

Answer: Capture a bug report with dumpsys batterystats data and load it

Battery Historian visualizes a bug report (which includes dumpsys batterystats history); you reset stats, reproduce, then run adb bugreport and load the resulting file.

A non-clock, non-calendar app needs to fire an exact alarm on Android 13 (API 33) or newer. Which is correct?

Answer: It must hold SCHEDULE_EXACT_ALARM, which users can deny or revoke

On Android 13+ SCHEDULE_EXACT_ALARM is no longer granted by default to newly installed apps and is user-revocable; USE_EXACT_ALARM is reserved for genuine alarm-clock or calendar apps, not general timers.

An app must run ongoing, user-visible work such as live workout tracking with GPS that the OS should not defer during Doze. What is the right mechanism?

Answer: A foreground service with a persistent notification and foregroundServiceType

Continuous, user-aware work belongs in a foreground service, which shows a persistent notification and keeps running with CPU and network access without being deferred by Doze; deferrable schedulers like WorkManager or alarms are the wrong fit.

How does Doze treat a normal-priority FCM message that arrives while the device is idle?

Answer: It is held until the next maintenance window or Doze ends

In Doze, only high-priority FCM messages get immediate delivery with a temporary network window; normal-priority messages are held and delivered during the next maintenance window or when the device leaves Doze.

Back to Battery & Power