blob: b75873100025952c2abed1ffcc96b63ddc7e92e8 [file] [log] [blame]
Kevin Chynaae4a152018-01-18 11:48:09 -08001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
Kevin Chynf8688a02019-08-27 17:04:05 -070014 * limitations under the License.
Kevin Chynaae4a152018-01-18 11:48:09 -080015 */
16
Kevin Chyne9275662018-07-23 16:42:06 -070017package com.android.systemui.biometrics;
Kevin Chynaae4a152018-01-18 11:48:09 -080018
Ilya Matyukhin0f9da352019-10-03 14:10:01 -070019import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE;
20import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
21
Kevin Chyn050315f2019-08-08 14:22:54 -070022import android.app.ActivityManager;
23import android.app.ActivityTaskManager;
24import android.app.IActivityTaskManager;
25import android.app.TaskStackListener;
Kevin Chyn42653e82018-01-19 14:15:46 -080026import android.content.Context;
Kevin Chynaae4a152018-01-18 11:48:09 -080027import android.content.pm.PackageManager;
Gus Prevasa7df7b22018-10-30 10:29:34 -040028import android.content.res.Configuration;
Kevin Chyn86f1b8e2019-09-24 19:00:49 -070029import android.hardware.biometrics.Authenticator;
Kevin Chyn8429da22019-09-24 12:42:35 -070030import android.hardware.biometrics.BiometricConstants;
Vishwath Mohanecf00ce2018-04-05 10:28:24 -070031import android.hardware.biometrics.BiometricPrompt;
Kevin Chyn23289ef2018-11-28 16:32:36 -080032import android.hardware.biometrics.IBiometricServiceReceiverInternal;
Ilya Matyukhin0f9da352019-10-03 14:10:01 -070033import android.hardware.face.FaceManager;
34import android.hardware.fingerprint.FingerprintManager;
Kevin Chynaae4a152018-01-18 11:48:09 -080035import android.os.Bundle;
Kevin Chyn050315f2019-08-08 14:22:54 -070036import android.os.Handler;
37import android.os.Looper;
Kevin Chyn42653e82018-01-19 14:15:46 -080038import android.os.RemoteException;
Kevin Chynaae4a152018-01-18 11:48:09 -080039import android.util.Log;
Kevin Chyn42653e82018-01-19 14:15:46 -080040import android.view.WindowManager;
Kevin Chynaae4a152018-01-18 11:48:09 -080041
Ilya Matyukhin0f9da352019-10-03 14:10:01 -070042import com.android.internal.R;
Kevin Chyn050315f2019-08-08 14:22:54 -070043import com.android.internal.annotations.VisibleForTesting;
Kevin Chyn42653e82018-01-19 14:15:46 -080044import com.android.internal.os.SomeArgs;
Kevin Chynaae4a152018-01-18 11:48:09 -080045import com.android.systemui.SystemUI;
46import com.android.systemui.statusbar.CommandQueue;
47
Kevin Chyn050315f2019-08-08 14:22:54 -070048import java.util.List;
49
Kevin Chyne9275662018-07-23 16:42:06 -070050/**
Kevin Chync53d9812019-07-30 18:10:30 -070051 * Receives messages sent from {@link com.android.server.biometrics.BiometricService} and shows the
52 * appropriate biometric UI (e.g. BiometricDialogView).
Kevin Chyne9275662018-07-23 16:42:06 -070053 */
Kevin Chynf8688a02019-08-27 17:04:05 -070054public class AuthController extends SystemUI implements CommandQueue.Callbacks,
55 AuthDialogCallback {
Kevin Chynfc468262019-08-20 17:17:11 -070056
Kevin Chynf8688a02019-08-27 17:04:05 -070057 private static final String TAG = "BiometricPrompt/AuthController";
Kevin Chyn42653e82018-01-19 14:15:46 -080058 private static final boolean DEBUG = true;
59
Kevin Chyn050315f2019-08-08 14:22:54 -070060 private final Injector mInjector;
61
Kevin Chync53d9812019-07-30 18:10:30 -070062 // TODO: These should just be saved from onSaveState
Gus Prevasa7df7b22018-10-30 10:29:34 -040063 private SomeArgs mCurrentDialogArgs;
Kevin Chyn050315f2019-08-08 14:22:54 -070064 @VisibleForTesting
Kevin Chynf8688a02019-08-27 17:04:05 -070065 AuthDialog mCurrentDialog;
Kevin Chync53d9812019-07-30 18:10:30 -070066
Kevin Chyn050315f2019-08-08 14:22:54 -070067 private Handler mHandler = new Handler(Looper.getMainLooper());
Kevin Chyn42653e82018-01-19 14:15:46 -080068 private WindowManager mWindowManager;
Kevin Chyn050315f2019-08-08 14:22:54 -070069 @VisibleForTesting
70 IActivityTaskManager mActivityTaskManager;
71 @VisibleForTesting
72 BiometricTaskStackListener mTaskStackListener;
73 @VisibleForTesting
74 IBiometricServiceReceiverInternal mReceiver;
75
76 public class BiometricTaskStackListener extends TaskStackListener {
77 @Override
78 public void onTaskStackChanged() {
79 mHandler.post(mTaskStackChangedRunnable);
80 }
81 }
82
83 private final Runnable mTaskStackChangedRunnable = () -> {
84 if (mCurrentDialog != null) {
85 try {
86 final String clientPackage = mCurrentDialog.getOpPackageName();
87 Log.w(TAG, "Task stack changed, current client: " + clientPackage);
88 final List<ActivityManager.RunningTaskInfo> runningTasks =
89 mActivityTaskManager.getTasks(1);
90 if (!runningTasks.isEmpty()) {
91 final String topPackage = runningTasks.get(0).topActivity.getPackageName();
92 if (!topPackage.contentEquals(clientPackage)) {
93 Log.w(TAG, "Evicting client due to: " + topPackage);
94 mCurrentDialog.dismissWithoutCallback(true /* animate */);
95 mCurrentDialog = null;
96 mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL);
97 mReceiver = null;
98 }
99 }
100 } catch (RemoteException e) {
101 Log.e(TAG, "Remote exception", e);
102 }
103 }
104 };
Kevin Chyn42653e82018-01-19 14:15:46 -0800105
Kevin Chync53d9812019-07-30 18:10:30 -0700106 @Override
107 public void onTryAgainPressed() {
108 try {
109 mReceiver.onTryAgainPressed();
110 } catch (RemoteException e) {
111 Log.e(TAG, "RemoteException when handling try again", e);
Kevin Chyn5906c172018-07-23 15:43:02 -0700112 }
113 }
114
Kevin Chync53d9812019-07-30 18:10:30 -0700115 @Override
Kevin Chynff168dc2019-09-16 16:04:38 -0700116 public void onDeviceCredentialPressed() {
117 try {
118 mReceiver.onDeviceCredentialPressed();
119 } catch (RemoteException e) {
120 Log.e(TAG, "RemoteException when handling credential button", e);
121 }
122 }
123
124 @Override
Kevin Chyn050315f2019-08-08 14:22:54 -0700125 public void onDismissed(@DismissedReason int reason) {
Kevin Chync53d9812019-07-30 18:10:30 -0700126 switch (reason) {
Kevin Chynf8688a02019-08-27 17:04:05 -0700127 case AuthDialogCallback.DISMISSED_USER_CANCELED:
Kevin Chync53d9812019-07-30 18:10:30 -0700128 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_USER_CANCEL);
129 break;
130
Kevin Chynf8688a02019-08-27 17:04:05 -0700131 case AuthDialogCallback.DISMISSED_BUTTON_NEGATIVE:
Kevin Chync53d9812019-07-30 18:10:30 -0700132 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_NEGATIVE);
133 break;
134
Kevin Chynf8688a02019-08-27 17:04:05 -0700135 case AuthDialogCallback.DISMISSED_BUTTON_POSITIVE:
Kevin Chynff168dc2019-09-16 16:04:38 -0700136 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED);
Kevin Chync53d9812019-07-30 18:10:30 -0700137 break;
138
Kevin Chynff168dc2019-09-16 16:04:38 -0700139 case AuthDialogCallback.DISMISSED_BIOMETRIC_AUTHENTICATED:
140 sendResultAndCleanUp(
141 BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED);
Kevin Chync53d9812019-07-30 18:10:30 -0700142 break;
143
Kevin Chynf8688a02019-08-27 17:04:05 -0700144 case AuthDialogCallback.DISMISSED_ERROR:
Kevin Chync53d9812019-07-30 18:10:30 -0700145 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_ERROR);
Kevin Chync53d9812019-07-30 18:10:30 -0700146 break;
Kevin Chyn050315f2019-08-08 14:22:54 -0700147
Kevin Chynf8688a02019-08-27 17:04:05 -0700148 case AuthDialogCallback.DISMISSED_BY_SYSTEM_SERVER:
Kevin Chyn050315f2019-08-08 14:22:54 -0700149 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_SERVER_REQUESTED);
150 break;
151
Kevin Chynff168dc2019-09-16 16:04:38 -0700152 case AuthDialogCallback.DISMISSED_CREDENTIAL_AUTHENTICATED:
153 sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED);
154 break;
155
Kevin Chync53d9812019-07-30 18:10:30 -0700156 default:
157 Log.e(TAG, "Unhandled reason: " + reason);
158 break;
Kevin Chync94b7db2019-05-15 17:28:16 -0700159 }
Kevin Chync53d9812019-07-30 18:10:30 -0700160 }
161
Kevin Chyn050315f2019-08-08 14:22:54 -0700162 private void sendResultAndCleanUp(@DismissedReason int reason) {
Kevin Chync53d9812019-07-30 18:10:30 -0700163 if (mReceiver == null) {
164 Log.e(TAG, "Receiver is null");
165 return;
166 }
167 try {
Kevin Chyn050315f2019-08-08 14:22:54 -0700168 mReceiver.onDialogDismissed(reason);
Kevin Chync53d9812019-07-30 18:10:30 -0700169 } catch (RemoteException e) {
170 Log.w(TAG, "Remote exception", e);
171 }
Kevin Chyn050315f2019-08-08 14:22:54 -0700172 onDialogDismissed(reason);
173 }
174
175 public static class Injector {
176 IActivityTaskManager getActivityTaskManager() {
177 return ActivityTaskManager.getService();
178 }
179 }
180
Dave Mankoffa5d8a392019-10-10 12:21:09 -0400181 public AuthController(Context context) {
182 this(context, new Injector());
Kevin Chyn050315f2019-08-08 14:22:54 -0700183 }
184
185 @VisibleForTesting
Dave Mankoffa5d8a392019-10-10 12:21:09 -0400186 AuthController(Context context, Injector injector) {
187 super(context);
Kevin Chyn050315f2019-08-08 14:22:54 -0700188 mInjector = injector;
Kevin Chync53d9812019-07-30 18:10:30 -0700189 }
Kevin Chync94b7db2019-05-15 17:28:16 -0700190
Kevin Chynaae4a152018-01-18 11:48:09 -0800191 @Override
192 public void start() {
Kevin Chyne1912712019-01-04 14:22:34 -0800193 final PackageManager pm = mContext.getPackageManager();
194 if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
195 || pm.hasSystemFeature(PackageManager.FEATURE_FACE)
196 || pm.hasSystemFeature(PackageManager.FEATURE_IRIS)) {
Jason Monkd7c98552018-12-04 11:14:50 -0500197 getComponent(CommandQueue.class).addCallback(this);
Gus Prevasa7df7b22018-10-30 10:29:34 -0400198 mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
Kevin Chyn050315f2019-08-08 14:22:54 -0700199 mActivityTaskManager = mInjector.getActivityTaskManager();
200
201 try {
202 mTaskStackListener = new BiometricTaskStackListener();
203 mActivityTaskManager.registerTaskStackListener(mTaskStackListener);
204 } catch (RemoteException e) {
205 Log.w(TAG, "Unable to register task stack listener", e);
206 }
Gus Prevasa7df7b22018-10-30 10:29:34 -0400207 }
208 }
209
Kevin Chynaae4a152018-01-18 11:48:09 -0800210 @Override
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700211 public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
212 int biometricModality, boolean requireConfirmation, int userId, String opPackageName) {
213 final int authenticators = Utils.getAuthenticators(bundle);
214
Kevin Chyn158fefb2019-01-03 18:59:05 -0800215 if (DEBUG) {
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700216 Log.d(TAG, "showAuthenticationDialog, authenticators: " + authenticators
217 + ", biometricModality: " + biometricModality
Kevin Chyn158fefb2019-01-03 18:59:05 -0800218 + ", requireConfirmation: " + requireConfirmation);
219 }
Kevin Chyn42653e82018-01-19 14:15:46 -0800220 SomeArgs args = SomeArgs.obtain();
221 args.arg1 = bundle;
222 args.arg2 = receiver;
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700223 args.argi1 = biometricModality;
Kevin Chyn6cf54e82018-09-18 19:13:27 -0700224 args.arg3 = requireConfirmation;
Kevin Chyn1b9f8df2018-11-12 19:04:55 -0800225 args.argi2 = userId;
Kevin Chyn050315f2019-08-08 14:22:54 -0700226 args.arg4 = opPackageName;
Kevin Chync53d9812019-07-30 18:10:30 -0700227
228 boolean skipAnimation = false;
229 if (mCurrentDialog != null) {
230 Log.w(TAG, "mCurrentDialog: " + mCurrentDialog);
231 skipAnimation = true;
232 }
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700233
234 showDialog(args, skipAnimation, null /* savedState */);
Kevin Chynaae4a152018-01-18 11:48:09 -0800235 }
236
237 @Override
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700238 public void onBiometricAuthenticated() {
239 mCurrentDialog.onAuthenticationSucceeded();
Kevin Chyn42653e82018-01-19 14:15:46 -0800240 }
241
Kevin Chync53d9812019-07-30 18:10:30 -0700242 @Override
243 public void onBiometricHelp(String message) {
244 if (DEBUG) Log.d(TAG, "onBiometricHelp: " + message);
245
246 mCurrentDialog.onHelp(message);
Kevin Chyn42653e82018-01-19 14:15:46 -0800247 }
248
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700249 private String getErrorString(int modality, int error, int vendorCode) {
250 switch (modality) {
251 case TYPE_FACE:
252 return FaceManager.getErrorString(mContext, error, vendorCode);
Kevin Chyn8429da22019-09-24 12:42:35 -0700253
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700254 case TYPE_FINGERPRINT:
255 return FingerprintManager.getErrorString(mContext, error, vendorCode);
256
257 default:
258 return "";
259 }
260 }
261
262 @Override
263 public void onBiometricError(int modality, int error, int vendorCode) {
264 if (DEBUG) {
265 Log.d(TAG, String.format("onBiometricError(%d, %d, %d)", modality, error, vendorCode));
266 }
267
268 final boolean isLockout = (error == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT)
269 || (error == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT);
270
271 // TODO(b/141025588): Create separate methods for handling hard and soft errors.
272 final boolean isSoftError = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED
273 || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT);
274
Kevin Chyn8429da22019-09-24 12:42:35 -0700275 if (mCurrentDialog.isAllowDeviceCredentials() && isLockout) {
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700276 if (DEBUG) Log.d(TAG, "onBiometricError, lockout");
Kevin Chyn8429da22019-09-24 12:42:35 -0700277 mCurrentDialog.animateToCredentialUI();
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700278 } else if (isSoftError) {
279 final String errorMessage = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED)
280 ? mContext.getString(R.string.biometric_not_recognized)
281 : getErrorString(modality, error, vendorCode);
282 if (DEBUG) Log.d(TAG, "onBiometricError, soft error: " + errorMessage);
283 mCurrentDialog.onAuthenticationFailed(errorMessage);
Kevin Chyn8429da22019-09-24 12:42:35 -0700284 } else {
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700285 final String errorMessage = getErrorString(modality, error, vendorCode);
286 if (DEBUG) Log.d(TAG, "onBiometricError, hard error: " + errorMessage);
287 mCurrentDialog.onError(errorMessage);
Kevin Chyn8429da22019-09-24 12:42:35 -0700288 }
Kevin Chyn42653e82018-01-19 14:15:46 -0800289 }
290
Kevin Chync53d9812019-07-30 18:10:30 -0700291 @Override
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700292 public void hideAuthenticationDialog() {
293 if (DEBUG) Log.d(TAG, "hideAuthenticationDialog");
Kevin Chync53d9812019-07-30 18:10:30 -0700294
Kevin Chyn050315f2019-08-08 14:22:54 -0700295 mCurrentDialog.dismissFromSystemServer();
Kevin Chync53d9812019-07-30 18:10:30 -0700296 }
297
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700298 private void showDialog(SomeArgs args, boolean skipAnimation, Bundle savedState) {
Kevin Chync53d9812019-07-30 18:10:30 -0700299 mCurrentDialogArgs = args;
300 final int type = args.argi1;
Kevin Chyn050315f2019-08-08 14:22:54 -0700301 final Bundle biometricPromptBundle = (Bundle) args.arg1;
302 final boolean requireConfirmation = (boolean) args.arg3;
303 final int userId = args.argi2;
304 final String opPackageName = (String) args.arg4;
Kevin Chync53d9812019-07-30 18:10:30 -0700305
306 // Create a new dialog but do not replace the current one yet.
Kevin Chynf8688a02019-08-27 17:04:05 -0700307 final AuthDialog newDialog = buildDialog(
Kevin Chyn050315f2019-08-08 14:22:54 -0700308 biometricPromptBundle,
309 requireConfirmation,
310 userId,
311 type,
Kevin Chynfc468262019-08-20 17:17:11 -0700312 opPackageName,
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700313 skipAnimation);
Kevin Chync53d9812019-07-30 18:10:30 -0700314
315 if (newDialog == null) {
316 Log.e(TAG, "Unsupported type: " + type);
Kevin Chyn42653e82018-01-19 14:15:46 -0800317 return;
318 }
Kevin Chync53d9812019-07-30 18:10:30 -0700319
320 if (DEBUG) {
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700321 Log.d(TAG, "showDialog: " + args
Kevin Chync53d9812019-07-30 18:10:30 -0700322 + " savedState: " + savedState
323 + " mCurrentDialog: " + mCurrentDialog
324 + " newDialog: " + newDialog
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700325 + " type: " + type);
Kevin Chync53d9812019-07-30 18:10:30 -0700326 }
327
Kevin Chyn9cf89912019-08-30 13:33:58 -0700328 if (mCurrentDialog != null) {
Kevin Chync53d9812019-07-30 18:10:30 -0700329 // If somehow we're asked to show a dialog, the old one doesn't need to be animated
330 // away. This can happen if the app cancels and re-starts auth during configuration
331 // change. This is ugly because we also have to do things on onConfigurationChanged
332 // here.
333 mCurrentDialog.dismissWithoutCallback(false /* animate */);
334 }
335
336 mReceiver = (IBiometricServiceReceiverInternal) args.arg2;
337 mCurrentDialog = newDialog;
Kevin Chyn9cf89912019-08-30 13:33:58 -0700338 mCurrentDialog.show(mWindowManager, savedState);
Kevin Chync53d9812019-07-30 18:10:30 -0700339 }
340
Kevin Chyn050315f2019-08-08 14:22:54 -0700341 private void onDialogDismissed(@DismissedReason int reason) {
342 if (DEBUG) Log.d(TAG, "onDialogDismissed: " + reason);
Kevin Chync53d9812019-07-30 18:10:30 -0700343 if (mCurrentDialog == null) {
344 Log.w(TAG, "Dialog already dismissed");
Kevin Chyn42653e82018-01-19 14:15:46 -0800345 }
346 mReceiver = null;
Kevin Chync53d9812019-07-30 18:10:30 -0700347 mCurrentDialog = null;
Kevin Chyn23289ef2018-11-28 16:32:36 -0800348 }
349
Gus Prevasa7df7b22018-10-30 10:29:34 -0400350 @Override
351 protected void onConfigurationChanged(Configuration newConfig) {
Kevin Chyn02129b12018-11-01 16:47:12 -0700352 super.onConfigurationChanged(newConfig);
Kevin Chyne1912712019-01-04 14:22:34 -0800353
354 // Save the state of the current dialog (buttons showing, etc)
Kevin Chyne1912712019-01-04 14:22:34 -0800355 if (mCurrentDialog != null) {
Kevin Chync53d9812019-07-30 18:10:30 -0700356 final Bundle savedState = new Bundle();
Kevin Chyne1912712019-01-04 14:22:34 -0800357 mCurrentDialog.onSaveState(savedState);
Kevin Chync53d9812019-07-30 18:10:30 -0700358 mCurrentDialog.dismissWithoutCallback(false /* animate */);
359 mCurrentDialog = null;
Kevin Chyne1912712019-01-04 14:22:34 -0800360
Kevin Chyn27da7182019-09-11 12:17:55 -0700361 // Only show the dialog if necessary. If it was animating out, the dialog is supposed
362 // to send its pending callback immediately.
363 if (savedState.getInt(AuthDialog.KEY_CONTAINER_STATE)
364 != AuthContainerView.STATE_ANIMATING_OUT) {
Kevin Chyn8cbb4882019-09-19 16:49:02 -0700365 final boolean credentialShowing =
366 savedState.getBoolean(AuthDialog.KEY_CREDENTIAL_SHOWING);
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700367 if (credentialShowing) {
368 // TODO: Clean this up
369 Bundle bundle = (Bundle) mCurrentDialogArgs.arg1;
370 bundle.putInt(BiometricPrompt.KEY_AUTHENTICATORS_ALLOWED,
371 Authenticator.TYPE_CREDENTIAL);
372 }
Kevin Chyn8cbb4882019-09-19 16:49:02 -0700373
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700374 showDialog(mCurrentDialogArgs, true /* skipAnimation */, savedState);
Kevin Chyn27da7182019-09-11 12:17:55 -0700375 }
Gus Prevasa7df7b22018-10-30 10:29:34 -0400376 }
Kevin Chync53d9812019-07-30 18:10:30 -0700377 }
Kevin Chyne1912712019-01-04 14:22:34 -0800378
Kevin Chynf8688a02019-08-27 17:04:05 -0700379 protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation,
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700380 int userId, int type, String opPackageName, boolean skipIntro) {
Kevin Chynd837ced2019-09-11 16:09:43 -0700381 return new AuthContainerView.Builder(mContext)
382 .setCallback(this)
383 .setBiometricPromptBundle(biometricPromptBundle)
384 .setRequireConfirmation(requireConfirmation)
385 .setUserId(userId)
386 .setOpPackageName(opPackageName)
387 .setSkipIntro(skipIntro)
388 .build(type);
Gus Prevasa7df7b22018-10-30 10:29:34 -0400389 }
Kevin Chynaae4a152018-01-18 11:48:09 -0800390}