Merge "Only show IME in navigation bar when it should"
This commit is contained in:
@ -33,7 +33,8 @@ oneway interface IStatusBar
|
||||
void animateCollapsePanels();
|
||||
void setSystemUiVisibility(int vis, int mask);
|
||||
void topAppWindowChanged(boolean menuVisible);
|
||||
void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
|
||||
void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher);
|
||||
void setHardKeyboardStatus(boolean available, boolean enabled);
|
||||
void toggleRecentApps();
|
||||
void preloadRecentApps();
|
||||
|
@ -31,7 +31,8 @@ interface IStatusBarService
|
||||
void setIconVisibility(String slot, boolean visible);
|
||||
void removeIcon(String slot);
|
||||
void topAppWindowChanged(boolean menuVisible);
|
||||
void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
|
||||
void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher);
|
||||
void expandSettingsPanel();
|
||||
void setCurrentUser(int newUserId);
|
||||
|
||||
|
@ -302,7 +302,7 @@ public abstract class BaseStatusBar extends SystemUI implements
|
||||
ArrayList<StatusBarNotification> notifications = new ArrayList<StatusBarNotification>();
|
||||
mCommandQueue = new CommandQueue(this, iconList);
|
||||
|
||||
int[] switches = new int[7];
|
||||
int[] switches = new int[8];
|
||||
ArrayList<IBinder> binders = new ArrayList<IBinder>();
|
||||
try {
|
||||
mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications,
|
||||
@ -317,7 +317,7 @@ public abstract class BaseStatusBar extends SystemUI implements
|
||||
setSystemUiVisibility(switches[1], 0xffffffff);
|
||||
topAppWindowChanged(switches[2] != 0);
|
||||
// StatusBarManagerService has a back up of IME token and it's restored here.
|
||||
setImeWindowStatus(binders.get(0), switches[3], switches[4]);
|
||||
setImeWindowStatus(binders.get(0), switches[3], switches[4], switches[7] != 0);
|
||||
setHardKeyboardStatus(switches[5] != 0, switches[6] != 0);
|
||||
|
||||
// Set up the initial icon state
|
||||
|
@ -65,6 +65,8 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
public static final int FLAG_EXCLUDE_INPUT_METHODS_PANEL = 1 << 3;
|
||||
public static final int FLAG_EXCLUDE_COMPAT_MODE_PANEL = 1 << 4;
|
||||
|
||||
private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";
|
||||
|
||||
private StatusBarIconList mList;
|
||||
private Callbacks mCallbacks;
|
||||
private Handler mHandler = new H();
|
||||
@ -91,7 +93,8 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
public void animateExpandSettingsPanel();
|
||||
public void setSystemUiVisibility(int vis, int mask);
|
||||
public void topAppWindowChanged(boolean visible);
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher);
|
||||
public void setHardKeyboardStatus(boolean available, boolean enabled);
|
||||
public void toggleRecentApps();
|
||||
public void preloadRecentApps();
|
||||
@ -190,11 +193,13 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher) {
|
||||
synchronized (mList) {
|
||||
mHandler.removeMessages(MSG_SHOW_IME_BUTTON);
|
||||
mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token)
|
||||
.sendToTarget();
|
||||
Message m = mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token);
|
||||
m.getData().putBoolean(SHOW_IME_SWITCHER_KEY, showImeSwitcher);
|
||||
m.sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +303,8 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
mCallbacks.topAppWindowChanged(msg.arg1 != 0);
|
||||
break;
|
||||
case MSG_SHOW_IME_BUTTON:
|
||||
mCallbacks.setImeWindowStatus((IBinder) msg.obj, msg.arg1, msg.arg2);
|
||||
mCallbacks.setImeWindowStatus((IBinder) msg.obj, msg.arg1, msg.arg2,
|
||||
msg.getData().getBoolean(SHOW_IME_SWITCHER_KEY, false));
|
||||
break;
|
||||
case MSG_SET_HARD_KEYBOARD_STATUS:
|
||||
mCallbacks.setHardKeyboardStatus(msg.arg1 != 0, msg.arg2 != 0);
|
||||
|
@ -2235,7 +2235,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher) {
|
||||
boolean imeShown = (vis & InputMethodService.IME_VISIBLE) != 0;
|
||||
int flags = mNavigationIconHints;
|
||||
if ((backDisposition == InputMethodService.BACK_DISPOSITION_WILL_DISMISS) || imeShown) {
|
||||
@ -2243,7 +2244,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
} else {
|
||||
flags &= ~NAVIGATION_HINT_BACK_ALT;
|
||||
}
|
||||
if (imeShown) {
|
||||
if (showImeSwitcher) {
|
||||
flags |= NAVIGATION_HINT_IME_SHOWN;
|
||||
} else {
|
||||
flags &= ~NAVIGATION_HINT_IME_SHOWN;
|
||||
|
@ -78,7 +78,8 @@ public class TvStatusBar extends BaseStatusBar {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
|
||||
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
|
||||
boolean showImeSwitcher) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1532,14 +1532,17 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
}
|
||||
mImeWindowVis = vis;
|
||||
mBackDisposition = backDisposition;
|
||||
if (mStatusBar != null) {
|
||||
mStatusBar.setImeWindowStatus(token, vis, backDisposition);
|
||||
}
|
||||
final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0)
|
||||
&& (mWindowManagerService.isHardKeyboardAvailable()
|
||||
|| (vis & (InputMethodService.IME_VISIBLE)) != 0);
|
||||
final boolean needsToShowImeSwitcher = iconVisibility
|
||||
&& needsToShowImeSwitchOngoingNotification();
|
||||
if (mStatusBar != null) {
|
||||
mStatusBar.setImeWindowStatus(token, vis, backDisposition,
|
||||
needsToShowImeSwitcher);
|
||||
}
|
||||
final InputMethodInfo imi = mMethodMap.get(mCurMethodId);
|
||||
if (imi != null && iconVisibility && needsToShowImeSwitchOngoingNotification()) {
|
||||
if (imi != null && needsToShowImeSwitcher) {
|
||||
// Used to load label
|
||||
final CharSequence title = mRes.getText(
|
||||
com.android.internal.R.string.select_input_method);
|
||||
|
@ -74,6 +74,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
private boolean mMenuVisible = false;
|
||||
private int mImeWindowVis = 0;
|
||||
private int mImeBackDisposition;
|
||||
private boolean mShowImeSwitcher;
|
||||
private IBinder mImeToken = null;
|
||||
private int mCurrentUserId;
|
||||
|
||||
@ -346,7 +347,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition) {
|
||||
public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition,
|
||||
final boolean showImeSwitcher) {
|
||||
enforceStatusBar();
|
||||
|
||||
if (SPEW) {
|
||||
@ -360,11 +362,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
mImeWindowVis = vis;
|
||||
mImeBackDisposition = backDisposition;
|
||||
mImeToken = token;
|
||||
mShowImeSwitcher = showImeSwitcher;
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
if (mBar != null) {
|
||||
try {
|
||||
mBar.setImeWindowStatus(token, vis, backDisposition);
|
||||
mBar.setImeWindowStatus(token, vis, backDisposition, showImeSwitcher);
|
||||
} catch (RemoteException ex) {
|
||||
}
|
||||
}
|
||||
@ -512,6 +515,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
switches[2] = mMenuVisible ? 1 : 0;
|
||||
switches[3] = mImeWindowVis;
|
||||
switches[4] = mImeBackDisposition;
|
||||
switches[7] = mShowImeSwitcher ? 1 : 0;
|
||||
binders.add(mImeToken);
|
||||
}
|
||||
switches[5] = mWindowManager.isHardKeyboardAvailable() ? 1 : 0;
|
||||
|
Reference in New Issue
Block a user