private void applyFocusableFlag(State state) {
boolean panelFocusable = state.statusBarFocusable && state.panelExpanded;
- if (state.isKeyguardShowingAndNotOccluded() && state.keyguardNeedsInput
- && state.bouncerShowing || BaseStatusBar.ENABLE_REMOTE_INPUT && panelFocusable) {
+ if (state.keyguardShowing && state.keyguardNeedsInput && state.bouncerShowing
+ || BaseStatusBar.ENABLE_REMOTE_INPUT && panelFocusable) {
mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
} else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {
|| insets.top != getPaddingTop()
|| insets.right != getPaddingRight()
|| insets.bottom != getPaddingBottom();
+
+ // Drop top inset, apply right and left inset and pass through bottom inset.
if (changed) {
- setPadding(insets.left, insets.top, insets.right, 0);
+ setPadding(insets.left, 0, insets.right, 0);
}
insets.left = 0;
insets.top = 0;
if (changed) {
setPadding(0, 0, 0, 0);
}
+ insets.top = 0;
}
return false;
}
}
}
+ private boolean canReceiveInput(WindowState win) {
+ boolean notFocusable =
+ (win.getAttrs().flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) != 0;
+ boolean altFocusableIm =
+ (win.getAttrs().flags & WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) != 0;
+ boolean notFocusableForIm = notFocusable ^ altFocusableIm;
+ return !notFocusableForIm;
+ }
+
/** {@inheritDoc} */
@Override
public void layoutWindowLw(WindowState win, WindowState attached) {
- // we've already done the status bar
- final WindowManager.LayoutParams attrs = win.getAttrs();
- if ((win == mStatusBar && (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) == 0) ||
- win == mNavigationBar) {
+ // We've already done the navigation bar and status bar. If the status bar can receive
+ // input, we need to layout it again to accomodate for the IME window.
+ if ((win == mStatusBar && !canReceiveInput(win)) || win == mNavigationBar) {
return;
}
+ final WindowManager.LayoutParams attrs = win.getAttrs();
final boolean isDefaultDisplay = win.isDefaultDisplay();
final boolean needsToOffsetInputMethodTarget = isDefaultDisplay &&
(win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null);
+ mUnrestrictedScreenHeight;
cf.bottom = vf.bottom = mStableBottom;
cf.top = vf.top = mStableTop;
- } else if (win == mStatusBar && (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
+ } else if (win == mStatusBar) {
pf.left = df.left = of.left = mUnrestrictedScreenLeft;
pf.top = df.top = of.top = mUnrestrictedScreenTop;
pf.right = df.right = of.right = mUnrestrictedScreenWidth + mUnrestrictedScreenLeft;