Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 1 | /* |
| 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 Chyn | f8688a0 | 2019-08-27 17:04:05 -0700 | [diff] [blame] | 14 | * limitations under the License. |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 17 | package com.android.systemui.biometrics; |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 18 | |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 19 | import android.annotation.IntDef; |
| 20 | |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 21 | /** |
| 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 Chyn | f8688a0 | 2019-08-27 17:04:05 -0700 | [diff] [blame] | 25 | public interface AuthDialogCallback { |
Kevin Chyn | c53d981 | 2019-07-30 18:10:30 -0700 | [diff] [blame] | 26 | |
| 27 | int DISMISSED_USER_CANCELED = 1; |
| 28 | int DISMISSED_BUTTON_NEGATIVE = 2; |
| 29 | int DISMISSED_BUTTON_POSITIVE = 3; |
Kevin Chyn | ff168dc | 2019-09-16 16:04:38 -0700 | [diff] [blame] | 30 | int DISMISSED_BIOMETRIC_AUTHENTICATED = 4; |
Kevin Chyn | c53d981 | 2019-07-30 18:10:30 -0700 | [diff] [blame] | 31 | int DISMISSED_ERROR = 5; |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 32 | int DISMISSED_BY_SYSTEM_SERVER = 6; |
Kevin Chyn | ff168dc | 2019-09-16 16:04:38 -0700 | [diff] [blame] | 33 | int DISMISSED_CREDENTIAL_AUTHENTICATED = 7; |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 34 | |
| 35 | @IntDef({DISMISSED_USER_CANCELED, |
| 36 | DISMISSED_BUTTON_NEGATIVE, |
| 37 | DISMISSED_BUTTON_POSITIVE, |
Kevin Chyn | ff168dc | 2019-09-16 16:04:38 -0700 | [diff] [blame] | 38 | DISMISSED_BIOMETRIC_AUTHENTICATED, |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 39 | DISMISSED_ERROR, |
Kevin Chyn | ff168dc | 2019-09-16 16:04:38 -0700 | [diff] [blame] | 40 | DISMISSED_BY_SYSTEM_SERVER, |
| 41 | DISMISSED_CREDENTIAL_AUTHENTICATED}) |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 42 | @interface DismissedReason {} |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
Kevin Chyn | c53d981 | 2019-07-30 18:10:30 -0700 | [diff] [blame] | 45 | * Invoked when the dialog is dismissed |
| 46 | * @param reason |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 47 | */ |
Kevin Chyn | 050315f | 2019-08-08 14:22:54 -0700 | [diff] [blame] | 48 | void onDismissed(@DismissedReason int reason); |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
Kevin Chyn | c53d981 | 2019-07-30 18:10:30 -0700 | [diff] [blame] | 51 | * Invoked when the "try again" button is clicked |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 52 | */ |
| 53 | void onTryAgainPressed(); |
Kevin Chyn | ff168dc | 2019-09-16 16:04:38 -0700 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * Invoked when the "use password" button is clicked |
| 57 | */ |
| 58 | void onDeviceCredentialPressed(); |
Kevin Chyn | 5906c17 | 2018-07-23 15:43:02 -0700 | [diff] [blame] | 59 | } |