Loading services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,7 @@ class ActivityStarter { } } else { if (!mAvoidMoveToFront && mDoResume && mRootWindowContainer.hasVisibleWindowAboveNotificationShade( && mRootWindowContainer.hasVisibleWindowAboveButDoesNotOwnNotificationShade( r.launchedFromUid)) { // If the UID launching the activity has a visible window on top of the // notification shade and it's launching an activity that's going to be at the Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -2962,7 +2962,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // startActivity() for these apps. if (!CompatChanges.isChangeEnabled(LOCK_DOWN_CLOSE_SYSTEM_DIALOGS, uid)) { synchronized (mGlobalLock) { if (mRootWindowContainer.hasVisibleWindowAboveNotificationShade(uid)) { // It's ok that the owner of the shade is not allowed *per this rule* because it has // BROADCAST_CLOSE_SYSTEM_DIALOGS (SystemUI), so it would fall into that rule. if (mRootWindowContainer.hasVisibleWindowAboveButDoesNotOwnNotificationShade(uid)) { return true; } } Loading services/core/java/com/android/server/wm/RootWindowContainer.java +8 −5 Original line number Diff line number Diff line Loading @@ -3127,11 +3127,14 @@ class RootWindowContainer extends WindowContainer<DisplayContent> } /** * Returns {@code true} if {@code uid} has a visible window that's above a window of type {@link * WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}. If there is no window with type {@link * WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}, it returns {@code false}. * Returns {@code true} if {@code uid} has a visible window that's above the window of type * {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE} and {@code uid} is not owner of * the window of type {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}. * * If there is no window with type {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}, * it returns {@code false}. */ boolean hasVisibleWindowAboveNotificationShade(int uid) { boolean hasVisibleWindowAboveButDoesNotOwnNotificationShade(int uid) { boolean[] visibleWindowFound = {false}; // We only return true if we found the notification shade (ie. window of type // TYPE_NOTIFICATION_SHADE). Usually, it should always be there, but if for some reason Loading @@ -3141,7 +3144,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> visibleWindowFound[0] = true; } if (w.mAttrs.type == TYPE_NOTIFICATION_SHADE) { return visibleWindowFound[0]; return visibleWindowFound[0] && w.mOwnerUid != uid; } return false; }, true /* traverseTopToBottom */); Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,7 @@ class ActivityStarter { } } else { if (!mAvoidMoveToFront && mDoResume && mRootWindowContainer.hasVisibleWindowAboveNotificationShade( && mRootWindowContainer.hasVisibleWindowAboveButDoesNotOwnNotificationShade( r.launchedFromUid)) { // If the UID launching the activity has a visible window on top of the // notification shade and it's launching an activity that's going to be at the Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -2962,7 +2962,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // startActivity() for these apps. if (!CompatChanges.isChangeEnabled(LOCK_DOWN_CLOSE_SYSTEM_DIALOGS, uid)) { synchronized (mGlobalLock) { if (mRootWindowContainer.hasVisibleWindowAboveNotificationShade(uid)) { // It's ok that the owner of the shade is not allowed *per this rule* because it has // BROADCAST_CLOSE_SYSTEM_DIALOGS (SystemUI), so it would fall into that rule. if (mRootWindowContainer.hasVisibleWindowAboveButDoesNotOwnNotificationShade(uid)) { return true; } } Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +8 −5 Original line number Diff line number Diff line Loading @@ -3127,11 +3127,14 @@ class RootWindowContainer extends WindowContainer<DisplayContent> } /** * Returns {@code true} if {@code uid} has a visible window that's above a window of type {@link * WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}. If there is no window with type {@link * WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}, it returns {@code false}. * Returns {@code true} if {@code uid} has a visible window that's above the window of type * {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE} and {@code uid} is not owner of * the window of type {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}. * * If there is no window with type {@link WindowManager.LayoutParams#TYPE_NOTIFICATION_SHADE}, * it returns {@code false}. */ boolean hasVisibleWindowAboveNotificationShade(int uid) { boolean hasVisibleWindowAboveButDoesNotOwnNotificationShade(int uid) { boolean[] visibleWindowFound = {false}; // We only return true if we found the notification shade (ie. window of type // TYPE_NOTIFICATION_SHADE). Usually, it should always be there, but if for some reason Loading @@ -3141,7 +3144,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> visibleWindowFound[0] = true; } if (w.mAttrs.type == TYPE_NOTIFICATION_SHADE) { return visibleWindowFound[0]; return visibleWindowFound[0] && w.mOwnerUid != uid; } return false; }, true /* traverseTopToBottom */); Loading