diff options
Diffstat (limited to 'services/java/com/android/server/am/ActivityManagerService.java')
-rwxr-xr-x | services/java/com/android/server/am/ActivityManagerService.java | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 17f9214..96ffea2 100755 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -18,6 +18,7 @@ package com.android.server.am; import com.android.internal.R; +import com.android.internal.app.ThemeUtils; import com.android.internal.os.BatteryStatsImpl; import com.android.server.AttributeCache; import com.android.server.IntentResolver; @@ -790,6 +791,7 @@ public final class ActivityManagerService extends ActivityManagerNative boolean mLaunchWarningShown = false; Context mContext; + Context mUiContext; int mFactoryTest; @@ -1006,7 +1008,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } } - Dialog d = new AppErrorDialog(mContext, res, proc, hasRevoked); + Dialog d = new AppErrorDialog(getUiContext(), res, proc, hasRevoked); d.show(); proc.crashDialog = d; } else { @@ -1036,7 +1038,7 @@ public final class ActivityManagerService extends ActivityManagerNative false, false, MY_PID, Process.SYSTEM_UID); Dialog d = new AppNotRespondingDialog(ActivityManagerService.this, - mContext, proc, (ActivityRecord)data.get("activity")); + getUiContext(), proc, (ActivityRecord)data.get("activity")); d.show(); proc.anrDialog = d; } @@ -1057,7 +1059,7 @@ public final class ActivityManagerService extends ActivityManagerNative } AppErrorResult res = (AppErrorResult) data.get("result"); if (!mSleeping && !mShuttingDown) { - Dialog d = new StrictModeViolationDialog(mContext, res, proc); + Dialog d = new StrictModeViolationDialog(getUiContext(), res, proc); d.show(); proc.crashDialog = d; } else { @@ -1070,7 +1072,7 @@ public final class ActivityManagerService extends ActivityManagerNative } break; case SHOW_FACTORY_ERROR_MSG: { Dialog d = new FactoryErrorDialog( - mContext, msg.getData().getCharSequence("msg")); + getUiContext(), msg.getData().getCharSequence("msg")); d.show(); ensureBootCompleted(); } break; @@ -1090,7 +1092,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (!app.waitedForDebugger) { Dialog d = new AppWaitingForDebuggerDialog( ActivityManagerService.this, - mContext, app); + getUiContext(), app); app.waitDialog = d; app.waitedForDebugger = true; d.show(); @@ -1139,7 +1141,7 @@ public final class ActivityManagerService extends ActivityManagerNative } break; case SHOW_UID_ERROR_MSG: { // XXX This is a temporary dialog, no need to localize. - AlertDialog d = new BaseErrorDialog(mContext); + AlertDialog d = new BaseErrorDialog(getUiContext()); d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR); d.setCancelable(false); d.setTitle("System UIDs Inconsistent"); @@ -1208,7 +1210,7 @@ public final class ActivityManagerService extends ActivityManagerNative notification.defaults = 0; // please be quiet notification.sound = null; notification.vibrate = null; - notification.setLatestEventInfo(context, text, + notification.setLatestEventInfo(getUiContext(), text, mContext.getText(R.string.heavy_weight_notification_detail), PendingIntent.getActivity(mContext, 0, root.intent, PendingIntent.FLAG_CANCEL_CURRENT)); @@ -1619,6 +1621,15 @@ public final class ActivityManagerService extends ActivityManagerNative } } + private Context getUiContext() { + synchronized (this) { + if (mUiContext == null && mBooted) { + mUiContext = ThemeUtils.createUiContext(mContext); + } + return mUiContext != null ? mUiContext : mContext; + } + } + /** * Initialize the application bind args. These are passed to each * process when the bindApplication() IPC is sent to the process. They're @@ -3009,7 +3020,7 @@ public final class ActivityManagerService extends ActivityManagerNative @Override public void run() { synchronized (ActivityManagerService.this) { - final Dialog d = new LaunchWarningWindow(mContext, cur, next); + final Dialog d = new LaunchWarningWindow(getUiContext(), cur, next); d.show(); mHandler.postDelayed(new Runnable() { @Override @@ -3721,6 +3732,12 @@ public final class ActivityManagerService extends ActivityManagerNative } } }, pkgFilter); + ThemeUtils.registerThemeChangeReceiver(mContext, new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + mUiContext = null; + } + }); synchronized (this) { // Ensure that any processes we had put on hold are now started |