Skip to content

Commit 00174d4

Browse files
wilsonshihmuhomorr
authored andcommitted
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. Merged-In: Id4db3772950059803883d00f9dd6b94aa98382f0 Change-Id: Id4db3772950059803883d00f9dd6b94aa98382f0
1 parent 8aa30f6 commit 00174d4

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

core/java/android/window/flags/windowing_frontend.aconfig

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,6 @@ flag {
447447
}
448448
}
449449

450-
flag {
451-
name: "keep_app_window_hide_while_locked"
452-
namespace: "windowing_frontend"
453-
description: "Do not let app window visible while device is locked"
454-
is_fixed_read_only: true
455-
bug: "378088391"
456-
metadata {
457-
purpose: PURPOSE_BUGFIX
458-
}
459-
}
460-
461450
flag {
462451
name: "use_rt_frame_callback_for_splash_screen_transfer"
463452
namespace: "windowing_frontend"
@@ -564,4 +553,4 @@ flag {
564553
namespace: "lse_desktop_experience"
565554
description: "Adds support for trackpad back gestures on connected displays"
566555
bug: "382774299"
567-
}
556+
}

services/core/java/com/android/server/wm/ActivityRecord.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2708,7 +2708,8 @@ void associateStartingWindowWithTaskIfNeeded() {
27082708
* This prevents briefly appearing the app context and causing secure concern.
27092709
*/
27102710
void deferStartingWindowRemovalForKeyguardUnoccluding() {
2711-
if (mStartingData.mRemoveAfterTransaction != AFTER_TRANSITION_FINISH
2711+
if (mStartingData != null
2712+
&& mStartingData.mRemoveAfterTransaction != AFTER_TRANSITION_FINISH
27122713
&& isKeyguardLocked() && !canShowWhenLockedInner(this) && !isVisibleRequested()
27132714
&& mTransitionController.inTransition(this)) {
27142715
mStartingData.mRemoveAfterTransaction = AFTER_TRANSITION_FINISH;

services/core/java/com/android/server/wm/WindowState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,7 @@ void adjustStartingWindowFlags() {
27742774
final boolean wasShowWhenLocked = (sa.flags & FLAG_SHOW_WHEN_LOCKED) != 0;
27752775
final boolean removeShowWhenLocked = (mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) == 0;
27762776
sa.flags = (sa.flags & ~mask) | (mAttrs.flags & mask);
2777-
if (Flags.keepAppWindowHideWhileLocked() && wasShowWhenLocked && removeShowWhenLocked) {
2777+
if (wasShowWhenLocked && removeShowWhenLocked) {
27782778
// Trigger unoccluding animation if needed.
27792779
mActivityRecord.checkKeyguardFlagsChanged();
27802780
mActivityRecord.deferStartingWindowRemovalForKeyguardUnoccluding();

0 commit comments

Comments
 (0)