Defer remove splash screen while device is locked ...and activity does not request showWhenLocked. The splash screen won't contains secure information, so it's safe to declared as showWhenLocked. But before remove starting window, if the activity does not request showWhenLocked and device is locked, try to trigger unoccluding animation, and keep app window hide until transition animation finish. Bug: 378088391 Bug: 383131643 Test: run simulate app repeatly, verify the app content won't be visible during transition animation. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:17d7a10aa573a74d829fd05c8848b0ac8e40be8a) Merged-In: Id4db3772950059803883d00f9dd6b94aa98382f0 Change-Id: Id4db3772950059803883d00f9dd6b94aa98382f0
diff --git a/core/java/android/window/flags/windowing_frontend.aconfig b/core/java/android/window/flags/windowing_frontend.aconfig index 99f9929..bdcd7e5 100644 --- a/core/java/android/window/flags/windowing_frontend.aconfig +++ b/core/java/android/window/flags/windowing_frontend.aconfig
@@ -448,17 +448,6 @@ } flag { - name: "keep_app_window_hide_while_locked" - namespace: "windowing_frontend" - description: "Do not let app window visible while device is locked" - is_fixed_read_only: true - bug: "378088391" - metadata { - purpose: PURPOSE_BUGFIX - } -} - -flag { name: "use_rt_frame_callback_for_splash_screen_transfer" namespace: "windowing_frontend" description: "report SplashscreenView shown after RtFrame commit" @@ -564,4 +553,4 @@ namespace: "lse_desktop_experience" description: "Adds support for trackpad back gestures on connected displays" bug: "382774299" -} \ No newline at end of file +}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 78100b7..5ce6dd0 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2707,7 +2707,8 @@ * This prevents briefly appearing the app context and causing secure concern. */ void deferStartingWindowRemovalForKeyguardUnoccluding() { - if (mStartingData.mRemoveAfterTransaction != AFTER_TRANSITION_FINISH + if (mStartingData != null + && mStartingData.mRemoveAfterTransaction != AFTER_TRANSITION_FINISH && isKeyguardLocked() && !canShowWhenLockedInner(this) && !isVisibleRequested() && mTransitionController.inTransition(this)) { mStartingData.mRemoveAfterTransaction = AFTER_TRANSITION_FINISH;
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 93876f5..05b81d4 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -2774,7 +2774,7 @@ final boolean wasShowWhenLocked = (sa.flags & FLAG_SHOW_WHEN_LOCKED) != 0; final boolean removeShowWhenLocked = (mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) == 0; sa.flags = (sa.flags & ~mask) | (mAttrs.flags & mask); - if (Flags.keepAppWindowHideWhileLocked() && wasShowWhenLocked && removeShowWhenLocked) { + if (wasShowWhenLocked && removeShowWhenLocked) { // Trigger unoccluding animation if needed. mActivityRecord.checkKeyguardFlagsChanged(); mActivityRecord.deferStartingWindowRemovalForKeyguardUnoccluding();