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

Commit 3b9c3cf5 authored by Hao Dong's avatar Hao Dong
Browse files

Override package name for logo in ConfirmDeviceCredentialActivity.

Test: TODO
Flag: ACONFIG android.hardware.biometrics.custom_biometric_prompt NEXTFOOD
Bug: 337082634

Change-Id: If0c4851c8c0cb0fae01e9f30d6a6486f2ab2c71f
parent 67541a94
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.password;

import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.hardware.biometrics.BiometricPrompt;
import android.hardware.biometrics.BiometricPrompt.AuthenticationCallback;
import android.hardware.biometrics.BiometricPrompt.AuthenticationResult;
@@ -39,6 +40,7 @@ public class BiometricFragment extends InstrumentedFragment {
    private static final String TAG = "ConfirmDeviceCredential/BiometricFragment";

    private static final String KEY_PROMPT_INFO = "prompt_info";
    private static final String KEY_CALLING_ACTIVITY = "calling_activity";

    // Re-set by the application. Should be done upon orientation changes, etc
    private Executor mClientExecutor;
@@ -88,10 +90,13 @@ public class BiometricFragment extends InstrumentedFragment {
     * @param promptInfo
     * @return
     */
    public static BiometricFragment newInstance(PromptInfo promptInfo) {
    public static BiometricFragment newInstance(PromptInfo promptInfo,
            ComponentName callingActivity) {
        BiometricFragment biometricFragment = new BiometricFragment();
        final Bundle bundle = new Bundle();
        bundle.putParcelable(KEY_PROMPT_INFO, promptInfo);

        bundle.putParcelable(KEY_CALLING_ACTIVITY, callingActivity);
        biometricFragment.setArguments(bundle);
        return biometricFragment;
    }
@@ -126,6 +131,7 @@ public class BiometricFragment extends InstrumentedFragment {

        final Bundle bundle = getArguments();
        final PromptInfo promptInfo = bundle.getParcelable(KEY_PROMPT_INFO);
        final ComponentName callingActivity = bundle.getParcelable(KEY_CALLING_ACTIVITY);

        BiometricPrompt.Builder promptBuilder = new BiometricPrompt.Builder(getContext())
                .setTitle(promptInfo.getTitle())
@@ -141,7 +147,8 @@ public class BiometricFragment extends InstrumentedFragment {
                .setDisallowBiometricsIfPolicyExists(
                        promptInfo.isDisallowBiometricsIfPolicyExists())
                .setShowEmergencyCallButton(promptInfo.isShowEmergencyCallButton())
                .setReceiveSystemEvents(true);
                .setReceiveSystemEvents(true)
                .setComponentNameForConfirmDeviceCredentialActivity(callingActivity);

        if (android.os.Flags.allowPrivateProfile() && Flags.enablePrivateSpaceFeatures()
                && Flags.enableBiometricsToUnlockPrivateSpace()) {
+2 −1
Original line number Diff line number Diff line
@@ -437,7 +437,8 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
        boolean newFragment = false;

        if (mBiometricFragment == null) {
            mBiometricFragment = BiometricFragment.newInstance(promptInfo);
            mBiometricFragment = BiometricFragment.newInstance(promptInfo,
                    getCallingActivity());
            newFragment = true;
        }
        mBiometricFragment.setCallbacks(mExecutor, mAuthenticationCallback);