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

Commit 9a4877d3 authored by Haining Chen's avatar Haining Chen
Browse files

Add a bouncer string for adaptive auth

Flag: ACONFIG android.adaptiveauth.enable_adaptive_auth DEVELOPMENT
Bug: 285053096
Test: 1. Trigger 5 failed biometric attempts and/or primary auth
         attempts from BiometricPrompt or Settings (not on Keyguard),
         which will lock the device out
      2. See bouncer message
Test: atest KeyguardViewMediatorTest
Change-Id: Ie6140a866bd77020734f7c868d0b2a470a904683
parent 357f2d85
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1416,6 +1416,9 @@
    <!-- Indication on the keyguard that appears when a trust agents unlocks the device. [CHAR LIMIT=40] -->
    <string name="keyguard_indication_trust_unlocked">Kept unlocked by TrustAgent</string>

    <!-- Message asking the user to authenticate with primary authentication methods (PIN/pattern/password) or biometrics after the device is locked by adaptive auth. [CHAR LIMIT=60] -->
    <string name="kg_prompt_after_adaptive_auth_lock">Theft protection\nDevice locked, too many unlock attempts</string>

    <!-- Accessibility string for current zen mode and selected exit condition. A template that simply concatenates existing mode string and the current condition description. [CHAR LIMIT=20] -->
    <string name="zen_mode_and_condition"><xliff:g id="zen_mode" example="Priority interruptions only">%1$s</xliff:g>. <xliff:g id="exit_condition" example="For one hour">%2$s</xliff:g></string>

+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.keyguard;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.view.WindowInsets.Type.ime;

import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_ADAPTIVE_AUTH_REQUEST;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_DEVICE_ADMIN;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NONE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT;
@@ -126,6 +127,8 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
                return R.string.kg_prompt_reason_timeout_password;
            case PROMPT_REASON_TRUSTAGENT_EXPIRED:
                return R.string.kg_prompt_reason_timeout_password;
            case PROMPT_REASON_ADAPTIVE_AUTH_REQUEST:
                return R.string.kg_prompt_after_adaptive_auth_lock;
            case PROMPT_REASON_NONE:
                return 0;
            default:
+3 −0
Original line number Diff line number Diff line
@@ -331,6 +331,9 @@ public class KeyguardPatternViewController
            case PROMPT_REASON_TRUSTAGENT_EXPIRED:
                resId = R.string.kg_prompt_reason_timeout_pattern;
                break;
            case PROMPT_REASON_ADAPTIVE_AUTH_REQUEST:
                resId = R.string.kg_prompt_after_adaptive_auth_lock;
                break;
            case PROMPT_REASON_NONE:
                break;
            default:
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.keyguard;

import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_ADAPTIVE_AUTH_REQUEST;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_DEVICE_ADMIN;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NONE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT;
@@ -138,6 +139,8 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
                return R.string.kg_prompt_reason_timeout_pin;
            case PROMPT_REASON_TRUSTAGENT_EXPIRED:
                return R.string.kg_prompt_reason_timeout_pin;
            case PROMPT_REASON_ADAPTIVE_AUTH_REQUEST:
                return R.string.kg_prompt_after_adaptive_auth_lock;
            case PROMPT_REASON_NONE:
                return 0;
            default:
+5 −0
Original line number Diff line number Diff line
@@ -66,6 +66,11 @@ public interface KeyguardSecurityView {
     */
    int PROMPT_REASON_TRUSTAGENT_EXPIRED = 8;

    /**
     * Some auth is required because adaptive auth has determined risk
     */
    int PROMPT_REASON_ADAPTIVE_AUTH_REQUEST = 9;

    /**
     * Strong auth is required because the device has just booted because of an automatic
     * mainline update.
Loading