summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-11-02 19:46:55 +0900
committersatok <satok@google.com>2010-11-02 20:11:28 +0900
commit06e0744e9e1a04a07e2e1bf9279124223bd674da (patch)
treecb49e74d155383a1295e7b9b36968322db0ae8f1
parenta32edd4b4c894f4fb3d9fd7e9d5b80321df79e20 (diff)
downloadframeworks_base-06e0744e9e1a04a07e2e1bf9279124223bd674da.zip
frameworks_base-06e0744e9e1a04a07e2e1bf9279124223bd674da.tar.gz
frameworks_base-06e0744e9e1a04a07e2e1bf9279124223bd674da.tar.bz2
Update the subtype icon properly.
Change-Id: Ib89959d1ea13f1e6f56e6280f90532e6695c4a00
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java9
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java7
-rw-r--r--services/java/com/android/server/StatusBarManagerService.java23
3 files changed, 23 insertions, 16 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
index c416ff4..a025d63 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
@@ -16,10 +16,7 @@
package com.android.systemui.statusbar.tablet;
-import android.content.BroadcastReceiver;
import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Handler;
@@ -36,13 +33,12 @@ import android.widget.ImageView;
import com.android.server.InputMethodManagerService;
import com.android.systemui.R;
-import java.util.Calendar;
import java.util.List;
-import java.util.TimeZone;
public class InputMethodButton extends ImageView {
private static final String TAG = "StatusBar/InputMethodButton";
+ private static final boolean DEBUG = false;
private boolean mKeyboardShown;
private ImageView mIcon;
@@ -94,6 +90,9 @@ public class InputMethodButton extends ImageView {
InputMethodSubtype subtype = mImm.getCurrentInputMethodSubtype();
Drawable icon = null;
if (imi != null) {
+ if (DEBUG) {
+ Log.d(TAG, "--- Update icons of IME: " + imi.getPackageName() + "," + subtype);
+ }
if (subtype != null) {
return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(),
imi.getServiceInfo().applicationInfo);
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 20e8bbe..155c397 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -993,6 +993,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (mCurMethod != null) {
try {
putSelectedInputMethodSubtype(info, subtypeId);
+ mCurrentSubtype = subtype;
+ if (mInputShown) {
+ // If mInputShown is false, there is no IME button on the
+ // system bar.
+ // Thus there is no need to make it invisible explicitly.
+ mStatusBar.setIMEButtonVisible(true);
+ }
mCurMethod.changeInputMethodSubtype(subtype);
} catch (RemoteException e) {
return;
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 0eeef38..596db57 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -263,19 +263,20 @@ public class StatusBarManagerService extends IStatusBarService.Stub
if (SPEW) Slog.d(TAG, (visible?"showing":"hiding") + " IME Button");
synchronized(mLock) {
- if (mIMEButtonVisible != visible) {
- mIMEButtonVisible = visible;
- mHandler.post(new Runnable() {
- public void run() {
- if (mBar != null) {
- try {
- mBar.setIMEButtonVisible(visible);
- } catch (RemoteException ex) {
- }
+ // In case of IME change, we need to call up setIMEButtonVisible() regardless of
+ // mIMEButtonVisible because mIMEButtonVisible may not have been set to false when the
+ // previous IME was destroyed.
+ mIMEButtonVisible = visible;
+ mHandler.post(new Runnable() {
+ public void run() {
+ if (mBar != null) {
+ try {
+ mBar.setIMEButtonVisible(visible);
+ } catch (RemoteException ex) {
}
}
- });
- }
+ }
+ });
}
}