diff options
author | Adrian Roos <roosa@google.com> | 2014-05-05 13:33:03 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-05-15 18:22:37 +0200 |
commit | ea56251d92050e9a672d1f66d0d4621e4dd4136e (patch) | |
tree | eb1bc2025ba63e64de7f422140e64c6045604e09 /services | |
parent | 217ccd2f82031f05d111bce7308a65136f278c7a (diff) | |
download | frameworks_base-ea56251d92050e9a672d1f66d0d4621e4dd4136e.zip frameworks_base-ea56251d92050e9a672d1f66d0d4621e4dd4136e.tar.gz frameworks_base-ea56251d92050e9a672d1f66d0d4621e4dd4136e.tar.bz2 |
Colorize SystemUI
Makes the color of the status and navigation bars customizable by
the app.
Bug: 14564488
Change-Id: I036edc228cfe1b659c7f11a43cdc4598ee705ff8
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 836a19c..b61ba5c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2806,18 +2806,10 @@ public class WindowManagerService extends IWindowManager.Stub boolean configChanged; boolean surfaceChanged = false; boolean animating; + boolean hasStatusBarPermission = + mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) + == PackageManager.PERMISSION_GRANTED; - // if they don't have this permission, mask out the status bar bits - int systemUiVisibility = 0; - if (attrs != null) { - systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); - if ((systemUiVisibility & StatusBarManager.DISABLE_MASK) != 0) { - if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) - != PackageManager.PERMISSION_GRANTED) { - systemUiVisibility &= ~StatusBarManager.DISABLE_MASK; - } - } - } long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { @@ -2832,14 +2824,26 @@ 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); } + // if they don't have the permission, mask out the status bar bits + int systemUiVisibility = 0; + if (attrs != null) { + systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); + if ((systemUiVisibility & StatusBarManager.DISABLE_MASK) != 0) { + if (!hasStatusBarPermission) { + systemUiVisibility &= ~StatusBarManager.DISABLE_MASK; + } + } + } + + if (attrs != null && seq == win.mSeq) { + win.mSystemUiVisibility = systemUiVisibility; + } + winAnimator.mSurfaceDestroyDeferred = (flags&WindowManagerGlobal.RELAYOUT_DEFER_SURFACE_DESTROY) != 0; |