blob: 12bb1228a53b2cb46095d4f3470f088cbb1dda4f [file] [log] [blame]
Kevin Chyn5906c172018-07-23 15:43:02 -07001/*
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 Chyn5906c172018-07-23 15:43:02 -070015 */
16
Kevin Chyne9275662018-07-23 16:42:06 -070017package com.android.systemui.biometrics;
Kevin Chyn5906c172018-07-23 15:43:02 -070018
Kevin Chyn050315f2019-08-08 14:22:54 -070019import android.annotation.IntDef;
20
Kevin Chyn5906c172018-07-23 15:43:02 -070021/**
22 * Callback interface for dialog views. These should be implemented by the controller (e.g.
23 * FingerprintDialogImpl) and passed into their views (e.g. FingerprintDialogView).
24 */
Kevin Chynf8688a02019-08-27 17:04:05 -070025public interface AuthDialogCallback {
Kevin Chync53d9812019-07-30 18:10:30 -070026
27 int DISMISSED_USER_CANCELED = 1;
28 int DISMISSED_BUTTON_NEGATIVE = 2;
29 int DISMISSED_BUTTON_POSITIVE = 3;
Kevin Chynff168dc2019-09-16 16:04:38 -070030 int DISMISSED_BIOMETRIC_AUTHENTICATED = 4;
Kevin Chync53d9812019-07-30 18:10:30 -070031 int DISMISSED_ERROR = 5;
Kevin Chyn050315f2019-08-08 14:22:54 -070032 int DISMISSED_BY_SYSTEM_SERVER = 6;
Kevin Chynff168dc2019-09-16 16:04:38 -070033 int DISMISSED_CREDENTIAL_AUTHENTICATED = 7;
Kevin Chyn050315f2019-08-08 14:22:54 -070034
35 @IntDef({DISMISSED_USER_CANCELED,
36 DISMISSED_BUTTON_NEGATIVE,
37 DISMISSED_BUTTON_POSITIVE,
Kevin Chynff168dc2019-09-16 16:04:38 -070038 DISMISSED_BIOMETRIC_AUTHENTICATED,
Kevin Chyn050315f2019-08-08 14:22:54 -070039 DISMISSED_ERROR,
Kevin Chynff168dc2019-09-16 16:04:38 -070040 DISMISSED_BY_SYSTEM_SERVER,
41 DISMISSED_CREDENTIAL_AUTHENTICATED})
Kevin Chyn050315f2019-08-08 14:22:54 -070042 @interface DismissedReason {}
Kevin Chyn5906c172018-07-23 15:43:02 -070043
44 /**
Kevin Chync53d9812019-07-30 18:10:30 -070045 * Invoked when the dialog is dismissed
46 * @param reason
Kevin Chyn5906c172018-07-23 15:43:02 -070047 */
Kevin Chyn050315f2019-08-08 14:22:54 -070048 void onDismissed(@DismissedReason int reason);
Kevin Chyn5906c172018-07-23 15:43:02 -070049
50 /**
Kevin Chync53d9812019-07-30 18:10:30 -070051 * Invoked when the "try again" button is clicked
Kevin Chyn23289ef2018-11-28 16:32:36 -080052 */
53 void onTryAgainPressed();
Kevin Chynff168dc2019-09-16 16:04:38 -070054
55 /**
56 * Invoked when the "use password" button is clicked
57 */
58 void onDeviceCredentialPressed();
Kevin Chyn5906c172018-07-23 15:43:02 -070059}