Zygote
API 23 · M

Android 6.0 Marshmallow

Runtime permissions

released
2015-10-05
runtime
ART
design
Material
status
stable

The story

Users were installing apps that demanded every permission at install time, and had no way to grant just one.

The problem

Install-time permissions were all-or-nothing, so a flashlight app that wanted contacts forced the user to accept or walk away.

Marshmallow introduced runtime permissions, Doze, App Standby and fingerprint authentication. The permission dialogue became a normal part of using an app.

The one thing to remember

The release that put the user in charge of permissions.

What shipped

  • Runtime permissions
  • Doze and App Standby
  • Fingerprint authentication
  • USB-C support
  • Direct Share

Platform internals

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

  • Runtime permission model changes how every app asks for access
  • Doze batches background work
  • Fingerprint HAL
  • Adoptable storage

What developers had to deal with

  • requestPermissions() and the runtime permission flow
  • FingerprintManager
  • Bluetooth Stylus and MIDI APIs
  • Apache HTTP client removed for targeting apps

Behaviour changes

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

targetingpermissions

Runtime permissions

Dangerous permissions must be requested at runtime rather than granted at install.

What to doAdd requestPermissions calls, explain why, and handle denial.

targetingnetwork

Apache HTTP client removal

The Apache HTTP client is removed from the boot classpath.

What to doAdd the legacy library or migrate to HttpURLConnection or OkHttp.

targetingbackground

Doze

Doze defers network, jobs and alarms when the device is idle.

What to doUse setExactAndAllowWhileIdle sparingly and avoid long-running background work.

targetingstorage

Adoptable storage

SD cards can be adopted as internal storage.

What to doHandle volumes that may be adopted or portable.

targetingruntime

Bluetooth stylus and MIDI

New input and audio device support.

What to doCheck for feature availability before using them.

all appssecurity

Text selection and clipboard

The system changes how text selection works.

What to doTest selection behaviour in custom views.

Permissions introduced here

  • ACCESS_NOTIFICATION_POLICYnormal
  • BIND_CARRIER_SERVICESsignature|privileged
  • BIND_CHOOSER_TARGET_SERVICEsignature
  • BIND_INCALL_SERVICEsignature|privileged
  • BIND_MIDI_DEVICE_SERVICEsignature
  • BIND_TELECOM_CONNECTION_SERVICEsignature|privileged
  • GET_ACCOUNTS_PRIVILEGEDsignature|privileged
  • PACKAGE_USAGE_STATSsignature|privileged|development|appop|retailDemo
  • REQUEST_IGNORE_BATTERY_OPTIMIZATIONSnormal
  • REQUEST_INSTALL_PACKAGESsignature
  • USE_FINGERPRINTnormal

Where this sits

Release 23 of 37 API levels, by date
Headline features
5
Architecture changes
4
Developer changes
4
Sources cited
5

Kernel

This release shipped on Linux kernel versions 3.18. Kernel versions vary by device.