Loading packages/SystemUI/res-keyguard/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ <!-- The vertical margin between the date and the owner info. --> <!-- The translation for disappearing security views after having solved them. --> <dimen name="disappear_y_translation">-32dp</dimen> <dimen name="disappear_y_translation">-50dp</dimen> <!-- Dimens for animation for the Bouncer PIN view --> <dimen name="pin_view_trans_y_entry">120dp</dimen> Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +3 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import static java.lang.Integer.max; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.app.Activity; Loading Loading @@ -1044,13 +1043,10 @@ public class KeyguardSecurityContainer extends ConstraintLayout { int yTranslation = mResources.getDimensionPixelSize(R.dimen.disappear_y_translation); AnimatorSet anims = new AnimatorSet(); ObjectAnimator yAnim = ObjectAnimator.ofFloat(mView, View.TRANSLATION_Y, yTranslation); ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mView, View.ALPHA, 0f); anims.setInterpolator(Interpolators.STANDARD_ACCELERATE); anims.playTogether(alphaAnim, yAnim); anims.start(); yAnim.setInterpolator(Interpolators.STANDARD_ACCELERATE); yAnim.setDuration(500); yAnim.start(); } private void setupUserSwitcher() { Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +6 −1 Original line number Diff line number Diff line Loading @@ -636,12 +636,17 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard public void startAppearAnimation() { if (mCurrentSecurityMode != SecurityMode.None) { mView.setAlpha(1f); setAlpha(1f); mView.startAppearAnimation(mCurrentSecurityMode); getCurrentSecurityController().startAppearAnimation(); } } /** Set the alpha of the security container view */ public void setAlpha(float alpha) { mView.setAlpha(alpha); } public boolean startDisappearAnimation(Runnable onFinishRunnable) { boolean didRunAnimation = false; Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +28 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ interface KeyguardRepository { */ val isKeyguardShowing: Flow<Boolean> /** Is the keyguard in a unlocked state? */ val isKeyguardUnlocked: Flow<Boolean> /** Is an activity showing over the keyguard? */ val isKeyguardOccluded: Flow<Boolean> Loading Loading @@ -278,6 +281,31 @@ constructor( } .distinctUntilChanged() override val isKeyguardUnlocked: Flow<Boolean> = conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { override fun onUnlockedChanged() { trySendWithFailureLogging( keyguardStateController.isUnlocked, TAG, "updated isKeyguardUnlocked" ) } } keyguardStateController.addCallback(callback) // Adding the callback does not send an initial update. trySendWithFailureLogging( keyguardStateController.isUnlocked, TAG, "initial isKeyguardUnlocked" ) awaitClose { keyguardStateController.removeCallback(callback) } } .distinctUntilChanged() override val isKeyguardGoingAway: Flow<Boolean> = conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt +18 −8 Original line number Diff line number Diff line Loading @@ -68,8 +68,11 @@ interface KeyguardTransitionRepository { /** * Begin a transition from one state to another. Transitions are interruptible, and will issue a * [TransitionStep] with state = [TransitionState.CANCELED] before beginning the next one. * * When canceled, there are two options: to continue from the current position of the prior * transition, or to reset the position. When [resetIfCanceled] == true, it will do the latter. */ fun startTransition(info: TransitionInfo): UUID? fun startTransition(info: TransitionInfo, resetIfCanceled: Boolean = false): UUID? /** * Allows manual control of a transition. When calling [startTransition], the consumer must pass Loading Loading @@ -130,7 +133,10 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio ) } override fun startTransition(info: TransitionInfo): UUID? { override fun startTransition( info: TransitionInfo, resetIfCanceled: Boolean, ): UUID? { if (lastStep.from == info.from && lastStep.to == info.to) { Log.i(TAG, "Duplicate call to start the transition, rejecting: $info") return null Loading @@ -138,7 +144,11 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio val startingValue = if (lastStep.transitionState != TransitionState.FINISHED) { Log.i(TAG, "Transition still active: $lastStep, canceling") if (resetIfCanceled) { 0f } else { lastStep.value } } else { 0f } Loading Loading @@ -227,10 +237,7 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio } private fun trace(step: TransitionStep, isManual: Boolean) { if ( step.transitionState != TransitionState.STARTED && step.transitionState != TransitionState.FINISHED ) { if (step.transitionState == TransitionState.RUNNING) { return } val traceName = Loading @@ -243,7 +250,10 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio val traceCookie = traceName.hashCode() if (step.transitionState == TransitionState.STARTED) { Trace.beginAsyncSection(traceName, traceCookie) } else if (step.transitionState == TransitionState.FINISHED) { } else if ( step.transitionState == TransitionState.FINISHED || step.transitionState == TransitionState.CANCELED ) { Trace.endAsyncSection(traceName, traceCookie) } } Loading Loading
packages/SystemUI/res-keyguard/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ <!-- The vertical margin between the date and the owner info. --> <!-- The translation for disappearing security views after having solved them. --> <dimen name="disappear_y_translation">-32dp</dimen> <dimen name="disappear_y_translation">-50dp</dimen> <!-- Dimens for animation for the Bouncer PIN view --> <dimen name="pin_view_trans_y_entry">120dp</dimen> Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +3 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import static java.lang.Integer.max; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.app.Activity; Loading Loading @@ -1044,13 +1043,10 @@ public class KeyguardSecurityContainer extends ConstraintLayout { int yTranslation = mResources.getDimensionPixelSize(R.dimen.disappear_y_translation); AnimatorSet anims = new AnimatorSet(); ObjectAnimator yAnim = ObjectAnimator.ofFloat(mView, View.TRANSLATION_Y, yTranslation); ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mView, View.ALPHA, 0f); anims.setInterpolator(Interpolators.STANDARD_ACCELERATE); anims.playTogether(alphaAnim, yAnim); anims.start(); yAnim.setInterpolator(Interpolators.STANDARD_ACCELERATE); yAnim.setDuration(500); yAnim.start(); } private void setupUserSwitcher() { Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +6 −1 Original line number Diff line number Diff line Loading @@ -636,12 +636,17 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard public void startAppearAnimation() { if (mCurrentSecurityMode != SecurityMode.None) { mView.setAlpha(1f); setAlpha(1f); mView.startAppearAnimation(mCurrentSecurityMode); getCurrentSecurityController().startAppearAnimation(); } } /** Set the alpha of the security container view */ public void setAlpha(float alpha) { mView.setAlpha(alpha); } public boolean startDisappearAnimation(Runnable onFinishRunnable) { boolean didRunAnimation = false; Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +28 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ interface KeyguardRepository { */ val isKeyguardShowing: Flow<Boolean> /** Is the keyguard in a unlocked state? */ val isKeyguardUnlocked: Flow<Boolean> /** Is an activity showing over the keyguard? */ val isKeyguardOccluded: Flow<Boolean> Loading Loading @@ -278,6 +281,31 @@ constructor( } .distinctUntilChanged() override val isKeyguardUnlocked: Flow<Boolean> = conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { override fun onUnlockedChanged() { trySendWithFailureLogging( keyguardStateController.isUnlocked, TAG, "updated isKeyguardUnlocked" ) } } keyguardStateController.addCallback(callback) // Adding the callback does not send an initial update. trySendWithFailureLogging( keyguardStateController.isUnlocked, TAG, "initial isKeyguardUnlocked" ) awaitClose { keyguardStateController.removeCallback(callback) } } .distinctUntilChanged() override val isKeyguardGoingAway: Flow<Boolean> = conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt +18 −8 Original line number Diff line number Diff line Loading @@ -68,8 +68,11 @@ interface KeyguardTransitionRepository { /** * Begin a transition from one state to another. Transitions are interruptible, and will issue a * [TransitionStep] with state = [TransitionState.CANCELED] before beginning the next one. * * When canceled, there are two options: to continue from the current position of the prior * transition, or to reset the position. When [resetIfCanceled] == true, it will do the latter. */ fun startTransition(info: TransitionInfo): UUID? fun startTransition(info: TransitionInfo, resetIfCanceled: Boolean = false): UUID? /** * Allows manual control of a transition. When calling [startTransition], the consumer must pass Loading Loading @@ -130,7 +133,10 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio ) } override fun startTransition(info: TransitionInfo): UUID? { override fun startTransition( info: TransitionInfo, resetIfCanceled: Boolean, ): UUID? { if (lastStep.from == info.from && lastStep.to == info.to) { Log.i(TAG, "Duplicate call to start the transition, rejecting: $info") return null Loading @@ -138,7 +144,11 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio val startingValue = if (lastStep.transitionState != TransitionState.FINISHED) { Log.i(TAG, "Transition still active: $lastStep, canceling") if (resetIfCanceled) { 0f } else { lastStep.value } } else { 0f } Loading Loading @@ -227,10 +237,7 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio } private fun trace(step: TransitionStep, isManual: Boolean) { if ( step.transitionState != TransitionState.STARTED && step.transitionState != TransitionState.FINISHED ) { if (step.transitionState == TransitionState.RUNNING) { return } val traceName = Loading @@ -243,7 +250,10 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio val traceCookie = traceName.hashCode() if (step.transitionState == TransitionState.STARTED) { Trace.beginAsyncSection(traceName, traceCookie) } else if (step.transitionState == TransitionState.FINISHED) { } else if ( step.transitionState == TransitionState.FINISHED || step.transitionState == TransitionState.CANCELED ) { Trace.endAsyncSection(traceName, traceCookie) } } Loading