|
19 | 19 | import android.view.View; |
20 | 20 |
|
21 | 21 | interface BiometricSensorUnlock { |
22 | | - // Returns 'true' if the biometric sensor has started its unlock procedure but has not yet |
23 | | - // accepted or rejected the user. |
| 22 | + /** |
| 23 | + * Initializes the view provided for the biometric unlock UI to work within. The provided area |
| 24 | + * completely covers the backup unlock mechanism. The view is then displayed in the same manner |
| 25 | + * as if {@link BiometricSensorUnlock#show(long)} was called with a timeout of 0. |
| 26 | + * @param biometricUnlockView View provided for the biometric unlock UI. |
| 27 | + */ |
| 28 | + public void initializeView(View biometricUnlockView); |
| 29 | + |
| 30 | + /** |
| 31 | + * Indicates whether the biometric unlock is running. Before |
| 32 | + * {@link BiometricSensorUnlock#start} is called, isRunning() returns false. After a successful |
| 33 | + * call to {@link BiometricSensorUnlock#start}, isRunning() returns true until the biometric |
| 34 | + * unlock completes, {@link BiometricSensorUnlock#stop} has been called, or an error has |
| 35 | + * forced the biometric unlock to stop. |
| 36 | + * @return whether the biometric unlock is currently running. |
| 37 | + */ |
24 | 38 | public boolean isRunning(); |
25 | 39 |
|
26 | | - // Show the interface, but don't start the unlock procedure. The interface should disappear |
27 | | - // after the specified timeout. If the timeout is 0, the interface shows until another event, |
28 | | - // such as calling hide(), causes it to disappear. |
29 | | - // Called on the UI Thread |
| 40 | + /** |
| 41 | + * Covers the backup unlock mechanism by showing the contents of the view initialized in |
| 42 | + * {@link BiometricSensorUnlock#initializeView(View)}. The view should disappear after the |
| 43 | + * specified timeout. If the timeout is 0, the interface shows until another event, such as |
| 44 | + * calling {@link BiometricSensorUnlock#hide()}, causes it to disappear. Called on the UI |
| 45 | + * thread. |
| 46 | + * @param timeoutMilliseconds Amount of time in milliseconds to display the view before |
| 47 | + * disappearing. A value of 0 means the view should remain visible. |
| 48 | + */ |
30 | 49 | public void show(long timeoutMilliseconds); |
31 | 50 |
|
32 | | - // Hide the interface, if any, exposing the lockscreen. |
| 51 | + /** |
| 52 | + * Uncovers the backup unlock mechanism by hiding the contents of the view initialized in |
| 53 | + * {@link BiometricSensorUnlock#initializeView(View)}. |
| 54 | + */ |
33 | 55 | public void hide(); |
34 | 56 |
|
35 | | - // Stop the unlock procedure if running. Returns 'true' if it was in fact running. |
36 | | - public boolean stop(); |
37 | | - |
38 | | - // Start the unlock procedure. Returns ‘false’ if it can’t be started or if the backup should |
39 | | - // be used. |
40 | | - // Called on the UI thread. |
41 | | - public boolean start(boolean suppressBiometricUnlock); |
| 57 | + /** |
| 58 | + * Binds to the biometric unlock service and starts the unlock procedure. Called on the UI |
| 59 | + * thread. |
| 60 | + * @return false if it can't be started or the backup should be used. |
| 61 | + */ |
| 62 | + public boolean start(); |
42 | 63 |
|
43 | | - // Provide a view to work within. |
44 | | - public void initializeAreaView(View topView); |
| 64 | + /** |
| 65 | + * Stops the biometric unlock procedure and unbinds from the service. |
| 66 | + * @return whether the biometric unlock was running when called. |
| 67 | + */ |
| 68 | + public boolean stop(); |
45 | 69 |
|
46 | | - // Clean up any resources used by the biometric unlock. |
| 70 | + /** |
| 71 | + * Cleans up any resources used by the biometric unlock. |
| 72 | + */ |
47 | 73 | public void cleanUp(); |
48 | 74 |
|
49 | | - // Returns the Device Policy Manager quality (e.g. PASSWORD_QUALITY_BIOMETRIC_WEAK). |
| 75 | + /** |
| 76 | + * Gets the Device Policy Manager quality of the biometric unlock sensor |
| 77 | + * (e.g., PASSWORD_QUALITY_BIOMETRIC_WEAK). |
| 78 | + * @return biometric unlock sensor quality, as defined by Device Policy Manager. |
| 79 | + */ |
50 | 80 | public int getQuality(); |
51 | 81 | } |
0 commit comments