Skip to content

Commit 6bc7591

Browse files
Brian ColonnaAndroid (Google) Code Review
authored andcommitted
Merge "Changes to biometric sensor interface in lockscreen" into jb-dev
2 parents 9ad1b11 + ea8441e commit 6bc7591

File tree

5 files changed

+242
-161
lines changed

5 files changed

+242
-161
lines changed

policy/src/com/android/internal/policy/impl/BiometricSensorUnlock.java

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,63 @@
1919
import android.view.View;
2020

2121
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+
*/
2438
public boolean isRunning();
2539

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+
*/
3049
public void show(long timeoutMilliseconds);
3150

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+
*/
3355
public void hide();
3456

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();
4263

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();
4569

46-
// Clean up any resources used by the biometric unlock.
70+
/**
71+
* Cleans up any resources used by the biometric unlock.
72+
*/
4773
public void cleanUp();
4874

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+
*/
5080
public int getQuality();
5181
}

0 commit comments

Comments
 (0)