Merge "Force status bar window to be visible when expanded" into nyc-dev am: 4b4e814533
am: 33f6c04283
* commit '33f6c04283aa0627b74383c104916a3066fca0a1':
Force status bar window to be visible when expanded
Change-Id: Idabf547708790e96cf0576b87b363c910d02729e
This commit is contained in:
@@ -2795,11 +2795,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
|
||||
// update low profile
|
||||
if ((diff & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
|
||||
final boolean lightsOut = (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0;
|
||||
if (lightsOut) {
|
||||
animateCollapsePanels();
|
||||
}
|
||||
|
||||
setAreThereNotifications();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Slog;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.WindowManagerPolicy.WindowState;
|
||||
|
||||
@@ -53,7 +54,7 @@ public class BarController {
|
||||
private final Object mServiceAquireLock = new Object();
|
||||
protected StatusBarManagerInternal mStatusBarInternal;
|
||||
|
||||
private WindowState mWin;
|
||||
protected WindowState mWin;
|
||||
private int mState = StatusBarManager.WINDOW_STATE_SHOWING;
|
||||
private int mTransientBarState;
|
||||
private boolean mPendingShow;
|
||||
@@ -147,14 +148,18 @@ public class BarController {
|
||||
}
|
||||
final boolean wasVis = mWin.isVisibleLw();
|
||||
final boolean wasAnim = mWin.isAnimatingLw();
|
||||
final boolean change = show ? mWin.showLw(!mNoAnimationOnNextShow)
|
||||
: mWin.hideLw(!mNoAnimationOnNextShow);
|
||||
final boolean change = show ? mWin.showLw(!mNoAnimationOnNextShow && !skipAnimation())
|
||||
: mWin.hideLw(!mNoAnimationOnNextShow && !skipAnimation());
|
||||
mNoAnimationOnNextShow = false;
|
||||
final int state = computeStateLw(wasVis, wasAnim, mWin, change);
|
||||
final boolean stateChanged = updateStateLw(state);
|
||||
return change || stateChanged;
|
||||
}
|
||||
|
||||
protected boolean skipAnimation() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private int computeStateLw(boolean wasVis, boolean wasAnim, WindowState win, boolean change) {
|
||||
if (win.isDrawnLw()) {
|
||||
final boolean vis = win.isVisibleLw();
|
||||
|
||||
@@ -3956,6 +3956,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
if (!isKeyguardShowing) {
|
||||
navTranslucent &= areTranslucentBarsAllowed();
|
||||
}
|
||||
boolean statusBarExpandedNotKeyguard = !isKeyguardShowing
|
||||
&& mStatusBar.getAttrs().height == MATCH_PARENT
|
||||
&& mStatusBar.getAttrs().width == MATCH_PARENT;
|
||||
|
||||
// When the navigation bar isn't visible, we put up a fake
|
||||
// input window to catch all touch events. This way we can
|
||||
@@ -3978,7 +3981,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
|
||||
boolean updateSysUiVisibility = layoutNavigationBar(displayWidth, displayHeight,
|
||||
displayRotation, uiMode, overscanRight, overscanBottom, dcf, navVisible, navTranslucent,
|
||||
navAllowedHidden);
|
||||
navAllowedHidden, statusBarExpandedNotKeyguard);
|
||||
if (DEBUG_LAYOUT) Slog.i(TAG, String.format("mDock rect: (%d,%d - %d,%d)",
|
||||
mDockLeft, mDockTop, mDockRight, mDockBottom));
|
||||
updateSysUiVisibility |= layoutStatusBar(pf, df, of, vf, dcf, sysui, isKeyguardShowing);
|
||||
@@ -4057,7 +4060,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
|
||||
private boolean layoutNavigationBar(int displayWidth, int displayHeight, int displayRotation,
|
||||
int uiMode, int overscanRight, int overscanBottom, Rect dcf, boolean navVisible,
|
||||
boolean navTranslucent, boolean navAllowedHidden) {
|
||||
boolean navTranslucent, boolean navAllowedHidden,
|
||||
boolean statusBarExpandedNotKeyguard) {
|
||||
if (mNavigationBar != null) {
|
||||
boolean transientNavBarShowing = mNavigationBarController.isTransientShowing();
|
||||
// Force the navigation bar to its appropriate place and
|
||||
@@ -4079,8 +4083,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mRestrictedScreenHeight = mDockBottom - mRestrictedScreenTop;
|
||||
mRestrictedOverscanScreenHeight = mDockBottom - mRestrictedOverscanScreenTop;
|
||||
} else {
|
||||
// We currently want to hide the navigation UI.
|
||||
mNavigationBarController.setBarShowingLw(false);
|
||||
// We currently want to hide the navigation UI - unless we expanded the status
|
||||
// bar.
|
||||
mNavigationBarController.setBarShowingLw(statusBarExpandedNotKeyguard);
|
||||
}
|
||||
if (navVisible && !navTranslucent && !navAllowedHidden
|
||||
&& !mNavigationBar.isAnimatingLw()
|
||||
@@ -4104,8 +4109,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mRestrictedScreenWidth = mDockRight - mRestrictedScreenLeft;
|
||||
mRestrictedOverscanScreenWidth = mDockRight - mRestrictedOverscanScreenLeft;
|
||||
} else {
|
||||
// We currently want to hide the navigation UI.
|
||||
mNavigationBarController.setBarShowingLw(false);
|
||||
// We currently want to hide the navigation UI - unless we expanded the status
|
||||
// bar.
|
||||
mNavigationBarController.setBarShowingLw(statusBarExpandedNotKeyguard);
|
||||
}
|
||||
if (navVisible && !navTranslucent && !navAllowedHidden
|
||||
&& !mNavigationBar.isAnimatingLw()
|
||||
@@ -5023,7 +5029,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
} else if (!mStatusBar.isVisibleLw()) {
|
||||
mStatusBarController.setShowTransparent(true /* transparent */);
|
||||
}
|
||||
if (mForceStatusBar || mForceStatusBarFromKeyguard || mForceStatusBarTransparent) {
|
||||
|
||||
WindowManager.LayoutParams statusBarAttrs = mStatusBar.getAttrs();
|
||||
boolean statusBarExpanded = statusBarAttrs.height == MATCH_PARENT
|
||||
&& statusBarAttrs.width == MATCH_PARENT;
|
||||
if (mForceStatusBar || mForceStatusBarFromKeyguard || mForceStatusBarTransparent
|
||||
|| statusBarExpanded) {
|
||||
if (DEBUG_LAYOUT) Slog.v(TAG, "Showing status bar: forced");
|
||||
if (mStatusBarController.setBarShowingLw(true)) {
|
||||
changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
@@ -5035,6 +5046,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mStatusBarController.updateVisibilityLw(false /*transientAllowed*/,
|
||||
mLastSystemUiFlags, mLastSystemUiFlags);
|
||||
}
|
||||
if (statusBarExpanded && mNavigationBar != null) {
|
||||
if (mNavigationBarController.setBarShowingLw(true)) {
|
||||
changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
}
|
||||
}
|
||||
} else if (mTopFullscreenOpaqueWindowState != null) {
|
||||
final int fl = PolicyControl.getWindowFlags(null, lp);
|
||||
if (localLOGV) {
|
||||
|
||||
@@ -16,11 +16,14 @@
|
||||
|
||||
package com.android.server.policy;
|
||||
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
|
||||
import static android.view.WindowManager.LayoutParams.MATCH_PARENT;
|
||||
import static android.view.WindowManagerInternal.AppTransitionListener;
|
||||
|
||||
import android.app.StatusBarManager;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationSet;
|
||||
import android.view.animation.Interpolator;
|
||||
@@ -29,8 +32,6 @@ import android.view.animation.TranslateAnimation;
|
||||
import com.android.server.LocalServices;
|
||||
import com.android.server.statusbar.StatusBarManagerInternal;
|
||||
|
||||
import static android.view.WindowManagerInternal.*;
|
||||
|
||||
/**
|
||||
* Implements status bar specific behavior.
|
||||
*/
|
||||
@@ -106,10 +107,15 @@ public class StatusBarController extends BarController {
|
||||
View.STATUS_BAR_UNHIDE,
|
||||
View.STATUS_BAR_TRANSLUCENT,
|
||||
StatusBarManager.WINDOW_STATUS_BAR,
|
||||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
|
||||
FLAG_TRANSLUCENT_STATUS,
|
||||
View.STATUS_BAR_TRANSPARENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean skipAnimation() {
|
||||
return mWin.getAttrs().height == MATCH_PARENT;
|
||||
}
|
||||
|
||||
public AppTransitionListener getAppTransitionListener() {
|
||||
return mAppTransitionListener;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user