From ad3c9416092f09213d32eee8b59287766eae5d19 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Tue, 20 Nov 2012 21:17:17 +0000 Subject: Squashed commit of the theme engine support. Updated 4.2 support for the old T-Mobile theme engine, as usual needs the provider and switcher apps installed as well. I'm finally dropping the 400+ commit history on this, since everybody else keeps picking it up from CM as a single patch anyway... But for the record, nothing of this would be possible without Josh, Ed, and the rest of the TMo guys who wrote and maintained it until 2.2: amit chabra Amit Kohli Chris Cogar Dirk Sigurdson Ed Carrigan Gaurav Sharma Hui Feng John Ritz Josh Guilfoyle Mark Roberts Pankaj Kumar Samuel Cheung Sergey Ten Change-Id: I7148d51be48f28a2dc4bdf9ec9018f04b268ffc4 --- .../com/android/server/InputMethodManagerService.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'services/java/com/android/server/InputMethodManagerService.java') diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index b11432d..445a4bb 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -15,6 +15,7 @@ package com.android.server; +import com.android.internal.app.ThemeUtils; import com.android.internal.content.PackageMonitor; import com.android.internal.os.HandlerCaller; import com.android.internal.os.SomeArgs; @@ -165,6 +166,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final Locale ENGLISH_LOCALE = new Locale("en"); final Context mContext; + private Context mUiContext; final Resources mRes; final Handler mHandler; final InputMethodSettings mSettings; @@ -848,6 +850,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); + ThemeUtils.registerThemeChangeReceiver(mContext, new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + mUiContext = null; + } + }); + mStatusBar = statusBar; statusBar.setIconVisibility("ime", false); updateImeWindowStatusLocked(); @@ -2525,6 +2534,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } + private Context getUiContext() { + if (mUiContext == null) { + mUiContext = ThemeUtils.createUiContext(mContext); + } + return mUiContext != null ? mUiContext : mContext; + } + // ---------------------------------------------------------------------- private void showInputMethodMenu() { @@ -2561,7 +2577,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private void showInputMethodMenuInternal(boolean showSubtypes) { if (DEBUG) Slog.v(TAG, "Show switching menu"); - final Context context = mContext; + final Context context = getUiContext(); final boolean isScreenLocked = isScreenLocked(); final String lastInputMethodId = mSettings.getSelectedInputMethod(); -- cgit v1.1