I built an AccountAuthenticator for a webservice that I'd like to use in other applications with different signatures. I'd like to instantly show the fullscreen access request dialog (this one: http://i.imgur.com/gcndGZs.png) instead of a notification so that I'm certain I have access to the account before setting my SyncAdapter to sync automatically.
So far I've tried the getAuthToken, one of which shows a notification:
manager.getAuthToken(account, "full", null, true, callback, new Handler());
The other throws an exception:
manager.getAuthToken(account, "full", null, activity, callback, new Handler());
java.lang.SecurityException: Activity to be started with KEY_INTENT must share Authenticator's signatures
at com.android.server.accounts.AccountManagerService$Session.onResult(AccountManagerService.java:2206)
at com.android.server.accounts.AccountManagerService$6.onResult(AccountManagerService.java:1411)
at com.android.server.accounts.AccountManagerService$6.onResult(AccountManagerService.java:1386)
at android.accounts.IAccountAuthenticatorResponse$Stub.onTransact(IAccountAuthenticatorResponse.java:59)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(Native Method)`
Is it possible to show the access request dialog without a notification from an app that was signed with a different key?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…