Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ACCOUNT_MANAGER - "Permission is only granted to system apps"

I am following the instructions found here at android developer. These instructions say to add these two lines of code into the manifest:

<manifest ... >
    <uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
    <uses-permission android:name="android.permission.INTERNET" />
    ...
</manifest>

The problem is that I now get an error on the "ACCOUNT_MANAGER" line saying "Permission is only granted to system apps".

My application is not going to be a system application and I need to authenticate to OAuth2 services. How can it be possible that ANY app that uses OAuth2 needs to be a system application?

Does anyone know how to use ACCOUNT_MANAGER without requiring my application to be a "system application"?

I've looked at this question and this question. They say that, for the permissions they have listed, the error is a "fake" error message. Does anyone know if the 'ACCOUNT_MANAGER error is a fake message? Can I tell the compiler to ignore this like the suggestions in these other posts?

like image 693
user1567453 Avatar asked Oct 19 '17 06:10

user1567453


1 Answers

From documentation

String ACCOUNT_MANAGER

Allows applications to call into AccountAuthenticators.

Not for use by third-party applications.

ACCOUNT_MANAGER permission can only be granted to system app

If your app requires AccountManager, you can create an AccountAuthenticator service like in this tutorial

Or you can request MANAGE_ACCOUNTS permission as explained in this answer

MANAGE_ACCOUNTS: The API documentation is not that clear about this permission. But according to Bryans answer, an app can only delete/modify an account it created itself. Of course it can create any new account, and manage that.

like image 100
sziraqui Avatar answered Oct 21 '22 10:10

sziraqui