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

Commit 448b6f54 authored by Chandru S's avatar Chandru S
Browse files

Show specific messages for why bouncer is shown before or after OTA update.

Test: 1. Restart the device,
      2. Run `adb setprop sys.boot.reason.last reboot,mainline_update` before unlock
      3. See message on bouncer
Test: atest KeyguardViewMediatorTest
Bug: 285956229
Bug: 285578578
Change-Id: I8623cce9e9eb4c321f377f262e9831e3c3a62e93
Merged-In: I8623cce9e9eb4c321f377f262e9831e3c3a62e93
parent c8e36828
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -358,12 +358,12 @@
    <!-- Message shown to prepare for an unattended update (OTA). Also known as an over-the-air (OTA) update.  [CHAR LIMIT=70] -->
    <string name="kg_prompt_unattended_update_pattern">Draw pattern to install update later</string>

    <!-- Message shown after an unattended update (OTA) asking the user to enter their PIN. Also known as an over-the-air (OTA) update.  [CHAR LIMIT=70] -->
    <!--  Message shown after an unattended mainline (major) update asking the user to enter their PIN. [CHAR LIMIT=70] -->
    <string name="kg_prompt_after_update_pin">Device updated. Enter PIN to continue.</string>

    <!-- Message shown after an unattended update (OTA) asking the user to enter their password. Also known as an over-the-air (OTA) update.  [CHAR LIMIT=70] -->
    <!-- Message shown after an unattended mainline (major) update asking the user to enter their password. [CHAR LIMIT=70] -->
    <string name="kg_prompt_after_update_password">Device updated. Enter password to continue.</string>

    <!-- Message shown after an unattended update (OTA) asking the user to enter their pattern. Also known as an over-the-air (OTA) update.  [CHAR LIMIT=70] -->
    <!-- Message shown after an unattended mainline (major) update asking the user to enter their pattern. [CHAR LIMIT=70] -->
    <string name="kg_prompt_after_update_pattern">Device updated. Draw pattern to continue.</string>
</resources>
+4 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NONE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_PREPARE_FOR_UPDATE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
@@ -99,6 +100,8 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
        switch (reason) {
            case PROMPT_REASON_RESTART:
                return R.string.kg_prompt_reason_restart_password;
            case PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE:
                return R.string.kg_prompt_after_update_password;
            case PROMPT_REASON_TIMEOUT:
                return R.string.kg_prompt_reason_timeout_password;
            case PROMPT_REASON_DEVICE_ADMIN:
@@ -106,7 +109,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
            case PROMPT_REASON_USER_REQUEST:
                return R.string.kg_prompt_after_user_lockdown_password;
            case PROMPT_REASON_PREPARE_FOR_UPDATE:
                return R.string.kg_prompt_reason_timeout_password;
                return R.string.kg_prompt_unattended_update_password;
            case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
                return R.string.kg_prompt_reason_timeout_password;
            case PROMPT_REASON_TRUSTAGENT_EXPIRED:
+4 −1
Original line number Diff line number Diff line
@@ -304,6 +304,9 @@ public class KeyguardPatternViewController
            case PROMPT_REASON_RESTART:
                resId = R.string.kg_prompt_reason_restart_pattern;
                break;
            case PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE:
                resId = R.string.kg_prompt_after_update_pattern;
                break;
            case PROMPT_REASON_TIMEOUT:
                resId = R.string.kg_prompt_reason_timeout_pattern;
                break;
@@ -314,7 +317,7 @@ public class KeyguardPatternViewController
                resId = R.string.kg_prompt_after_user_lockdown_pattern;
                break;
            case PROMPT_REASON_PREPARE_FOR_UPDATE:
                resId = R.string.kg_prompt_reason_timeout_pattern;
                resId = R.string.kg_prompt_unattended_update_pattern;
                break;
            case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
                resId = R.string.kg_prompt_reason_timeout_pattern;
+4 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NONE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_PREPARE_FOR_UPDATE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
@@ -113,6 +114,8 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
        switch (reason) {
            case PROMPT_REASON_RESTART:
                return R.string.kg_prompt_reason_restart_pin;
            case PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE:
                return R.string.kg_prompt_after_update_pin;
            case PROMPT_REASON_TIMEOUT:
                return R.string.kg_prompt_reason_timeout_pin;
            case PROMPT_REASON_DEVICE_ADMIN:
@@ -120,7 +123,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
            case PROMPT_REASON_USER_REQUEST:
                return R.string.kg_prompt_after_user_lockdown_pin;
            case PROMPT_REASON_PREPARE_FOR_UPDATE:
                return R.string.kg_prompt_reason_timeout_pin;
                return R.string.kg_prompt_unattended_update_pin;
            case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
                return R.string.kg_prompt_reason_timeout_pin;
            case PROMPT_REASON_TRUSTAGENT_EXPIRED:
+6 −0
Original line number Diff line number Diff line
@@ -102,6 +102,12 @@ public interface KeyguardSecurityView {
     */
    int PROMPT_REASON_PRIMARY_AUTH_LOCKED_OUT = 15;

    /**
     * Strong auth is required because the device has just booted because of an automatic
     * mainline update.
     */
    int PROMPT_REASON_RESTART_FOR_MAINLINE_UPDATE = 16;

    /**
     * Reset the view and prepare to take input. This should do things like clearing the
     * password or pattern and clear error messages.
Loading