Collapse/disable shade when hiding status bar window.
Provide system bar window visibility (showing/hiding) to sysui, information it did not have before. Use this new info to disable shade interaction when bars are hiding. Bug: 8682123 Change-Id: I4105b789866f847582af1c68a703240d773fa71e
This commit is contained in:
@@ -63,6 +63,12 @@ public class StatusBarManager {
|
||||
public static final int NAVIGATION_HINT_RECENT_NOP = 1 << 2;
|
||||
public static final int NAVIGATION_HINT_BACK_ALT = 1 << 3;
|
||||
|
||||
public static final int WINDOW_STATUS_BAR = 1;
|
||||
public static final int WINDOW_NAVIGATION_BAR = 2;
|
||||
|
||||
public static final int WINDOW_STATE_HIDING = 1;
|
||||
public static final int WINDOW_STATE_SHOWING = 2;
|
||||
|
||||
private Context mContext;
|
||||
private IStatusBarService mService;
|
||||
private IBinder mToken = new Binder();
|
||||
|
||||
@@ -38,5 +38,6 @@ oneway interface IStatusBar
|
||||
void toggleRecentApps();
|
||||
void preloadRecentApps();
|
||||
void cancelPreloadRecentApps();
|
||||
void setWindowState(int window, int state);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,4 +51,5 @@ interface IStatusBarService
|
||||
void toggleRecentApps();
|
||||
void preloadRecentApps();
|
||||
void cancelPreloadRecentApps();
|
||||
void setWindowState(int window, int state);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
private static final int MSG_PRELOAD_RECENT_APPS = 14 << MSG_SHIFT;
|
||||
private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 15 << MSG_SHIFT;
|
||||
private static final int MSG_SET_NAVIGATION_ICON_HINTS = 16 << MSG_SHIFT;
|
||||
private static final int MSG_SET_WINDOW_STATE = 17 << MSG_SHIFT;
|
||||
|
||||
public static final int FLAG_EXCLUDE_NONE = 0;
|
||||
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
|
||||
@@ -98,6 +99,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
public void hideSearchPanel();
|
||||
public void cancelPreloadRecentApps();
|
||||
public void setNavigationIconHints(int hints);
|
||||
public void setWindowState(int window, int state);
|
||||
}
|
||||
|
||||
public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
|
||||
@@ -232,6 +234,13 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void setWindowState(int window, int state) {
|
||||
synchronized (mList) {
|
||||
mHandler.removeMessages(MSG_SET_WINDOW_STATE);
|
||||
mHandler.obtainMessage(MSG_SET_WINDOW_STATE, window, state, null).sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
private final class H extends Handler {
|
||||
public void handleMessage(Message msg) {
|
||||
final int what = msg.what & MSG_MASK;
|
||||
@@ -312,6 +321,9 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
case MSG_SET_NAVIGATION_ICON_HINTS:
|
||||
mCallbacks.setNavigationIconHints(msg.arg1);
|
||||
break;
|
||||
case MSG_SET_WINDOW_STATE:
|
||||
mCallbacks.setWindowState(msg.arg1, msg.arg2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ public class PanelBar extends FrameLayout {
|
||||
} else {
|
||||
pv.setExpandedFraction(0); // just in case
|
||||
pv.setVisibility(View.GONE);
|
||||
pv.cancelPeek();
|
||||
}
|
||||
}
|
||||
if (DEBUG) LOG("collapseAllPanels: animate=%s waiting=%s", animate, waiting);
|
||||
|
||||
@@ -40,8 +40,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
public static final boolean DEBUG_NAN = true; // http://b/7686690
|
||||
|
||||
public final void LOG(String fmt, Object... args) {
|
||||
if (!DEBUG) return;
|
||||
private final void logf(String fmt, Object... args) {
|
||||
Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
|
||||
}
|
||||
|
||||
@@ -221,7 +220,7 @@ public class PanelView extends FrameLayout {
|
||||
}
|
||||
|
||||
private void runPeekAnimation() {
|
||||
if (DEBUG) LOG("peek to height=%.1f", mPeekHeight);
|
||||
if (DEBUG) logf("peek to height=%.1f", mPeekHeight);
|
||||
if (mTimeAnimator.isStarted()) {
|
||||
return;
|
||||
}
|
||||
@@ -256,8 +255,8 @@ public class PanelView extends FrameLayout {
|
||||
}
|
||||
} else if (dtms > 0) {
|
||||
final float dt = dtms * 0.001f; // ms -> s
|
||||
if (DEBUG) LOG("tick: v=%.2fpx/s dt=%.4fs", mVel, dt);
|
||||
if (DEBUG) LOG("tick: before: h=%d", (int) mExpandedHeight);
|
||||
if (DEBUG) logf("tick: v=%.2fpx/s dt=%.4fs", mVel, dt);
|
||||
if (DEBUG) logf("tick: before: h=%d", (int) mExpandedHeight);
|
||||
|
||||
final float fh = getFullHeight();
|
||||
boolean braking = false;
|
||||
@@ -295,7 +294,7 @@ public class PanelView extends FrameLayout {
|
||||
h = fh;
|
||||
}
|
||||
|
||||
if (DEBUG) LOG("tick: new h=%d closing=%s", (int) h, mClosing?"true":"false");
|
||||
if (DEBUG) logf("tick: new h=%d closing=%s", (int) h, mClosing?"true":"false");
|
||||
|
||||
setExpandedHeightInternal(h);
|
||||
|
||||
@@ -367,14 +366,14 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
loadDimens();
|
||||
|
||||
if (DEBUG) LOG("handle view: " + mHandleView);
|
||||
if (DEBUG) logf("handle view: " + mHandleView);
|
||||
if (mHandleView != null) {
|
||||
mHandleView.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
final float y = event.getY();
|
||||
final float rawY = event.getRawY();
|
||||
if (DEBUG) LOG("handle.onTouch: a=%s y=%.1f rawY=%.1f off=%.1f",
|
||||
if (DEBUG) logf("handle.onTouch: a=%s y=%.1f rawY=%.1f off=%.1f",
|
||||
MotionEvent.actionToString(event.getAction()),
|
||||
y, rawY, mTouchOffset);
|
||||
PanelView.this.getLocationOnScreen(mAbsPos);
|
||||
@@ -461,7 +460,7 @@ public class PanelView extends FrameLayout {
|
||||
vel = -vel;
|
||||
}
|
||||
|
||||
if (DEBUG) LOG("gesture: dy=%f vel=(%f,%f) vlinear=%f",
|
||||
if (DEBUG) logf("gesture: dy=%f vel=(%f,%f) vlinear=%f",
|
||||
deltaY,
|
||||
xVel, yVel,
|
||||
vel);
|
||||
@@ -476,7 +475,7 @@ public class PanelView extends FrameLayout {
|
||||
}
|
||||
|
||||
public void fling(float vel, boolean always) {
|
||||
if (DEBUG) LOG("fling: vel=%.3f, this=%s", vel, this);
|
||||
if (DEBUG) logf("fling: vel=%.3f, this=%s", vel, this);
|
||||
mVel = vel;
|
||||
|
||||
if (always||mVel != 0) {
|
||||
@@ -496,7 +495,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
protected void onViewAdded(View child) {
|
||||
if (DEBUG) LOG("onViewAdded: " + child);
|
||||
if (DEBUG) logf("onViewAdded: " + child);
|
||||
}
|
||||
|
||||
public View getHandle() {
|
||||
@@ -508,7 +507,7 @@ public class PanelView extends FrameLayout {
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
if (DEBUG) LOG("onMeasure(%d, %d) -> (%d, %d)",
|
||||
if (DEBUG) logf("onMeasure(%d, %d) -> (%d, %d)",
|
||||
widthMeasureSpec, heightMeasureSpec, getMeasuredWidth(), getMeasuredHeight());
|
||||
|
||||
// Did one of our children change size?
|
||||
@@ -528,7 +527,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
|
||||
public void setExpandedHeight(float height) {
|
||||
if (DEBUG) LOG("setExpandedHeight(%.1f)", height);
|
||||
if (DEBUG) logf("setExpandedHeight(%.1f)", height);
|
||||
mRubberbanding = false;
|
||||
if (mTimeAnimator.isStarted()) {
|
||||
post(mStopAnimator);
|
||||
@@ -539,7 +538,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
protected void onLayout (boolean changed, int left, int top, int right, int bottom) {
|
||||
if (DEBUG) LOG("onLayout: changed=%s, bottom=%d eh=%d fh=%d", changed?"T":"f", bottom, (int)mExpandedHeight, mFullHeight);
|
||||
if (DEBUG) logf("onLayout: changed=%s, bottom=%d eh=%d fh=%d", changed?"T":"f", bottom, (int)mExpandedHeight, mFullHeight);
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
}
|
||||
|
||||
@@ -563,7 +562,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
mExpandedHeight = h;
|
||||
|
||||
if (DEBUG) LOG("setExpansion: height=%.1f fh=%.1f tracking=%s rubber=%s", h, fh, mTracking?"T":"f", mRubberbanding?"T":"f");
|
||||
if (DEBUG) logf("setExpansion: height=%.1f fh=%.1f tracking=%s rubber=%s", h, fh, mTracking?"T":"f", mRubberbanding?"T":"f");
|
||||
|
||||
requestLayout();
|
||||
// FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
|
||||
@@ -575,7 +574,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
private float getFullHeight() {
|
||||
if (mFullHeight <= 0) {
|
||||
if (DEBUG) LOG("Forcing measure() since fullHeight=" + mFullHeight);
|
||||
if (DEBUG) logf("Forcing measure() since fullHeight=" + mFullHeight);
|
||||
measure(MeasureSpec.makeMeasureSpec(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, MeasureSpec.EXACTLY),
|
||||
MeasureSpec.makeMeasureSpec(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, MeasureSpec.EXACTLY));
|
||||
}
|
||||
@@ -620,7 +619,7 @@ public class PanelView extends FrameLayout {
|
||||
|
||||
public void collapse() {
|
||||
// TODO: abort animation or ongoing touch
|
||||
if (DEBUG) LOG("collapse: " + this);
|
||||
if (DEBUG) logf("collapse: " + this);
|
||||
if (!isFullyCollapsed()) {
|
||||
mTimeAnimator.cancel();
|
||||
mClosing = true;
|
||||
@@ -631,12 +630,18 @@ public class PanelView extends FrameLayout {
|
||||
}
|
||||
|
||||
public void expand() {
|
||||
if (DEBUG) LOG("expand: " + this);
|
||||
if (DEBUG) logf("expand: " + this);
|
||||
if (isFullyCollapsed()) {
|
||||
mBar.startOpeningPanel(this);
|
||||
fling(mSelfExpandVelocityPx, /*always=*/ true);
|
||||
} else if (DEBUG) {
|
||||
if (DEBUG) LOG("skipping expansion: is expanded");
|
||||
if (DEBUG) logf("skipping expansion: is expanded");
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelPeek() {
|
||||
if (mPeekAnimator != null && mPeekAnimator.isStarted()) {
|
||||
mPeekAnimator.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
|
||||
StatusBarWindowView mStatusBarWindow;
|
||||
PhoneStatusBarView mStatusBarView;
|
||||
private int mStatusBarWindowState;
|
||||
|
||||
int mPixelFormat;
|
||||
Object mQueueLock = new Object();
|
||||
@@ -227,6 +228,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
|
||||
// on-screen navigation buttons
|
||||
private NavigationBarView mNavigationBarView = null;
|
||||
private int mNavigationBarWindowState;
|
||||
|
||||
// the tracker view
|
||||
int mTrackingPosition; // the position of the top of the tracking view.
|
||||
@@ -1363,9 +1365,14 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
}
|
||||
};
|
||||
|
||||
boolean panelsEnabled() {
|
||||
return ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0
|
||||
&& mStatusBarWindowState != StatusBarManager.WINDOW_STATE_HIDING);
|
||||
}
|
||||
|
||||
void makeExpandedVisible() {
|
||||
if (SPEW) Log.d(TAG, "Make expanded visible: expanded visible=" + mExpandedVisible);
|
||||
if (mExpandedVisible) {
|
||||
if (mExpandedVisible || !panelsEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1466,7 +1473,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
@Override
|
||||
public void animateExpandNotificationsPanel() {
|
||||
if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
|
||||
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
|
||||
if (!panelsEnabled()) {
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -1521,7 +1528,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
@Override
|
||||
public void animateExpandSettingsPanel() {
|
||||
if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
|
||||
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
|
||||
if (!panelsEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1839,6 +1846,39 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // CommandQueue
|
||||
public void setWindowState(int window, int state) {
|
||||
if (mStatusBarWindow != null
|
||||
&& window == StatusBarManager.WINDOW_STATUS_BAR
|
||||
&& mStatusBarWindowState != state) {
|
||||
mStatusBarWindowState = state;
|
||||
if (DEBUG) Log.d(TAG, "Status bar window " + stateString(state));
|
||||
if (state == StatusBarManager.WINDOW_STATE_HIDING) {
|
||||
mStatusBarWindow.setEnabled(false);
|
||||
mStatusBarView.collapseAllPanels(false);
|
||||
} else if (state == StatusBarManager.WINDOW_STATE_SHOWING) {
|
||||
mStatusBarWindow.setEnabled(true);
|
||||
}
|
||||
}
|
||||
if (mNavigationBarView != null
|
||||
&& window == StatusBarManager.WINDOW_NAVIGATION_BAR
|
||||
&& mNavigationBarWindowState != state) {
|
||||
mNavigationBarWindowState = state;
|
||||
if (DEBUG) Log.d(TAG, "Navigation bar window " + stateString(state));
|
||||
if (state == StatusBarManager.WINDOW_STATE_HIDING) {
|
||||
mNavigationBarView.setEnabled(false);
|
||||
} else if (state == StatusBarManager.WINDOW_STATE_SHOWING) {
|
||||
mNavigationBarView.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String stateString(int state) {
|
||||
if (state == StatusBarManager.WINDOW_STATE_HIDING) return "hiding";
|
||||
if (state == StatusBarManager.WINDOW_STATE_SHOWING) return "showing";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@Override // CommandQueue
|
||||
public void setSystemUiVisibility(int vis, int mask) {
|
||||
final int oldVal = mSystemUiVisibility;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
|
||||
@Override
|
||||
public boolean panelsEnabled() {
|
||||
return ((mBar.mDisabled & StatusBarManager.DISABLE_EXPAND) == 0);
|
||||
return mBar.panelsEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -92,6 +92,10 @@ public class TvStatusBar extends BaseStatusBar {
|
||||
public void setNavigationIconHints(int hints) {
|
||||
}
|
||||
|
||||
@Override // CommandQueue
|
||||
public void setWindowState(int window, int state) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createAndAddWindows() {
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.app.AppOpsManager;
|
||||
import android.app.IUiModeManager;
|
||||
import android.app.ProgressDialog;
|
||||
import android.app.SearchManager;
|
||||
import android.app.StatusBarManager;
|
||||
import android.app.UiModeManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -2526,12 +2527,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
if (mStatusBar != null && mStatusHideybar == HIDEYBAR_SHOWING &&
|
||||
0 == (visibility & View.STATUS_BAR_OVERLAY)) {
|
||||
mStatusHideybar = HIDEYBAR_HIDING;
|
||||
mStatusBar.hideLw(true);
|
||||
setBarShowingLw(mStatusBar, false);
|
||||
}
|
||||
if (mNavigationBar != null && mNavigationHideybar == HIDEYBAR_SHOWING &&
|
||||
0 == (visibility & View.NAVIGATION_BAR_OVERLAY)) {
|
||||
mNavigationHideybar = HIDEYBAR_HIDING;
|
||||
mNavigationBar.hideLw(true);
|
||||
setBarShowingLw(mNavigationBar, false);
|
||||
}
|
||||
// Reset any bits in mForceClearingStatusBarVisibility that
|
||||
// are now clear.
|
||||
@@ -2699,15 +2700,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mTmpNavigationFrame.set(0, top, displayWidth, displayHeight - overscanBottom);
|
||||
mStableBottom = mStableFullscreenBottom = mTmpNavigationFrame.top;
|
||||
if (navBarHideyShowing) {
|
||||
mNavigationBar.showLw(true);
|
||||
setBarShowingLw(mNavigationBar, true);
|
||||
} else if (navVisible) {
|
||||
mNavigationBar.showLw(true);
|
||||
setBarShowingLw(mNavigationBar, true);
|
||||
mDockBottom = mTmpNavigationFrame.top;
|
||||
mRestrictedScreenHeight = mDockBottom - mRestrictedScreenTop;
|
||||
mRestrictedOverscanScreenHeight = mDockBottom - mRestrictedOverscanScreenTop;
|
||||
} else {
|
||||
// We currently want to hide the navigation UI.
|
||||
mNavigationBar.hideLw(true);
|
||||
setBarShowingLw(mNavigationBar, false);
|
||||
}
|
||||
if (navVisible && !mNavigationBar.isAnimatingLw()) {
|
||||
// If the nav bar is currently requested to be visible,
|
||||
@@ -2722,15 +2723,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mTmpNavigationFrame.set(left, 0, displayWidth - overscanRight, displayHeight);
|
||||
mStableRight = mStableFullscreenRight = mTmpNavigationFrame.left;
|
||||
if (navBarHideyShowing) {
|
||||
mNavigationBar.showLw(true);
|
||||
setBarShowingLw(mNavigationBar, true);
|
||||
} else if (navVisible) {
|
||||
mNavigationBar.showLw(true);
|
||||
setBarShowingLw(mNavigationBar, true);
|
||||
mDockRight = mTmpNavigationFrame.left;
|
||||
mRestrictedScreenWidth = mDockRight - mRestrictedScreenLeft;
|
||||
mRestrictedOverscanScreenWidth = mDockRight - mRestrictedOverscanScreenLeft;
|
||||
} else {
|
||||
// We currently want to hide the navigation UI.
|
||||
mNavigationBar.hideLw(true);
|
||||
setBarShowingLw(mNavigationBar, false);
|
||||
}
|
||||
if (navVisible && !mNavigationBar.isAnimatingLw()) {
|
||||
// If the nav bar is currently requested to be visible,
|
||||
@@ -3379,7 +3380,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
+ " top=" + mTopFullscreenOpaqueWindowState);
|
||||
if (mForceStatusBar || mForceStatusBarFromKeyguard) {
|
||||
if (DEBUG_LAYOUT) Slog.v(TAG, "Showing status bar: forced");
|
||||
if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
if (setBarShowingLw(mStatusBar, true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
} else if (mTopFullscreenOpaqueWindowState != null) {
|
||||
if (localLOGV) {
|
||||
Slog.d(TAG, "frame: " + mTopFullscreenOpaqueWindowState.getFrameLw()
|
||||
@@ -3394,33 +3395,19 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
// has the FLAG_FULLSCREEN set. Not sure if there is another way that to be the
|
||||
// case though.
|
||||
if (mStatusHideybar == HIDEYBAR_SHOWING) {
|
||||
if (mStatusBar.showLw(true)) {
|
||||
if (setBarShowingLw(mStatusBar, true)) {
|
||||
changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
}
|
||||
} else if (topIsFullscreen) {
|
||||
if (DEBUG_LAYOUT) Slog.v(TAG, "** HIDING status bar");
|
||||
if (mStatusBar.hideLw(true)) {
|
||||
if (setBarShowingLw(mStatusBar, false)) {
|
||||
changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
IStatusBarService statusbar = getStatusBarService();
|
||||
if (statusbar != null) {
|
||||
statusbar.collapsePanels();
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
// re-acquire status bar service next time it is needed.
|
||||
mStatusBarService = null;
|
||||
}
|
||||
}});
|
||||
} else {
|
||||
if (DEBUG_LAYOUT) Slog.v(TAG, "Status bar already hiding");
|
||||
}
|
||||
} else {
|
||||
if (DEBUG_LAYOUT) Slog.v(TAG, "** SHOWING status bar: top is not fullscreen");
|
||||
if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
if (setBarShowingLw(mStatusBar, true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5071,7 +5058,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
tmpVisibility |= View.STATUS_BAR_OVERLAY;
|
||||
if ((mLastSystemUiFlags & View.STATUS_BAR_OVERLAY) == 0) {
|
||||
tmpVisibility &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE;
|
||||
mStatusBar.showLw(true);
|
||||
setBarShowingLw(mStatusBar, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5088,13 +5075,39 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
tmpVisibility |= View.NAVIGATION_BAR_OVERLAY;
|
||||
if ((mLastSystemUiFlags & View.NAVIGATION_BAR_OVERLAY) == 0) {
|
||||
tmpVisibility &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE;
|
||||
mNavigationBar.showLw(true);
|
||||
setBarShowingLw(mNavigationBar, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tmpVisibility;
|
||||
}
|
||||
|
||||
private boolean setBarShowingLw(WindowState win, final boolean show) {
|
||||
final int window =
|
||||
win == mStatusBar ? StatusBarManager.WINDOW_STATUS_BAR
|
||||
: win == mNavigationBar ? StatusBarManager.WINDOW_NAVIGATION_BAR
|
||||
: 0;
|
||||
if (window != 0) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
IStatusBarService statusbar = getStatusBarService();
|
||||
if (statusbar != null) {
|
||||
statusbar.setWindowState(window, show
|
||||
? StatusBarManager.WINDOW_STATE_SHOWING
|
||||
: StatusBarManager.WINDOW_STATE_HIDING);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
// re-acquire status bar service next time it is needed.
|
||||
mStatusBarService = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return show ? win.showLw(true) : win.hideLw(true);
|
||||
}
|
||||
|
||||
// TODO temporary helper that allows testing overlay bars on existing apps
|
||||
private static final class OverlayTesting {
|
||||
static String ENABLED_SETTING = "overlay_testing_enabled";
|
||||
|
||||
@@ -399,6 +399,15 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
mCurrentUserId = newUserId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindowState(int window, int state) {
|
||||
if (mBar != null) {
|
||||
try {
|
||||
mBar.setWindowState(window, state);
|
||||
} catch (RemoteException ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
private void enforceStatusBar() {
|
||||
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR,
|
||||
"StatusBarManagerService");
|
||||
|
||||
Reference in New Issue
Block a user