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

Commit e8fdf351 authored by Alex Florescu's avatar Alex Florescu Committed by Android (Google) Code Review
Browse files

Merge "Revert "[Bouncer] refine entry for bouncer user switcher."" into tm-qpr-dev

parents 33b9c7f1 4da665d4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -260,8 +260,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
        if (reason != PROMPT_REASON_NONE) {
            int promtReasonStringRes = mView.getPromptReasonStringRes(reason);
            if (promtReasonStringRes != 0) {
                mMessageAreaController.setMessage(
                        mView.getResources().getString(promtReasonStringRes), false);
                mMessageAreaController.setMessage(promtReasonStringRes);
            }
        }
    }
+1 −3
Original line number Diff line number Diff line
@@ -143,9 +143,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>

    public void startAppearAnimation() {
        if (TextUtils.isEmpty(mMessageAreaController.getMessage())) {
            mMessageAreaController.setMessage(
                    mView.getResources().getString(getInitialMessageResId()),
                    /* animate= */ false);
            mMessageAreaController.setMessage(getInitialMessageResId());
        }
        mView.startAppearAnimation();
    }
+1 −2
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
    private int mYTransOffset;
    private View mBouncerMessageView;
    @DevicePostureInt private int mLastDevicePosture = DEVICE_POSTURE_UNKNOWN;
    public static final long ANIMATION_DURATION = 650;

    public KeyguardPINView(Context context) {
        this(context, null);
@@ -182,7 +181,7 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
        if (mAppearAnimator.isRunning()) {
            mAppearAnimator.cancel();
        }
        mAppearAnimator.setDuration(ANIMATION_DURATION);
        mAppearAnimator.setDuration(650);
        mAppearAnimator.addUpdateListener(animation -> animate(animation.getAnimatedFraction()));
        mAppearAnimator.start();
    }
+5 −20
Original line number Diff line number Diff line
@@ -36,11 +36,8 @@ import static com.android.systemui.plugins.FalsingManager.LOW_PENALTY;

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;
import android.app.AlertDialog;
import android.app.admin.DevicePolicyManager;
@@ -970,23 +967,11 @@ public class KeyguardSecurityContainer extends ConstraintLayout {
            }

            mUserSwitcherViewGroup.setAlpha(0f);
            ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f);
            int yTrans = mView.getResources().getDimensionPixelSize(R.dimen.pin_view_trans_y_entry);
            animator.setInterpolator(Interpolators.STANDARD_DECELERATE);
            animator.setDuration(650);
            animator.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mUserSwitcherViewGroup.setAlpha(1f);
                    mUserSwitcherViewGroup.setTranslationY(0f);
                }
            });
            animator.addUpdateListener(animation -> {
                float value = (float) animation.getAnimatedValue();
                mUserSwitcherViewGroup.setAlpha(value);
                mUserSwitcherViewGroup.setTranslationY(yTrans - yTrans * value);
            });
            animator.start();
            ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mUserSwitcherViewGroup, View.ALPHA,
                    1f);
            alphaAnim.setInterpolator(Interpolators.ALPHA_IN);
            alphaAnim.setDuration(500);
            alphaAnim.start();
        }

        @Override
+0 −20
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.keyguard;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
@@ -88,7 +87,6 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase {
        when(mAbsKeyInputView.isAttachedToWindow()).thenReturn(true);
        when(mAbsKeyInputView.requireViewById(R.id.bouncer_message_area))
                .thenReturn(mKeyguardMessageArea);
        when(mAbsKeyInputView.getResources()).thenReturn(getContext().getResources());
        mKeyguardAbsKeyInputViewController = new KeyguardAbsKeyInputViewController(mAbsKeyInputView,
                mKeyguardUpdateMonitor, mSecurityMode, mLockPatternUtils, mKeyguardSecurityCallback,
                mKeyguardMessageAreaControllerFactory, mLatencyTracker, mFalsingCollector,
@@ -127,22 +125,4 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase {
        verifyZeroInteractions(mKeyguardSecurityCallback);
        verifyZeroInteractions(mKeyguardMessageAreaController);
    }

    @Test
    public void onPromptReasonNone_doesNotSetMessage() {
        mKeyguardAbsKeyInputViewController.showPromptReason(0);
        verify(mKeyguardMessageAreaController, never()).setMessage(
                getContext().getResources().getString(R.string.kg_prompt_reason_restart_password),
                false);
    }

    @Test
    public void onPromptReason_setsMessage() {
        when(mAbsKeyInputView.getPromptReasonStringRes(1)).thenReturn(
                R.string.kg_prompt_reason_restart_password);
        mKeyguardAbsKeyInputViewController.showPromptReason(1);
        verify(mKeyguardMessageAreaController).setMessage(
                getContext().getResources().getString(R.string.kg_prompt_reason_restart_password),
                false);
    }
}
Loading