diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-10-06 15:15:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-06 15:15:32 -0700 |
commit | 85b9edf2da0534bc53d139bb88cda8866d265afe (patch) | |
tree | a0a50380b9f263103fbc99c6622f40e7541d95f8 /services/java | |
parent | 7853c579fa52e4365c6e44ba38aeb3299d776f44 (diff) | |
parent | 9a230e01a1237749a8a19a5de8d46531b0c8ca6a (diff) | |
download | frameworks_base-85b9edf2da0534bc53d139bb88cda8866d265afe.zip frameworks_base-85b9edf2da0534bc53d139bb88cda8866d265afe.tar.gz frameworks_base-85b9edf2da0534bc53d139bb88cda8866d265afe.tar.bz2 |
Merge "Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately"
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/wm/Session.java | 12 | ||||
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 35 | ||||
-rw-r--r-- | services/java/com/android/server/wm/WindowState.java | 12 |
3 files changed, 43 insertions, 16 deletions
diff --git a/services/java/com/android/server/wm/Session.java b/services/java/com/android/server/wm/Session.java index 2e0c9ab..10882f9 100644 --- a/services/java/com/android/server/wm/Session.java +++ b/services/java/com/android/server/wm/Session.java @@ -134,28 +134,28 @@ final class Session extends IWindowSession.Stub } } - public int add(IWindow window, WindowManager.LayoutParams attrs, + public int add(IWindow window, int seq, WindowManager.LayoutParams attrs, int viewVisibility, Rect outContentInsets, InputChannel outInputChannel) { - return mService.addWindow(this, window, attrs, viewVisibility, outContentInsets, + return mService.addWindow(this, window, seq, attrs, viewVisibility, outContentInsets, outInputChannel); } - public int addWithoutInputChannel(IWindow window, WindowManager.LayoutParams attrs, + public int addWithoutInputChannel(IWindow window, int seq, WindowManager.LayoutParams attrs, int viewVisibility, Rect outContentInsets) { - return mService.addWindow(this, window, attrs, viewVisibility, outContentInsets, null); + return mService.addWindow(this, window, seq, attrs, viewVisibility, outContentInsets, null); } public void remove(IWindow window) { mService.removeWindow(this, window); } - public int relayout(IWindow window, WindowManager.LayoutParams attrs, + public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewFlags, boolean insetsPending, Rect outFrame, Rect outContentInsets, Rect outVisibleInsets, Configuration outConfig, Surface outSurface) { if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from " + Binder.getCallingPid()); - int res = mService.relayoutWindow(this, window, attrs, + int res = mService.relayoutWindow(this, window, seq, attrs, requestedWidth, requestedHeight, viewFlags, insetsPending, outFrame, outContentInsets, outVisibleInsets, outConfig, outSurface); if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to " diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index f1994d1..540c518 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -1948,7 +1948,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - public int addWindow(Session session, IWindow client, + public int addWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int viewVisibility, Rect outContentInsets, InputChannel outInputChannel) { int res = mPolicy.checkAddPermission(attrs); @@ -2040,7 +2040,7 @@ public class WindowManagerService extends IWindowManager.Stub } win = new WindowState(this, session, client, token, - attachedWindow, attrs, viewVisibility); + attachedWindow, seq, attrs, viewVisibility); if (win.mDeathRecipient == null) { // Client has apparently died, so there is no reason to // continue. @@ -2467,7 +2467,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } - public int relayoutWindow(Session session, IWindow client, + public int relayoutWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, boolean insetsPending, Rect outFrame, Rect outContentInsets, Rect outVisibleInsets, @@ -2477,13 +2477,13 @@ public class WindowManagerService extends IWindowManager.Stub boolean configChanged; // if they don't have this permission, mask out the status bar bits + int systemUiVisibility = 0; if (attrs != null) { - if (((attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility) - & StatusBarManager.DISABLE_MASK) != 0) { + systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); + if ((systemUiVisibility & StatusBarManager.DISABLE_MASK) != 0) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) != PackageManager.PERMISSION_GRANTED) { - attrs.systemUiVisibility &= ~StatusBarManager.DISABLE_MASK; - attrs.subtreeSystemUiVisibility &= ~StatusBarManager.DISABLE_MASK; + systemUiVisibility &= ~StatusBarManager.DISABLE_MASK; } } } @@ -2496,6 +2496,9 @@ public class WindowManagerService extends IWindowManager.Stub } win.mRequestedWidth = requestedWidth; win.mRequestedHeight = requestedHeight; + if (attrs != null && seq == win.mSeq) { + win.mSystemUiVisibility = systemUiVisibility; + } if (attrs != null) { mPolicy.adjustWindowParamsLw(attrs); @@ -9095,13 +9098,27 @@ public class WindowManagerService extends IWindowManager.Stub @Override public void statusBarVisibilityChanged(int visibility) { mInputManager.setSystemUiVisibility(visibility); + synchronized (mWindowMap) { final int N = mWindows.size(); for (int i = 0; i < N; i++) { WindowState ws = mWindows.get(i); try { - if (ws.getAttrs().hasSystemUiListeners) { - ws.mClient.dispatchSystemUiVisibilityChanged(visibility); + int curValue = ws.mSystemUiVisibility; + int diff = curValue ^ visibility; + // We are only interested in differences of one of the + // clearable flags... + diff &= View.SYSTEM_UI_CLEARABLE_FLAGS; + // ...if it has actually been cleared. + diff &= ~visibility; + int newValue = (curValue&~diff) | (visibility&diff); + if (newValue != curValue) { + ws.mSeq++; + ws.mSystemUiVisibility = newValue; + } + if (newValue != curValue || ws.mAttrs.hasSystemUiListeners) { + ws.mClient.dispatchSystemUiVisibilityChanged(ws.mSeq, + visibility, newValue, diff); } } catch (RemoteException e) { // so sorry diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index 3640a15..47f74fb 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -76,8 +76,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { final boolean mIsImWindow; final boolean mIsWallpaper; final boolean mIsFloatingLayer; + int mSeq; boolean mEnforceSizeCompat; int mViewVisibility; + int mSystemUiVisibility; boolean mPolicyVisibility = true; boolean mPolicyVisibilityAfterAnim = true; boolean mAppFreezing; @@ -282,7 +284,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { boolean mWasPaused; WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token, - WindowState attachedWindow, WindowManager.LayoutParams a, + WindowState attachedWindow, int seq, WindowManager.LayoutParams a, int viewVisibility) { mService = service; mSession = s; @@ -292,6 +294,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mViewVisibility = viewVisibility; DeathRecipient deathRecipient = new DeathRecipient(); mAlpha = a.alpha; + mSeq = seq; mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0; if (WindowManagerService.localLOGV) Slog.v( WindowManagerService.TAG, "Window " + this + " client=" + c.asBinder() @@ -551,6 +554,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { return mAttrs; } + public int getSystemUiVisibility() { + return mSystemUiVisibility; + } + public int getSurfaceLayer() { return mLayer; } @@ -1597,6 +1604,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { pw.print(" mLastHidden="); pw.print(mLastHidden); pw.print(" mHaveFrame="); pw.print(mHaveFrame); pw.print(" mObscured="); pw.println(mObscured); + pw.print(prefix); pw.print("mSeq="); pw.print(mSeq); + pw.print(" mSystemUiVisibility=0x"); + pw.println(Integer.toHexString(mSystemUiVisibility)); } if (!mPolicyVisibility || !mPolicyVisibilityAfterAnim || mAttachedHidden) { pw.print(prefix); pw.print("mPolicyVisibility="); |