blob: 230ef81a2653882e324c74e767ca20d1c8728297 [file] [log] [blame]
Brian Colonna3223e252012-04-11 11:12:37 -04001/*
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 Miller5ecd8112013-01-09 18:50:26 -080017package com.android.keyguard;
Brian Colonna3223e252012-04-11 11:12:37 -040018
19import android.view.View;
20
21interface BiometricSensorUnlock {
Brian Colonnaea8441e2012-04-25 17:51:49 -040022 /**
23 * Initializes the view provided for the biometric unlock UI to work within. The provided area
Brian Colonna88240592012-05-04 17:42:15 -040024 * completely covers the backup unlock mechanism.
Brian Colonnaea8441e2012-04-25 17:51:49 -040025 * @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 Colonna3223e252012-04-11 11:12:37 -040037 public boolean isRunning();
38
Brian Colonnaea8441e2012-04-25 17:51:49 -040039 /**
Danielle Millett61413b52012-10-09 18:07:02 -040040 * Stops and removes the biometric unlock and shows the backup unlock
Brian Colonnaea8441e2012-04-25 17:51:49 -040041 */
Danielle Millett61413b52012-10-09 18:07:02 -040042 public void stopAndShowBackup();
Brian Colonna3223e252012-04-11 11:12:37 -040043
Brian Colonnaea8441e2012-04-25 17:51:49 -040044 /**
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 Colonna257f2ec2012-04-27 13:14:22 -040052 * Stops the biometric unlock procedure and unbinds from the service. Called on the UI thread.
Brian Colonnaea8441e2012-04-25 17:51:49 -040053 * @return whether the biometric unlock was running when called.
54 */
Brian Colonna3223e252012-04-11 11:12:37 -040055 public boolean stop();
56
Brian Colonnaea8441e2012-04-25 17:51:49 -040057 /**
58 * Cleans up any resources used by the biometric unlock.
59 */
Brian Colonna3223e252012-04-11 11:12:37 -040060 public void cleanUp();
61
Brian Colonnaea8441e2012-04-25 17:51:49 -040062 /**
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 Colonna3223e252012-04-11 11:12:37 -040067 public int getQuality();
68}