2

On Marshmallow, i fell on this Exception when I add a google account type:

" java.lang.SecurityException: uid 10121 cannot remove accounts of type: com.google at "

I add the accound using

mAccountManager.addAccount("com.google", null, null, null, activity.this, null, null);

And sometime i need to delete all accounts using

mAccountManager.removeAccount(account, this, null, null);

the app has Admin role, and all permissions is think about:

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

i asked the user for :

Manifest.permission.GET_ACCOUNTS,Manifest.permission.READ_PHONE_STATE,Manifest.permission.WRITE_EXTERNAL_STORAGE

How to delete account managed by google authenticator ...? all is working well on Lollipop, of course

thanks !

divol
  • 192
  • 7

0 Answers0