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

Commit 7e8f6e99 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9794482 from 3a2ef6db to tm-qpr3-release

Change-Id: Ice68ed60223ded9b58c046736376f9629cc5f1de
parents f1a73be6 3a2ef6db
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/SudDescription.Glif"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingTop="@dimen/sud_description_glif_margin_top"
    android:paddingBottom="@dimen/sud_description_glif_margin_bottom_lists"
    android:text="@string/lock_settings_picker_biometrics_added_security_message" />
+0 −26
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/SudDescription.Glif"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingTop="@dimen/sud_description_glif_margin_top"
    android:paddingBottom="@dimen/sud_description_glif_margin_bottom_lists"
    android:text="@string/setup_lock_settings_picker_message" />
+3 −1
Original line number Diff line number Diff line
@@ -183,7 +183,9 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
        mUserManager = UserManager.get(this);
        updatePasswordQuality();

        if (!mConfirmingCredentials) {
        // Check isFinishing() because FaceEnrollIntroduction may finish self to launch
        // FaceSettings during onCreate()
        if (!mConfirmingCredentials && !isFinishing()) {
            if (!mHasPassword) {
                // No password registered, launch into enrollment wizard.
                mConfirmingCredentials = true;
+47 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.hardware.SensorPrivacyManager;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.face.FaceManager;
import android.os.Bundle;
import android.os.UserHandle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.Log;
@@ -42,6 +43,7 @@ import androidx.annotation.StringRes;
import androidx.annotation.VisibleForTesting;

import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollActivity;
import com.android.settings.biometrics.BiometricEnrollIntroduction;
@@ -110,8 +112,26 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        mFaceManager = getFaceManager();

        if (savedInstanceState == null
                && !WizardManagerHelper.isAnySetupWizard(getIntent())
                && !getIntent().getBooleanExtra(EXTRA_FROM_SETTINGS_SUMMARY, false)
                && maxFacesEnrolled()) {
            // from tips && maxEnrolled
            Log.d(TAG, "launch face settings");
            launchFaceSettingsActivity();
            finish();
        }

        super.onCreate(savedInstanceState);

        // Wait super::onCreated() then return because SuperNotCalledExceptio will be thrown
        // if we don't wait for it.
        if (isFinishing()) {
            return;
        }

        // Apply extracted theme color to icons.
        final ImageView iconGlasses = findViewById(R.id.icon_glasses);
        final ImageView iconLooking = findViewById(R.id.icon_looking);
@@ -152,8 +172,6 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
            infoMessageRequireEyes.setText(getInfoMessageRequireEyes());
        }

        mFaceManager = getFaceManager();

        // This path is an entry point for SetNewPasswordController, e.g.
        // adb shell am start -a android.app.action.SET_NEW_PASSWORD
        if (mToken == null && BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
@@ -191,6 +209,24 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
        Log.v(TAG, "cameraPrivacyEnabled : " + cameraPrivacyEnabled);
    }

    private void launchFaceSettingsActivity() {
        final Intent intent = new Intent(this, Settings.FaceSettingsInternalActivity.class);
        final byte[] token = getIntent().getByteArrayExtra(
                ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
        if (token != null) {
            intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
        }
        final int userId = getIntent().getIntExtra(Intent.EXTRA_USER_ID, UserHandle.myUserId());
        if (userId != UserHandle.USER_NULL) {
            intent.putExtra(Intent.EXTRA_USER_ID, userId);
        }
        BiometricUtils.copyMultiBiometricExtras(getIntent(), intent);
        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, true);
        intent.putExtra(EXTRA_KEY_CHALLENGE, getIntent().getLongExtra(EXTRA_KEY_CHALLENGE, -1L));
        intent.putExtra(EXTRA_KEY_SENSOR_ID, getIntent().getIntExtra(EXTRA_KEY_SENSOR_ID, -1));
        startActivity(intent);
    }

    @VisibleForTesting
    @Nullable
    protected FaceManager getFaceManager() {
@@ -232,6 +268,15 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
    @Override
    protected void onStart() {
        super.onStart();
        listenFoldEventForPostureGuidance();
    }

    private void listenFoldEventForPostureGuidance() {
        if (maxFacesEnrolled()) {
            Log.d(TAG, "Device has enrolled face, do not show posture guidance");
            return;
        }

        if (getPostureGuidanceIntent() == null) {
            Log.d(TAG, "Device do not support posture guidance");
            return;
+10 −5
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
            super.onViewCreated(view, savedInstanceState);

            GlifPreferenceLayout layout = (GlifPreferenceLayout) view;
            layout.setDescriptionText(loadDescriptionText());
            layout.setDividerItemDecoration(new SettingsDividerItemDecoration(getContext()));
            layout.setDividerInset(getContext().getResources().getDimensionPixelSize(
                    R.dimen.sud_items_glif_text_divider_inset));
@@ -129,11 +130,9 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {

        @Override
        protected void addHeaderView() {
            if (isForBiometric()) {
                setHeaderView(R.layout.setup_choose_lock_generic_biometrics_header);
            } else {
                setHeaderView(R.layout.setup_choose_lock_generic_header);
            }
            // The original logic has been moved to onViewCreated and
            // uses GlifLayout#setDescriptionText instead,
            // keep empty body here since we won't call super method.
        }

        @Override
@@ -239,6 +238,12 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
        private boolean isForBiometric() {
            return mForFingerprint || mForFace || mForBiometrics;
        }

        String loadDescriptionText() {
            return getString(isForBiometric()
                    ? R.string.lock_settings_picker_biometrics_added_security_message
                    : R.string.setup_lock_settings_picker_message);
        }
    }

    public static class InternalActivity extends ChooseLockGeneric.InternalActivity {
Loading