Manifest & Permissions

Android Background Work Has No Universal “Run in Background” Permission

Android has no universal “run in background” permission that makes arbitrary work run forever. The correct implementation depends on what the work does, when it must run and whether the user is actively aware of it.

By Updated 2 min read

Classify the work before choosing an API

Work Starting point
Deferrable, persistent task WorkManager with suitable constraints
User-visible ongoing operation An eligible foreground service or a more specific API
Precise user-facing alarm Alarm APIs and applicable exact-alarm access
Short work while the screen is active Lifecycle-aware asynchronous execution
Server-driven event Appropriate push and notification handling

The background-work guidance should drive this choice. A service name or a manifest permission cannot override scheduling, battery or background-start restrictions.

Use persistence deliberately

WorkManager is designed for eligible persistent work, not immediate execution at an exact wall-clock time. Define constraints such as network availability and make the task retry-safe. Store enough state to resume after process death without duplicating a payment, upload or destructive action.

Do not put a never-ending loop inside a worker and assume that this creates a permanent background process.

Treat foreground services as a specific contract

A foreground service needs an appropriate use case, notification behavior, service type and permissions. Newer Android versions impose additional start and duration rules. Declaring every service type to avoid an exception is not a valid design.

Record the device API and target SDK when diagnosing a start failure. The same code path can be governed differently after a target update.

Test interruption and recovery

Test loss of connectivity, process termination, device restart and user cancellation. Define whether a task should resume, restart or stop. A feature that only works while the development device is connected to a debugger has not demonstrated reliable background behavior.

Inspect declarations without overclaiming

APKLint's Manifest Checker can help review service declarations and permissions. It cannot predict exact scheduling or prove that an OEM will keep a process alive. Fix the work model and recovery behavior rather than directing every user to disable battery protections.

Sources and further reading

  1. Android Developers: Background work overview
  2. Android Developers: Foreground services
  3. Android Developers: WorkManager

Reference review: 22 September 2026. Examples illustrate the workflow; check your installed versions, release artifact and account-specific Console requirements before applying them. This guide is not a claim that APKLint executed your project or verified your private account.

APKLint

Android inspection tools and practical release guides. About APKLint · Report a correction