diff options
author | Aaron Liu <aaronjli@google.com> | 2023-04-04 15:35:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-04-04 15:35:19 +0000 |
commit | 5ba925133ce6c187bbe71287a0e3d13fb84df79f (patch) | |
tree | 3f421791939b92a22fabd63e7ca3c3d4fa032197 /packages/SystemUI/src/com/android/systemui | |
parent | 858aafe3774b7cdea5fb463cef3d3ddf03f11622 (diff) | |
parent | 30651ca3af98ba3e0917e97c61a032671b0072fb (diff) | |
download | base-5ba925133ce6c187bbe71287a0e3d13fb84df79f.tar.gz |
Merge changes I5a5714fc,Ib45034ea,I9e4bc66d,Ie341c5d8,I1f40e8b7 into udc-dev
* changes:
Release PREVENT_BYPASS_KEYGUARD flag
Release ASYNC_BOUNCER flag
Ensure that bouncer resume propagates a...
Fix KeyguardSecurityContainerControllerTest
Ensure that flow is run on main dispatcher
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
4 files changed, 12 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index 2660acfeb584..60d816d0e899 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -219,12 +219,12 @@ object Flags { /** Whether to inflate the bouncer view on a background thread. */ // TODO(b/272091103): Tracking Bug @JvmField - val ASYNC_INFLATE_BOUNCER = unreleasedFlag(229, "async_inflate_bouncer", teamfood = true) + val ASYNC_INFLATE_BOUNCER = releasedFlag(229, "async_inflate_bouncer") /** Whether to inflate the bouncer view on a background thread. */ // TODO(b/273341787): Tracking Bug @JvmField - val PREVENT_BYPASS_KEYGUARD = unreleasedFlag(230, "prevent_bypass_keyguard", teamfood = true) + val PREVENT_BYPASS_KEYGUARD = releasedFlag(230, "prevent_bypass_keyguard") /** Whether to use a new data source for intents to run on keyguard dismissal. */ @JvmField diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt index 76f20d25b0ec..6bc9837e8751 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt @@ -25,6 +25,7 @@ import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLoggin import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.common.shared.model.Position import com.android.systemui.dagger.SysUISingleton +import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.doze.DozeHost import com.android.systemui.doze.DozeMachine import com.android.systemui.doze.DozeTransitionCallback @@ -43,12 +44,14 @@ import com.android.systemui.statusbar.phone.BiometricUnlockController.WakeAndUnl import com.android.systemui.statusbar.phone.DozeParameters import com.android.systemui.statusbar.policy.KeyguardStateController import javax.inject.Inject +import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.flowOn /** Defines interface for classes that encapsulate application state for the keyguard. */ interface KeyguardRepository { @@ -195,6 +198,7 @@ constructor( private val dozeParameters: DozeParameters, private val authController: AuthController, private val dreamOverlayCallbackController: DreamOverlayCallbackController, + @Main private val mainDispatcher: CoroutineDispatcher ) : KeyguardRepository { private val _animateBottomAreaDozingTransitions = MutableStateFlow(false) override val animateBottomAreaDozingTransitions = @@ -387,6 +391,7 @@ constructor( awaitClose { keyguardUpdateMonitor.removeCallback(callback) } } + .flowOn(mainDispatcher) .distinctUntilChanged() override val linearDozeAmount: Flow<Float> = conflatedCallbackFlow { diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt index 9212aa1c8ef5..970d00403f28 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt @@ -142,22 +142,18 @@ constructor( (isBouncerShowing() || repository.primaryBouncerShowingSoon.value) && needsFullscreenBouncer() - if (!resumeBouncer && isBouncerShowing()) { - // If bouncer is visible, the bouncer is already showing. - return - } - Trace.beginSection("KeyguardBouncer#show") repository.setPrimaryScrimmed(isScrimmed) if (isScrimmed) { setPanelExpansion(KeyguardBouncerConstants.EXPANSION_VISIBLE) } + // In this special case, we want to hide the bouncer and show it again. We want to emit + // show(true) again so that we can reinflate the new view. if (resumeBouncer) { - primaryBouncerView.delegate?.resume() - // Bouncer is showing the next security screen and we just need to prompt a resume. - return + repository.setPrimaryShow(false) } + if (primaryBouncerView.delegate?.showNextSecurityScreenOrFinish() == true) { // Keyguard is done. return diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt index 172f9226f252..72dc7a4f7753 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt @@ -113,6 +113,7 @@ object KeyguardBouncerViewBinder { view.visibility = if (isShowing) View.VISIBLE else View.INVISIBLE if (isShowing) { // Reset Security Container entirely. + view.visibility = View.VISIBLE securityContainerController.reinflateViewFlipper { // Reset Security Container entirely. securityContainerController.onBouncerVisibilityChanged( |