From ce0b22cf90cf99377f63b1aa4d4720f69a6edd7b Mon Sep 17 00:00:00 2001 From: Alexandra Gherghina Date: Mon, 30 Jun 2014 18:07:52 +0100 Subject: [PATCH] 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 --- src/com/android/settings/accounts/AuthenticatorHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/accounts/AuthenticatorHelper.java b/src/com/android/settings/accounts/AuthenticatorHelper.java index 0ecf43826b4..8633bd3b770 100644 --- a/src/com/android/settings/accounts/AuthenticatorHelper.java +++ b/src/com/android/settings/accounts/AuthenticatorHelper.java @@ -102,7 +102,8 @@ final public class AuthenticatorHelper extends BroadcastReceiver { if (mTypeToAuthDescription.containsKey(accountType)) { try { AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType); - Context authContext = context.createPackageContext(desc.packageName, 0); + Context authContext = context.createPackageContextAsUser(desc.packageName, 0, + mUserHandle); icon = mUm.getBadgedDrawableForUser( authContext.getResources().getDrawable(desc.iconId), mUserHandle); synchronized (mAccTypeIconCache) { @@ -128,7 +129,8 @@ final public class AuthenticatorHelper extends BroadcastReceiver { if (mTypeToAuthDescription.containsKey(accountType)) { try { 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); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "No label name for account type " + accountType);