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

Commit 87210001 authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am 2f35f155: am 6cd8d30d: am a353528c: Merge "Added a message to the keyguard bouncer" into mnc-dev

* commit '2f35f155':
  Added a message to the keyguard bouncer
parents 15cafc8d 2f35f155
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -216,6 +216,19 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
        return mCallback;
    }

    @Override
    public void showPromptReason(int reason) {
        if (reason != PROMPT_REASON_NONE) {
            int promtReasonStringRes = getPromtReasonStringRes(reason);
            if (promtReasonStringRes != 0) {
                mSecurityMessageDisplay.setMessage(promtReasonStringRes,
                        true /* important */);
            }
        }
    }

    protected abstract int getPromtReasonStringRes(int reason);

    // Cause a VIRTUAL_KEY vibration
    public void doHapticKeyClick() {
        if (mEnableHaptics) {
+11 −0
Original line number Diff line number Diff line
@@ -159,6 +159,17 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
        mSecurityContainer.showPrimarySecurityScreen(false);
    }

    /**
     * Show a string explaining why the security view needs to be solved.
     *
     * @param reason a flag indicating which string should be shown, see
     *               {@link KeyguardSecurityView#PROMPT_REASON_NONE}
     *               and {@link KeyguardSecurityView#PROMPT_REASON_RESTART}
     */
    public void showPromptReason(int reason) {
        mSecurityContainer.showPromptReason(reason);
    }

    /**
     *  Dismisses the keyguard by going to the next screen or making it gone.
     *
+10 −0
Original line number Diff line number Diff line
@@ -110,6 +110,16 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
        });
    }

    @Override
    protected int getPromtReasonStringRes(int reason) {
        switch (reason) {
            case PROMPT_REASON_RESTART:
                return R.string.kg_prompt_reason_restart_password;
            default:
                return 0;
        }
    }

    @Override
    public void onPause() {
        super.onPause();
+18 −8
Original line number Diff line number Diff line
@@ -85,10 +85,9 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        }
    };
    private Rect mTempRect = new Rect();
    private SecurityMessageDisplay mSecurityMessageDisplay;
    private KeyguardMessageArea mSecurityMessageDisplay;
    private View mEcaView;
    private ViewGroup mContainer;
    private KeyguardMessageArea mHelpMessage;
    private int mDisappearYTranslation;

    enum FooterMode {
@@ -141,10 +140,10 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        // vibrate mode will be the same for the life of this screen
        mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());

        mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this);
        mSecurityMessageDisplay =
                (KeyguardMessageArea) KeyguardMessageArea.findSecurityMessageDisplay(this);
        mEcaView = findViewById(R.id.keyguard_selector_fade_container);
        mContainer = (ViewGroup) findViewById(R.id.container);
        mHelpMessage = (KeyguardMessageArea) findViewById(R.id.keyguard_message_area);

        EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
        if (button != null) {
@@ -319,6 +318,17 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        return mCallback;
    }

    @Override
    public void showPromptReason(int reason) {
        switch (reason) {
            case PROMPT_REASON_RESTART:
                mSecurityMessageDisplay.setMessage(R.string.kg_prompt_reason_restart_pattern,
                        true /* important */);
                break;
            default:
        }
    }

    @Override
    public void startAppearAnimation() {
        enableClipping(false);
@@ -337,8 +347,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
                    }
                },
                this);
        if (!TextUtils.isEmpty(mHelpMessage.getText())) {
            mAppearAnimationUtils.createAnimation(mHelpMessage, 0,
        if (!TextUtils.isEmpty(mSecurityMessageDisplay.getText())) {
            mAppearAnimationUtils.createAnimation(mSecurityMessageDisplay, 0,
                    AppearAnimationUtils.DEFAULT_APPEAR_DURATION,
                    mAppearAnimationUtils.getStartTranslation(),
                    true /* appearing */,
@@ -366,8 +376,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
                        }
                    }
                }, KeyguardPatternView.this);
        if (!TextUtils.isEmpty(mHelpMessage.getText())) {
            mDisappearAnimationUtils.createAnimation(mHelpMessage, 0,
        if (!TextUtils.isEmpty(mSecurityMessageDisplay.getText())) {
            mDisappearAnimationUtils.createAnimation(mSecurityMessageDisplay, 0,
                    200,
                    - mDisappearAnimationUtils.getStartTranslation() * 3,
                    false /* appearing */,
+10 −0
Original line number Diff line number Diff line
@@ -93,6 +93,16 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
        return super.onKeyDown(keyCode, event);
    }

    @Override
    protected int getPromtReasonStringRes(int reason) {
        switch (reason) {
            case PROMPT_REASON_RESTART:
                return R.string.kg_prompt_reason_restart_pin;
            default:
                return 0;
        }
    }

    private void performClick(View view) {
        view.performClick();
    }
Loading