summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/InputMethodManagerService.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java18
1 files changed, 17 insertions, 1 deletions
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();