Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ab5faa8 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Avoid putting a process with system dialog to cached state

There could be a non-persistent process showing a system dialog
(only platform signature permission INTERNAL_SYSTEM_WINDOW can use it).
With not excluding TYPE_SYSTEM_DIALOG
by onWindowSurfaceVisibilityChanged, it can utilize setHasOverlayUi
to keep the process in active state.

This doesn't change isSystemAlertWindowType because other places
may use it to handle permission checking.

Bug: 349049402
Flag: EXEMPT bugfix
Test: Create a test app with permission INTERNAL_SYSTEM_WINDOW and
      show a TYPE_SYSTEM_DIALOG window without any other components.
      `adb shell dumpsys activity lru` should not show the process
      with cached state.
Change-Id: I6cb8bad5afd5a1311210645f784dd4d3fdc22c23
parent 310f7b88
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import static android.content.Intent.EXTRA_TASK_ID;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG;
import static android.view.WindowManager.LayoutParams.isSystemAlertWindowType;

import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_IME;
@@ -765,7 +766,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {

    void onWindowSurfaceVisibilityChanged(WindowState window, boolean visible) {
        final int type = window.mAttrs.type;
        if (!isSystemAlertWindowType(type)) {
        if (!isSystemAlertWindowType(type) && type != TYPE_SYSTEM_DIALOG) {
            return;
        }