diff options
author | Craig Mautner <cmautner@google.com> | 2012-10-16 19:01:35 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-16 19:01:35 -0700 |
commit | aa2804aa2bf1a2c89af947501549361945ffac3f (patch) | |
tree | 8b978e439a6558d5eb34dd593b19d075e67eab42 | |
parent | 9dff9125074bfd1a4ead4ba995fd830b9a121263 (diff) | |
parent | e13ae648504661ca158d15aa415568e351b380c4 (diff) | |
download | frameworks_base-aa2804aa2bf1a2c89af947501549361945ffac3f.zip frameworks_base-aa2804aa2bf1a2c89af947501549361945ffac3f.tar.gz frameworks_base-aa2804aa2bf1a2c89af947501549361945ffac3f.tar.bz2 |
am e13ae648: Merge "Use parent window to evaluate show-to-all-users." into jb-mr1-dev
* commit 'e13ae648504661ca158d15aa415568e351b380c4':
Use parent window to evaluate show-to-all-users.
-rw-r--r-- | services/java/com/android/server/wm/WindowState.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index feb29b1..c195f45 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -1038,18 +1038,26 @@ final class WindowState implements WindowManagerPolicy.WindowState { } boolean isHiddenFromUserLocked() { - // Save some cycles by not calling getDisplayInfo unless it is an application - // window intended for all users. - if (mAttrs.type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW - && mAppToken != null && mAppToken.showWhenLocked) { - final DisplayInfo displayInfo = mDisplayContent.getDisplayInfo(); - if (isFullscreen(displayInfo.appWidth, displayInfo.appHeight)) { + // Attached windows are evaluated based on the window that they are attached to. + WindowState win = this; + while (win.mAttachedWindow != null) { + win = win.mAttachedWindow; + } + if (win.mAttrs.type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW + && win.mAppToken != null && win.mAppToken.showWhenLocked) { + // Save some cycles by not calling getDisplayInfo unless it is an application + // window intended for all users. + final DisplayInfo displayInfo = win.mDisplayContent.getDisplayInfo(); + if (win.mFrame.left <= 0 && win.mFrame.top <= 0 + && win.mFrame.right >= displayInfo.appWidth + && win.mFrame.bottom >= displayInfo.appHeight) { // Is a fullscreen window, like the clock alarm. Show to everyone. return false; } } - return mShowToOwnerOnly && UserHandle.getUserId(mOwnerUid) != mService.mCurrentUserId; + return win.mShowToOwnerOnly + && UserHandle.getUserId(win.mOwnerUid) != mService.mCurrentUserId; } private static void applyInsets(Region outRegion, Rect frame, Rect inset) { |