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

Commit 3ea423ae authored by Svetoslav's avatar Svetoslav
Browse files

User to confirm credentials if an accessibility service changes encryption.

When an accessibility service is enabled we are not using the user secure
lock when encrypting the data. If the latter is already used for encryption
we are decreasing the encryption level and therefore shall challenge the
user with their secure lock.

bug:17881324

Change-Id: If8905c05e20bc6bb6a6415e501871e5ad83f3d86
parent 4909c412
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@
            android:layout_marginBottom="10dip"
            android:gravity="start"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textAppearance="?android:attr/textAppearanceMedium"
        />

        <!-- Password entry field -->
+1 −2
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:lines="2"
        android:textAppearance="?android:attr/textAppearanceLarge"/>
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <!-- spacer above text entry field -->
    <View
+1 −2
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:lines="2"
        android:textAppearance="?android:attr/textAppearanceLarge"/>
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <!-- Password entry field -->
    <EditText android:id="@+id/password_entry"
+15 −0
Original line number Diff line number Diff line
@@ -3675,6 +3675,21 @@
    <string name="secure_lock_encryption_warning">Because you\'ve turned on an accessibility service,
        your device won’t use your screen lock to enhance data encryption.</string>

    <!-- Message to the user to enter his pattern before enabling an accessibility service. [CHAR LIMIT=NONE] -->
    <string name="enable_service_pattern_reason">Turning on <xliff:g id="service"
        example="TalkBack">%1$s</xliff:g> reduces data protection.
    </string>

    <!-- Message to the user to enter his PIN before enabling an accessibility service. [CHAR LIMIT=NONE] -->
    <string name="enable_service_pin_reason">Turning on <xliff:g id="service"
        example="TalkBack">%1$s</xliff:g> reduces data protection.
    </string>

    <!-- Message to the user to enter his password before enabling an accessibility service. [CHAR LIMIT=NONE] -->
    <string name="enable_service_password_reason">Turning on <xliff:g id="service"
        example="TalkBack">%1$s</xliff:g> reduces data protection.
    </string>

    <!-- Title for the capability of an accessibility service to receive events and keys. -->
    <string name="capability_title_receiveAccessibilityEvents">Observe your actions</string>
    <!-- Description for the capability of an accessibility service to receive events and keys. -->
+6 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public final class ChooseLockSettingsHelper {
            case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
            case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
                // TODO: update UI layout for ConfirmPassword to show message and details
                launched = confirmPassword(request, returnCredentials);
                launched = confirmPassword(request, message, returnCredentials);
                break;
        }
        return launched;
@@ -116,13 +116,17 @@ public final class ChooseLockSettingsHelper {

    /**
     * Launch screen to confirm the existing lock password.
     * @param message shown in header of ConfirmLockPassword if not null
     * @param returnCredentials if true, put credentials into intent.
     * @see #onActivityResult(int, int, android.content.Intent)
     * @return true if we launched an activity to confirm password
     */
    private boolean confirmPassword(int request, boolean returnCredentials) {
    private boolean confirmPassword(int request, CharSequence message,
            boolean returnCredentials) {
        if (!mLockPatternUtils.isLockPasswordEnabled()) return false;
        final Intent intent = new Intent();
        // supply header text in the intent
        intent.putExtra(ConfirmLockPattern.HEADER_TEXT, message);
        intent.setClassName("com.android.settings",
                            returnCredentials
                            ? ConfirmLockPassword.InternalActivity.class.getName()
Loading