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