androidandroid-6.0-marshmallowandroid-compatibility

Android M CDD - runtime permissions requirements


Can someone please help me understand the following CDD requirement:

MUST NOT grant any runtime permissions to preinstalled apps unless:

  1. the user's consent can be obtained before the application uses it
  2. the runtime permissions are associated with an intent pattern for which the preinstalled application is set as the default handler

I have two questions:

  1. Pre-installed apps are installed either in /system/app or /system/priv-app folder. AFAIK, APKs that fall under these two folders automatically get all permissions they claim in their manifest. Please correct me if I am wrong. But in M, are they trying to say that even if an app is a pre-installed system app, a user should be prompted at runtime before the app can be granted this permission.

  2. What is "intent pattern"? Is it the same as the Dialer app has permission to make phone calls?


Solution

  • It can be a kind of late for the answer but your both assumptions are correct.

    Pre-installed apps that are installed under /system/app or /system/priv-app will be granted all permissions they declared in the AndroidManifest.xml file. But for devices with Android 6.0 Marshmallow, Google wants two things:

    1. Pre-installed apps should target Android 6.0 (API level 23).
    2. They should request runtime permissions for dangerous permissions as non-system apps should do.

    These are required for pre-installed apps to be CDD/CTS compliant.

    Only exception to above is if the user sets that application to be the default for a specific action (default handler for an intent pattern):

    the runtime permissions are associated with an intent pattern for which the preinstalled application is set as the default handler

    For instance, if you set Google Calendar to be the default handler for Calendar events, you’re giving it permission to access your Calendar.