summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-10-29 11:37:18 +0900
committersatok <satok@google.com>2010-10-30 03:17:40 +0900
commit06487a58be22b100daf3f950b9a1d25c3ea42aa2 (patch)
tree51f435300301f0be1256da96ce25abc77112e2ee /services
parente12774d4a81b3658de65e9d2848a7757d8612e0f (diff)
downloadframeworks_base-06487a58be22b100daf3f950b9a1d25c3ea42aa2.zip
frameworks_base-06487a58be22b100daf3f950b9a1d25c3ea42aa2.tar.gz
frameworks_base-06487a58be22b100daf3f950b9a1d25c3ea42aa2.tar.bz2
Add a functionarity for showing / hiding IME button on the system bar
Bug: 3077030 - IME communicates with status bar directly. Change-Id: Ic5b6b5b7a2b8ea62372dcc9b9c36d81b9f2db651
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java17
-rw-r--r--services/java/com/android/server/StatusBarManagerService.java25
2 files changed, 42 insertions, 0 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 3f378e1..07da0fa 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -940,6 +940,23 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
}
+ public void setIMEButtonVisible(IBinder token, boolean visible) {
+ int uid = Binder.getCallingUid();
+ long ident = Binder.clearCallingIdentity();
+ try {
+ if (token == null || mCurToken != token) {
+ Slog.w(TAG, "Ignoring setIMEButtonVisible of uid " + uid + " token: " + token);
+ return;
+ }
+
+ synchronized (mMethodMap) {
+ mStatusBar.setIMEButtonVisible(visible);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
+
void updateFromSettingsLocked() {
// We are assuming that whoever is changing DEFAULT_INPUT_METHOD and
// ENABLED_INPUT_METHODS is taking care of keeping them correctly in
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 400b31f..95d2b65 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -74,6 +74,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub
boolean mMenuVisible = false;
+ boolean mIMEButtonVisible = false;
+
private class DisableRecord implements IBinder.DeathRecipient {
String pkg;
int what;
@@ -257,6 +259,28 @@ public class StatusBarManagerService extends IStatusBarService.Stub
}
}
+ public void setIMEButtonVisible(final boolean visible) {
+ enforceStatusBar();
+
+ 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) {
+ }
+ }
+ }
+ });
+ }
+ }
+ }
+
/**
* This is used for the automatic version of lights-out mode. Only call this from
* the window manager.
@@ -345,6 +369,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
synchronized (mLock) {
switches[0] = mLightsOn;
switches[1] = mMenuVisible;
+ switches[2] = mIMEButtonVisible;
}
}