Zygote
API 31 · S

Android 12

Material You dynamic colour

released
2021-10-04
runtime
ART
design
Material You
status
stable

The story

Google introduced Material You, a design language that adapts the system to the user's wallpaper.

The problem

Privacy exposure was invisible, and apps could start activities and use exact alarms without restraint.

Android 12 added the Privacy Dashboard, microphone and camera indicators, approximate location, the splash screen API, and mandatory PendingIntent mutability.

The one thing to remember

Privacy became visible, and the launch experience became the system's.

What shipped

  • Material You dynamic colour
  • Privacy Dashboard
  • Approximate location
  • Microphone and camera indicators
  • Splash screen API

Platform internals

What changed underneath the APIs. These are the changes this site's architecture modules explain in depth.

  • Bluetooth permissions split into the nearby-devices family
  • Exact alarm permissions
  • Foreground service launch restrictions

What developers had to deal with

  • PendingIntent mutability flag is mandatory when targeting 31
  • Exact alarms need SCHEDULE_EXACT_ALARM
  • Splash screen API
  • Foreground service launch restrictions from the background
  • android:exported is mandatory when targeting 31
  • Bluetooth scan/connect permissions

Behaviour changes

The full archive has every recorded change with its migration advice.

targetingsecurity

PendingIntent mutability is mandatory

Apps targeting Android 12 must specify FLAG_IMMUTABLE or FLAG_MUTABLE for every PendingIntent.

What to doAdd the flag; use immutable unless the system must fill in extras.

targetingpermissions

Exact alarms need a permission

SCHEDULE_EXACT_ALARM is required for exact alarms, and it may be denied by default on some devices.

What to doCheck the permission and fall back to inexact alarms, or use USE_EXACT_ALARM only for alarm-clock use cases.

targetingui

Splash screen API

The system shows a splash screen for every app, and the custom splash-screen APIs are deprecated.

What to doAdopt the SplashScreen API and the new starting-window behaviour.

targetingbackground

Foreground service launch restrictions

Apps cannot start foreground services from the background, with a small set of exemptions.

What to doStart services while visible or use WorkManager or expedited jobs.

targetingsecurity

android:exported is mandatory

Every component with an intent filter must declare android:exported explicitly.

What to doAdd android:exported to every component with an intent filter.

targetingconnectivity

Bluetooth permissions are split

BLUETOOTH_SCAN and BLUETOOTH_CONNECT replace the old Bluetooth and location permissions for nearby devices.

What to doRequest the new nearby-devices permissions and remove the location workaround.

targetingprivacy

Approximate location is an option

Users can grant only approximate location, so apps must handle coarsened results.

What to doRequest fine location only when needed and handle approximate grants gracefully.

targetingui

Splash screen and activity transitions change

The system controls the launch animation, so custom launch themes behave differently.

What to doUse the SplashScreen API instead of a launch activity.

all appsprivacy

Microphone and camera indicators

The system shows an indicator whenever an app uses the microphone or camera, and a toggle can disable them.

What to doHandle the case where the sensor is blocked by the user's privacy toggle.

all appsprivacy

Clipboard access toast

Reading the clipboard shows a toast to the user.

What to doRead the clipboard only in response to a user action.

all appssecurity

Untrusted touch events are blocked

Touches from windows with insufficient trust (for example overlays) are blocked from passing to apps.

What to doDo not rely on overlay windows for touch pass-through.

Permissions introduced here

  • ACCESS_BLOBS_ACROSS_USERSunknown
  • BIND_COMPANION_DEVICE_SERVICEunknown
  • BLUETOOTH_ADVERTISEdangerous
  • BLUETOOTH_CONNECTdangerous
  • BLUETOOTH_SCANdangerous
  • HIDE_OVERLAY_WINDOWSunknown
  • HIGH_SAMPLING_RATE_SENSORSnormal
  • MANAGE_MEDIAsignature|appop|preinstalled
  • MANAGE_ONGOING_CALLSsignature|appop
  • REQUEST_COMPANION_PROFILE_WATCHnormal
  • REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUNDnormal
  • REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCEunknown
  • SCHEDULE_EXACT_ALARMsignature|privileged|appop
  • START_FOREGROUND_SERVICES_FROM_BACKGROUNDunknown
  • UPDATE_PACKAGES_WITHOUT_USER_ACTIONnormal
  • USE_ICC_AUTH_WITH_DEVICE_IDENTIFIERsignature|appop
  • UWB_RANGINGdangerous

Where this sits

Release 31 of 37 API levels, by date
Headline features
5
Architecture changes
3
Developer changes
6
Sources cited
6

Kernel

This release shipped on Linux kernel versions 5.4, 5.10. Kernel versions vary by device.