Loading core/java/android/app/ApplicationPackageManager.java +28 −22 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import android.view.Display; Loading @@ -70,7 +69,7 @@ final class ApplicationPackageManager extends PackageManager { public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException { try { PackageInfo pi = mPM.getPackageInfo(packageName, flags, UserHandle.myUserId()); PackageInfo pi = mPM.getPackageInfo(packageName, flags, mContext.getUserId()); if (pi != null) { return pi; } Loading Loading @@ -200,7 +199,7 @@ final class ApplicationPackageManager extends PackageManager { public ApplicationInfo getApplicationInfo(String packageName, int flags) throws NameNotFoundException { try { ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, UserHandle.myUserId()); ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -215,7 +214,7 @@ final class ApplicationPackageManager extends PackageManager { public ActivityInfo getActivityInfo(ComponentName className, int flags) throws NameNotFoundException { try { ActivityInfo ai = mPM.getActivityInfo(className, flags, UserHandle.myUserId()); ActivityInfo ai = mPM.getActivityInfo(className, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -230,7 +229,7 @@ final class ApplicationPackageManager extends PackageManager { public ActivityInfo getReceiverInfo(ComponentName className, int flags) throws NameNotFoundException { try { ActivityInfo ai = mPM.getReceiverInfo(className, flags, UserHandle.myUserId()); ActivityInfo ai = mPM.getReceiverInfo(className, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -245,7 +244,7 @@ final class ApplicationPackageManager extends PackageManager { public ServiceInfo getServiceInfo(ComponentName className, int flags) throws NameNotFoundException { try { ServiceInfo si = mPM.getServiceInfo(className, flags, UserHandle.myUserId()); ServiceInfo si = mPM.getServiceInfo(className, flags, mContext.getUserId()); if (si != null) { return si; } Loading @@ -260,7 +259,7 @@ final class ApplicationPackageManager extends PackageManager { public ProviderInfo getProviderInfo(ComponentName className, int flags) throws NameNotFoundException { try { ProviderInfo pi = mPM.getProviderInfo(className, flags, UserHandle.myUserId()); ProviderInfo pi = mPM.getProviderInfo(className, flags, mContext.getUserId()); if (pi != null) { return pi; } Loading Loading @@ -405,7 +404,7 @@ final class ApplicationPackageManager extends PackageManager { @SuppressWarnings("unchecked") @Override public List<PackageInfo> getInstalledPackages(int flags) { return getInstalledPackages(flags, UserHandle.myUserId()); return getInstalledPackages(flags, mContext.getUserId()); } /** @hide */ Loading @@ -431,7 +430,7 @@ final class ApplicationPackageManager extends PackageManager { @SuppressWarnings("unchecked") @Override public List<ApplicationInfo> getInstalledApplications(int flags) { int userId = UserHandle.getUserId(Process.myUid()); final int userId = mContext.getUserId(); try { final List<ApplicationInfo> applicationInfos = new ArrayList<ApplicationInfo>(); ApplicationInfo lastItem = null; Loading @@ -451,7 +450,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public ResolveInfo resolveActivity(Intent intent, int flags) { return resolveActivityAsUser(intent, flags, UserHandle.myUserId()); return resolveActivityAsUser(intent, flags, mContext.getUserId()); } @Override Loading @@ -470,7 +469,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) { return queryIntentActivitiesAsUser(intent, flags, UserHandle.myUserId()); return queryIntentActivitiesAsUser(intent, flags, mContext.getUserId()); } /** @hide Same as above but for a specific user */ Loading Loading @@ -514,7 +513,7 @@ final class ApplicationPackageManager extends PackageManager { try { return mPM.queryIntentActivityOptions(caller, specifics, specificTypes, intent, intent.resolveTypeIfNeeded(resolver), flags, UserHandle.myUserId()); flags, mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading @@ -538,7 +537,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) { return queryBroadcastReceivers(intent, flags, UserHandle.myUserId()); return queryBroadcastReceivers(intent, flags, mContext.getUserId()); } @Override Loading @@ -548,7 +547,7 @@ final class ApplicationPackageManager extends PackageManager { intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading @@ -569,14 +568,14 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryIntentServices(Intent intent, int flags) { return queryIntentServicesAsUser(intent, flags, UserHandle.myUserId()); return queryIntentServicesAsUser(intent, flags, mContext.getUserId()); } @Override public ProviderInfo resolveContentProvider(String name, int flags) { try { return mPM.resolveContentProvider(name, flags, UserHandle.myUserId()); return mPM.resolveContentProvider(name, flags, mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading Loading @@ -763,6 +762,13 @@ final class ApplicationPackageManager extends PackageManager { @Override public Resources getResourcesForApplicationAsUser(String appPackageName, int userId) throws NameNotFoundException { if (userId < 0) { throw new IllegalArgumentException( "Call does not support special user #" + userId); } if ("system".equals(appPackageName)) { return mContext.mMainThread.getSystemContext().getResources(); } try { ApplicationInfo ai = mPM.getApplicationInfo(appPackageName, 0, userId); if (ai != null) { Loading Loading @@ -1118,7 +1124,7 @@ final class ApplicationPackageManager extends PackageManager { public void clearApplicationUserData(String packageName, IPackageDataObserver observer) { try { mPM.clearApplicationUserData(packageName, observer, UserHandle.myUserId()); mPM.clearApplicationUserData(packageName, observer, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading Loading @@ -1191,7 +1197,7 @@ final class ApplicationPackageManager extends PackageManager { public void addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity) { try { mPM.addPreferredActivity(filter, match, set, activity, UserHandle.myUserId()); mPM.addPreferredActivity(filter, match, set, activity, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading Loading @@ -1241,7 +1247,7 @@ final class ApplicationPackageManager extends PackageManager { public void setComponentEnabledSetting(ComponentName componentName, int newState, int flags) { try { mPM.setComponentEnabledSetting(componentName, newState, flags, UserHandle.myUserId()); mPM.setComponentEnabledSetting(componentName, newState, flags, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1250,7 +1256,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public int getComponentEnabledSetting(ComponentName componentName) { try { return mPM.getComponentEnabledSetting(componentName, UserHandle.myUserId()); return mPM.getComponentEnabledSetting(componentName, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1261,7 +1267,7 @@ final class ApplicationPackageManager extends PackageManager { public void setApplicationEnabledSetting(String packageName, int newState, int flags) { try { mPM.setApplicationEnabledSetting(packageName, newState, flags, UserHandle.myUserId()); mPM.setApplicationEnabledSetting(packageName, newState, flags, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1270,7 +1276,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public int getApplicationEnabledSetting(String packageName) { try { return mPM.getApplicationEnabledSetting(packageName, UserHandle.myUserId()); return mPM.getApplicationEnabledSetting(packageName, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading core/java/android/app/ContextImpl.java +16 −11 Original line number Diff line number Diff line Loading @@ -1029,7 +1029,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, null, false, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading @@ -1042,7 +1042,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermission, false, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading @@ -1056,7 +1056,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermission, true, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1089,7 +1089,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, receiverPermission, true, false, UserHandle.myUserId()); true, false, getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1160,7 +1160,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, null, false, true, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1193,7 +1193,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, null, true, true, UserHandle.myUserId()); true, true, getUserId()); } catch (RemoteException e) { } } Loading @@ -1208,7 +1208,7 @@ class ContextImpl extends Context { try { intent.setAllowFds(false); ActivityManagerNative.getDefault().unbroadcastIntent( mMainThread.getApplicationThread(), intent, UserHandle.myUserId()); mMainThread.getApplicationThread(), intent, getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1281,7 +1281,7 @@ class ContextImpl extends Context { @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler) { return registerReceiverInternal(receiver, UserHandle.myUserId(), return registerReceiverInternal(receiver, getUserId(), filter, broadcastPermission, scheduler, getOuterContext()); } Loading Loading @@ -1337,12 +1337,12 @@ class ContextImpl extends Context { @Override public ComponentName startService(Intent service) { return startServiceAsUser(service, Process.myUserHandle()); return startServiceAsUser(service, mUser); } @Override public boolean stopService(Intent service) { return stopServiceAsUser(service, Process.myUserHandle()); return stopServiceAsUser(service, mUser); } @Override Loading Loading @@ -1446,7 +1446,7 @@ class ContextImpl extends Context { arguments.setAllowFds(false); } return ActivityManagerNative.getDefault().startInstrumentation( className, profileFile, 0, arguments, null, UserHandle.myUserId()); className, profileFile, 0, arguments, null, getUserId()); } catch (RemoteException e) { // System has crashed, nothing we can do. } Loading Loading @@ -1792,6 +1792,11 @@ class ContextImpl extends Context { return file; } /** {@hide} */ public int getUserId() { return mUser.getIdentifier(); } static ContextImpl createSystemContext(ActivityThread mainThread) { final ContextImpl context = new ContextImpl(); context.init(Resources.getSystem(), mainThread, Process.myUserHandle()); Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.os.UserHandle; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Slog; Loading Loading @@ -165,8 +166,12 @@ public class StatusBarIconView extends AnimatedImageView { if (icon.iconPackage != null) { try { r = context.getPackageManager().getResourcesForApplicationAsUser(icon.iconPackage, icon.user.getIdentifier()); int userId = icon.user.getIdentifier(); if (userId == UserHandle.USER_ALL) { userId = UserHandle.USER_OWNER; } r = context.getPackageManager() .getResourcesForApplicationAsUser(icon.iconPackage, userId); } catch (PackageManager.NameNotFoundException ex) { Slog.e(TAG, "Icon package not found: " + icon.iconPackage); return null; Loading Loading
core/java/android/app/ApplicationPackageManager.java +28 −22 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import android.view.Display; Loading @@ -70,7 +69,7 @@ final class ApplicationPackageManager extends PackageManager { public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException { try { PackageInfo pi = mPM.getPackageInfo(packageName, flags, UserHandle.myUserId()); PackageInfo pi = mPM.getPackageInfo(packageName, flags, mContext.getUserId()); if (pi != null) { return pi; } Loading Loading @@ -200,7 +199,7 @@ final class ApplicationPackageManager extends PackageManager { public ApplicationInfo getApplicationInfo(String packageName, int flags) throws NameNotFoundException { try { ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, UserHandle.myUserId()); ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -215,7 +214,7 @@ final class ApplicationPackageManager extends PackageManager { public ActivityInfo getActivityInfo(ComponentName className, int flags) throws NameNotFoundException { try { ActivityInfo ai = mPM.getActivityInfo(className, flags, UserHandle.myUserId()); ActivityInfo ai = mPM.getActivityInfo(className, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -230,7 +229,7 @@ final class ApplicationPackageManager extends PackageManager { public ActivityInfo getReceiverInfo(ComponentName className, int flags) throws NameNotFoundException { try { ActivityInfo ai = mPM.getReceiverInfo(className, flags, UserHandle.myUserId()); ActivityInfo ai = mPM.getReceiverInfo(className, flags, mContext.getUserId()); if (ai != null) { return ai; } Loading @@ -245,7 +244,7 @@ final class ApplicationPackageManager extends PackageManager { public ServiceInfo getServiceInfo(ComponentName className, int flags) throws NameNotFoundException { try { ServiceInfo si = mPM.getServiceInfo(className, flags, UserHandle.myUserId()); ServiceInfo si = mPM.getServiceInfo(className, flags, mContext.getUserId()); if (si != null) { return si; } Loading @@ -260,7 +259,7 @@ final class ApplicationPackageManager extends PackageManager { public ProviderInfo getProviderInfo(ComponentName className, int flags) throws NameNotFoundException { try { ProviderInfo pi = mPM.getProviderInfo(className, flags, UserHandle.myUserId()); ProviderInfo pi = mPM.getProviderInfo(className, flags, mContext.getUserId()); if (pi != null) { return pi; } Loading Loading @@ -405,7 +404,7 @@ final class ApplicationPackageManager extends PackageManager { @SuppressWarnings("unchecked") @Override public List<PackageInfo> getInstalledPackages(int flags) { return getInstalledPackages(flags, UserHandle.myUserId()); return getInstalledPackages(flags, mContext.getUserId()); } /** @hide */ Loading @@ -431,7 +430,7 @@ final class ApplicationPackageManager extends PackageManager { @SuppressWarnings("unchecked") @Override public List<ApplicationInfo> getInstalledApplications(int flags) { int userId = UserHandle.getUserId(Process.myUid()); final int userId = mContext.getUserId(); try { final List<ApplicationInfo> applicationInfos = new ArrayList<ApplicationInfo>(); ApplicationInfo lastItem = null; Loading @@ -451,7 +450,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public ResolveInfo resolveActivity(Intent intent, int flags) { return resolveActivityAsUser(intent, flags, UserHandle.myUserId()); return resolveActivityAsUser(intent, flags, mContext.getUserId()); } @Override Loading @@ -470,7 +469,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) { return queryIntentActivitiesAsUser(intent, flags, UserHandle.myUserId()); return queryIntentActivitiesAsUser(intent, flags, mContext.getUserId()); } /** @hide Same as above but for a specific user */ Loading Loading @@ -514,7 +513,7 @@ final class ApplicationPackageManager extends PackageManager { try { return mPM.queryIntentActivityOptions(caller, specifics, specificTypes, intent, intent.resolveTypeIfNeeded(resolver), flags, UserHandle.myUserId()); flags, mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading @@ -538,7 +537,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) { return queryBroadcastReceivers(intent, flags, UserHandle.myUserId()); return queryBroadcastReceivers(intent, flags, mContext.getUserId()); } @Override Loading @@ -548,7 +547,7 @@ final class ApplicationPackageManager extends PackageManager { intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading @@ -569,14 +568,14 @@ final class ApplicationPackageManager extends PackageManager { @Override public List<ResolveInfo> queryIntentServices(Intent intent, int flags) { return queryIntentServicesAsUser(intent, flags, UserHandle.myUserId()); return queryIntentServicesAsUser(intent, flags, mContext.getUserId()); } @Override public ProviderInfo resolveContentProvider(String name, int flags) { try { return mPM.resolveContentProvider(name, flags, UserHandle.myUserId()); return mPM.resolveContentProvider(name, flags, mContext.getUserId()); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } Loading Loading @@ -763,6 +762,13 @@ final class ApplicationPackageManager extends PackageManager { @Override public Resources getResourcesForApplicationAsUser(String appPackageName, int userId) throws NameNotFoundException { if (userId < 0) { throw new IllegalArgumentException( "Call does not support special user #" + userId); } if ("system".equals(appPackageName)) { return mContext.mMainThread.getSystemContext().getResources(); } try { ApplicationInfo ai = mPM.getApplicationInfo(appPackageName, 0, userId); if (ai != null) { Loading Loading @@ -1118,7 +1124,7 @@ final class ApplicationPackageManager extends PackageManager { public void clearApplicationUserData(String packageName, IPackageDataObserver observer) { try { mPM.clearApplicationUserData(packageName, observer, UserHandle.myUserId()); mPM.clearApplicationUserData(packageName, observer, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading Loading @@ -1191,7 +1197,7 @@ final class ApplicationPackageManager extends PackageManager { public void addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity) { try { mPM.addPreferredActivity(filter, match, set, activity, UserHandle.myUserId()); mPM.addPreferredActivity(filter, match, set, activity, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading Loading @@ -1241,7 +1247,7 @@ final class ApplicationPackageManager extends PackageManager { public void setComponentEnabledSetting(ComponentName componentName, int newState, int flags) { try { mPM.setComponentEnabledSetting(componentName, newState, flags, UserHandle.myUserId()); mPM.setComponentEnabledSetting(componentName, newState, flags, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1250,7 +1256,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public int getComponentEnabledSetting(ComponentName componentName) { try { return mPM.getComponentEnabledSetting(componentName, UserHandle.myUserId()); return mPM.getComponentEnabledSetting(componentName, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1261,7 +1267,7 @@ final class ApplicationPackageManager extends PackageManager { public void setApplicationEnabledSetting(String packageName, int newState, int flags) { try { mPM.setApplicationEnabledSetting(packageName, newState, flags, UserHandle.myUserId()); mPM.setApplicationEnabledSetting(packageName, newState, flags, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading @@ -1270,7 +1276,7 @@ final class ApplicationPackageManager extends PackageManager { @Override public int getApplicationEnabledSetting(String packageName) { try { return mPM.getApplicationEnabledSetting(packageName, UserHandle.myUserId()); return mPM.getApplicationEnabledSetting(packageName, mContext.getUserId()); } catch (RemoteException e) { // Should never happen! } Loading
core/java/android/app/ContextImpl.java +16 −11 Original line number Diff line number Diff line Loading @@ -1029,7 +1029,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, null, false, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading @@ -1042,7 +1042,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermission, false, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading @@ -1056,7 +1056,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermission, true, false, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1089,7 +1089,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, receiverPermission, true, false, UserHandle.myUserId()); true, false, getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1160,7 +1160,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, null, false, true, UserHandle.myUserId()); getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1193,7 +1193,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, null, true, true, UserHandle.myUserId()); true, true, getUserId()); } catch (RemoteException e) { } } Loading @@ -1208,7 +1208,7 @@ class ContextImpl extends Context { try { intent.setAllowFds(false); ActivityManagerNative.getDefault().unbroadcastIntent( mMainThread.getApplicationThread(), intent, UserHandle.myUserId()); mMainThread.getApplicationThread(), intent, getUserId()); } catch (RemoteException e) { } } Loading Loading @@ -1281,7 +1281,7 @@ class ContextImpl extends Context { @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler) { return registerReceiverInternal(receiver, UserHandle.myUserId(), return registerReceiverInternal(receiver, getUserId(), filter, broadcastPermission, scheduler, getOuterContext()); } Loading Loading @@ -1337,12 +1337,12 @@ class ContextImpl extends Context { @Override public ComponentName startService(Intent service) { return startServiceAsUser(service, Process.myUserHandle()); return startServiceAsUser(service, mUser); } @Override public boolean stopService(Intent service) { return stopServiceAsUser(service, Process.myUserHandle()); return stopServiceAsUser(service, mUser); } @Override Loading Loading @@ -1446,7 +1446,7 @@ class ContextImpl extends Context { arguments.setAllowFds(false); } return ActivityManagerNative.getDefault().startInstrumentation( className, profileFile, 0, arguments, null, UserHandle.myUserId()); className, profileFile, 0, arguments, null, getUserId()); } catch (RemoteException e) { // System has crashed, nothing we can do. } Loading Loading @@ -1792,6 +1792,11 @@ class ContextImpl extends Context { return file; } /** {@hide} */ public int getUserId() { return mUser.getIdentifier(); } static ContextImpl createSystemContext(ActivityThread mainThread) { final ContextImpl context = new ContextImpl(); context.init(Resources.getSystem(), mainThread, Process.myUserHandle()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.os.UserHandle; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Slog; Loading Loading @@ -165,8 +166,12 @@ public class StatusBarIconView extends AnimatedImageView { if (icon.iconPackage != null) { try { r = context.getPackageManager().getResourcesForApplicationAsUser(icon.iconPackage, icon.user.getIdentifier()); int userId = icon.user.getIdentifier(); if (userId == UserHandle.USER_ALL) { userId = UserHandle.USER_OWNER; } r = context.getPackageManager() .getResourcesForApplicationAsUser(icon.iconPackage, userId); } catch (PackageManager.NameNotFoundException ex) { Slog.e(TAG, "Icon package not found: " + icon.iconPackage); return null; Loading