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

Commit d980e51c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Sync client visibility if activity is stopped

While activity resumed and stopped without transition, there may
not have an animation callback to commit client visibility.
Though the main window of activity can be updated according to
activity lifecycle callback, if there are other windows attached
to the activity, those windows may keep in visible state.

Bug: 193125596
Test: 1. Enable secured lock.
      2. Launch an activity with attaching another window.
      3. Lock device and launch a show-when-locked activity.
      4. Finish the show-when-locked activity.
      5. Check all windows of the current top activity should
         be invisible by command "adb shell dumpsys window w".
      6. There should be no delay when turning off/on display
         "Timeout waiting for drawn".
Change-Id: Ib48b0509c328567302318689c565191cac8019b1
parent 395c582b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5016,6 +5016,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Reset the last saved PiP snap fraction on app stop.
        mDisplayContent.mPinnedTaskController.onActivityHidden(mActivityComponent);
        mDisplayContent.mUnknownAppVisibilityController.appRemovedOrHidden(this);
        if (isClientVisible()) {
            // Though this is usually unlikely to happen, still make sure the client is invisible.
            setClientVisible(false);
        }
        destroySurfaces();
        // Remove any starting window that was added for this app if they are still around.
        removeStartingWindow();