android - AccountManager throwing UnsupportedOperationException: getAuthTokenLabel -
i calling code below in android app (for authenticating against google app engine, think by-the-by):
accountmanager accountmanager = accountmanager.get(this); accountmanager.getauthtoken(maccount, "ah",null, false, new getauthtokencallback(), null);
in getauthtokencallback()
error thrown:
android.accounts.authenticatorexception: java.lang.unsupportedoperationexception: getauthtokenlabel not supported
the authentication process stops there.
the odd thing runs on android 5.5.1 device perfectly; unsupportedoperationexception error occurs on 6.0.1 device.
i have runtime permission request get_accounts
think need suspect error stems , marshmellow's permissions systems.
@targetapi(23) private boolean havegetaccountpermission() { log.i(tag, "havegetaccountpermission()"); int haswritecontactspermission = activitycompat.checkselfpermission(this,manifest.permission.get_accounts); if (haswritecontactspermission != packagemanager.permission_granted) { activitycompat.requestpermissions(this,new string[] {manifest.permission.get_accounts}, request_code_ask_permissions); return false; } else { return true; } }
any ideas appreciated.
i don't know if helps, i've found creating new account before executing getauthtoken()
throws exception.
in case, trying rename account, , found if first execute getauthtoken()
old account , then create new account contents, exception no longer thrown.
i'm suspicious may bug in marshmallow.
Comments
Post a Comment