@@ -1038,18 +1038,26 @@ public void setShowToOwnerOnlyLocked(boolean showToOwnerOnly) {
10381038 }
10391039
10401040 boolean isHiddenFromUserLocked () {
1041- // Save some cycles by not calling getDisplayInfo unless it is an application
1042- // window intended for all users.
1043- if (mAttrs .type < WindowManager .LayoutParams .FIRST_SYSTEM_WINDOW
1044- && mAppToken != null && mAppToken .showWhenLocked ) {
1045- final DisplayInfo displayInfo = mDisplayContent .getDisplayInfo ();
1046- if (isFullscreen (displayInfo .appWidth , displayInfo .appHeight )) {
1041+ // Attached windows are evaluated based on the window that they are attached to.
1042+ WindowState win = this ;
1043+ while (win .mAttachedWindow != null ) {
1044+ win = win .mAttachedWindow ;
1045+ }
1046+ if (win .mAttrs .type < WindowManager .LayoutParams .FIRST_SYSTEM_WINDOW
1047+ && win .mAppToken != null && win .mAppToken .showWhenLocked ) {
1048+ // Save some cycles by not calling getDisplayInfo unless it is an application
1049+ // window intended for all users.
1050+ final DisplayInfo displayInfo = win .mDisplayContent .getDisplayInfo ();
1051+ if (win .mFrame .left <= 0 && win .mFrame .top <= 0
1052+ && win .mFrame .right >= displayInfo .appWidth
1053+ && win .mFrame .bottom >= displayInfo .appHeight ) {
10471054 // Is a fullscreen window, like the clock alarm. Show to everyone.
10481055 return false ;
10491056 }
10501057 }
10511058
1052- return mShowToOwnerOnly && UserHandle .getUserId (mOwnerUid ) != mService .mCurrentUserId ;
1059+ return win .mShowToOwnerOnly
1060+ && UserHandle .getUserId (win .mOwnerUid ) != mService .mCurrentUserId ;
10531061 }
10541062
10551063 private static void applyInsets (Region outRegion , Rect frame , Rect inset ) {
0 commit comments