Replace ActivityRecord#mSetToSleep by canTurnScreenOn
The member ActivityRecord#mSetToSleep can be replaced by checking canTurnScreenOn & mCurrentLaunchCanTurnScreenOn. Before Task#goToSleep been called, the display will be set to sleeping in RootWindowContainer#applySleepTokens, so when checking ActivityRecord#shouldBeVisibleUnchecked while display is sleeping, we only need to perform an additional check whether this activity can turn screen on. This is because there are only two ways to apply sleep token, which are keyguard and screen state, and we have checked the keyguard visibility through KeyguardController#checkKeyguardVisibility. Test: atest ActivityVisibilityTests KeyguardTests KeyguardLockedTests KeyguardTransitionTests Test: atest ActivityRecordTests Bug: 163993448 Change-Id: I64cf04e3037ab9ca7afec9d1c8bf65d202a02e36
Loading
Please register or sign in to comment