Retrieve resources from the corresponding profile
This handles the case where the authenticator does not exist in the primary profile. Bug: 15466880 Change-Id: I9f6311397456b8bf210f50df82b6be605c1140f0
This commit is contained in:
@@ -102,7 +102,8 @@ final public class AuthenticatorHelper extends BroadcastReceiver {
|
|||||||
if (mTypeToAuthDescription.containsKey(accountType)) {
|
if (mTypeToAuthDescription.containsKey(accountType)) {
|
||||||
try {
|
try {
|
||||||
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
||||||
Context authContext = context.createPackageContext(desc.packageName, 0);
|
Context authContext = context.createPackageContextAsUser(desc.packageName, 0,
|
||||||
|
mUserHandle);
|
||||||
icon = mUm.getBadgedDrawableForUser(
|
icon = mUm.getBadgedDrawableForUser(
|
||||||
authContext.getResources().getDrawable(desc.iconId), mUserHandle);
|
authContext.getResources().getDrawable(desc.iconId), mUserHandle);
|
||||||
synchronized (mAccTypeIconCache) {
|
synchronized (mAccTypeIconCache) {
|
||||||
@@ -128,7 +129,8 @@ final public class AuthenticatorHelper extends BroadcastReceiver {
|
|||||||
if (mTypeToAuthDescription.containsKey(accountType)) {
|
if (mTypeToAuthDescription.containsKey(accountType)) {
|
||||||
try {
|
try {
|
||||||
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
||||||
Context authContext = context.createPackageContext(desc.packageName, 0);
|
Context authContext = context.createPackageContextAsUser(desc.packageName, 0,
|
||||||
|
mUserHandle);
|
||||||
label = authContext.getResources().getText(desc.labelId);
|
label = authContext.getResources().getText(desc.labelId);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
Log.w(TAG, "No label name for account type " + accountType);
|
Log.w(TAG, "No label name for account type " + accountType);
|
||||||
|
Reference in New Issue
Block a user