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

Commit 8874f3ea authored by wilsonshih's avatar wilsonshih Committed by Android Build Coastguard Worker
Browse files

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
parent 99b01a65
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -447,17 +447,6 @@ flag {
    }
}

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"
+2 −1
Original line number Diff line number Diff line
@@ -2707,7 +2707,8 @@ final class ActivityRecord extends WindowToken {
     * 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;
+1 −1
Original line number Diff line number Diff line
@@ -2774,7 +2774,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            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();