Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 17 | package com.android.keyguard; |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 18 | |
| 19 | import android.view.View; |
| 20 | |
| 21 | interface BiometricSensorUnlock { |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 22 | /** |
| 23 | * Initializes the view provided for the biometric unlock UI to work within. The provided area |
Brian Colonna | 8824059 | 2012-05-04 17:42:15 -0400 | [diff] [blame] | 24 | * completely covers the backup unlock mechanism. |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 25 | * @param biometricUnlockView View provided for the biometric unlock UI. |
| 26 | */ |
| 27 | public void initializeView(View biometricUnlockView); |
| 28 | |
| 29 | /** |
| 30 | * Indicates whether the biometric unlock is running. Before |
| 31 | * {@link BiometricSensorUnlock#start} is called, isRunning() returns false. After a successful |
| 32 | * call to {@link BiometricSensorUnlock#start}, isRunning() returns true until the biometric |
| 33 | * unlock completes, {@link BiometricSensorUnlock#stop} has been called, or an error has |
| 34 | * forced the biometric unlock to stop. |
| 35 | * @return whether the biometric unlock is currently running. |
| 36 | */ |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 37 | public boolean isRunning(); |
| 38 | |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 39 | /** |
Danielle Millett | 61413b5 | 2012-10-09 18:07:02 -0400 | [diff] [blame] | 40 | * Stops and removes the biometric unlock and shows the backup unlock |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 41 | */ |
Danielle Millett | 61413b5 | 2012-10-09 18:07:02 -0400 | [diff] [blame] | 42 | public void stopAndShowBackup(); |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 43 | |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 44 | /** |
| 45 | * Binds to the biometric unlock service and starts the unlock procedure. Called on the UI |
| 46 | * thread. |
| 47 | * @return false if it can't be started or the backup should be used. |
| 48 | */ |
| 49 | public boolean start(); |
| 50 | |
| 51 | /** |
Brian Colonna | 257f2ec | 2012-04-27 13:14:22 -0400 | [diff] [blame] | 52 | * Stops the biometric unlock procedure and unbinds from the service. Called on the UI thread. |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 53 | * @return whether the biometric unlock was running when called. |
| 54 | */ |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 55 | public boolean stop(); |
| 56 | |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 57 | /** |
| 58 | * Cleans up any resources used by the biometric unlock. |
| 59 | */ |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 60 | public void cleanUp(); |
| 61 | |
Brian Colonna | ea8441e | 2012-04-25 17:51:49 -0400 | [diff] [blame] | 62 | /** |
| 63 | * Gets the Device Policy Manager quality of the biometric unlock sensor |
| 64 | * (e.g., PASSWORD_QUALITY_BIOMETRIC_WEAK). |
| 65 | * @return biometric unlock sensor quality, as defined by Device Policy Manager. |
| 66 | */ |
Brian Colonna | 3223e25 | 2012-04-11 11:12:37 -0400 | [diff] [blame] | 67 | public int getQuality(); |
| 68 | } |