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

Skip to content
Commit 5e6c273c authored by wilsonshih's avatar wilsonshih Committed by Issei Suzuki
Browse files

Prevent the occlusion state mismatch between WM and SystemUI.

The mismatch condition could happen due to the race condition from
keyguard unlock animation and the execute of AppTransition.

Pre-condition: keyguard is locked and showing a showWhenLocked activity
on top of device, while starting another activity B without
showWhenLocked. The issue sequence is:

1. Start Activity B and it is no occluded, update
PWM#onKeyguardOccludedChangedLw(occluded = false), because keyguard is
showing so set mKeyguardOccludedChanged to true.
2. Because device was occluded, there will attach showWhenLocked flag
to the starting window of Activity B, when this starting window added
to WM, the occluded state chage to true and overwrite the
mPendingKeyguardOccluded again.
3. Keyguard unlock animation finish, WM receive keyguard showing become
false.
4. Starting window removed so occluded state change to false, because
the keyguard is hidden, PWM will update the occluded value to SystemUI
directly.
5. App Transition start, PWM#applyKeyguardOcclusionChange with the
mPendingKeyguardOccluded value, which was true, thus the occluded state
become mismatch.
If the timing between 3, 4, 5 has slightly change, then this issue won't
happen.
Anyway, an easy fix is to ensure the updated value on PWM should
always be the latest value from KeyguardController.

Bug: 201328381
Test: atest KeyguardTests KeyguardTransitionTests KeyguardLockedTests
Change-Id: I69e9cbb6238a19cf75ac0c9cb16adb2310399876
parent a9573379
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment