Mulgard Mulgard - 6 months ago 71
Android Question

Android M Permissions: Missing some of the old ones

I have to implement the new permissions system but i cant find some of the permissions i used earlier in my android apss:

<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />


For example: I used:

<uses-permission android:name="android.permission.GET_ACCOUNTS" />


I can now replace this by

<uses-permission android:name="android.permission-group.CONTACTS" />


Because
GET_ACCOUNTS
is in the Group of
CONTACTS
.
But what about the other permissions i posted. They are not listed anywhere in the system permissions

Answer

The following permissions are not present in Android M.

<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

Hence, you can request them using android:maxSdkVersion="22" in you uses-permission tag like this:

 <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" android:maxSdkVersion="22"/>
 <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" android:maxSdkVersion="22" />
 <uses-permission android:name="android.permission.USE_CREDENTIALS" android:maxSdkVersion="22"/>

You can read more about it here.

As for the last permission. That is:

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

You don't need to use the permission request for it, as it is allowed.

Comments