Estoy experimentando con Android AccountManager
.SecurityException al intentar agregar una cuenta
Tengo un servicio de autenticación de cuenta que muestra la interfaz de usuario para ingresar el nombre de usuario/contraseña.
Voy a Configuración/Cuentas/Agregar cuenta, elijo mi nuevo tipo de cuenta y me aparece la IU.
cuando hago clic en OK me sale el siguiente error
04-24 14:48:29.334: E/AndroidRuntime(386): java.lang.SecurityException:
caller uid 10035 is different than the authenticator's uid
El único método de MyAccountAuthenticationService:
@Override
public IBinder onBind(Intent intent) {
return new MyAccountAuthenticator(this).getIBinder();
}
MyAccountAuthenticator:
@Override
public Bundle addAccount(AccountAuthenticatorResponse response,
String accountType, String authTokenType, String[] requiredFeatures,
Bundle options) throws NetworkErrorException {
final Intent intent = new Intent(context, MyAccountCreatorActivity.class);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
Fragmento de MyAccountCreatorActivity
's onClick
AccountManager accManager = AccountManager.get(this);
Account newAccount = new Account(email, MyAccountAuthenticator.ACCOUNT_TYPE);
accManager.setPassword(newAccount, password);
Se emite excepción en setPassword
. Ya solicité todos los permisos de contabilidad. No estoy seguro de lo que podría estar causando esto. Si necesita más código/información, pregunte.
Gracias.
vea esto http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different Quizás sea útil –
Posible duplicado de [SecurityException: el usuario que llama XXXX es diferente del uid del autenticador] (http: // stackoverflow.com/questions/3774282/securityexception-caller-uid-xxxx-is-different-than-the-authenticators-uid) – rds
@rds lo siento, no es una tontería. El XML original tenía un error tipográfico, sin embargo, Android no le explicará exactamente la naturaleza real del problema. –