Add a functionarity for showing / hiding IME button on the system bar

Bug: 3077030

- IME communicates with status bar directly.

Change-Id: Ic5b6b5b7a2b8ea62372dcc9b9c36d81b9f2db651
This commit is contained in:
satok
2010-10-29 11:37:18 +09:00
parent e12774d4a8
commit 06487a58be
12 changed files with 99 additions and 13 deletions

View File

@@ -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;
}
}