Skip to content

Commit fbb9c61

Browse files
author
Steven Ross
committed
Stop FaceUnlock when detached from window fixes b/7222226
The FaceUnlock service gets onConfigurationChanged at about the same time as onDetachedFromWindow is received by the KeyguardFaceUnlockView, so we could do something beyond hiding the window there, but this approach should operate on the same thread as onPause and onResume, and thus be safe against threading issues. Before this change, I was seeing startUi calls in FaceUnlock.java crashing the service because the ProcessingThread had already been set to null. After this change, onDetachedFromWindow gets called, followed by onPause, after a rotation. The onDetachedFromWindow call now clears the messages and shuts down the connection, which prevents the startUi call. We should also probably make sure startUi in the service exits if mThread is null for good measure. Change-Id: I083066c9cb210e398d911e70c0f3bb5d2736cd8d
1 parent 2da2ec1 commit fbb9c61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ public void reset() {
6868

6969
}
7070

71+
@Override
72+
public void onDetachedFromWindow() {
73+
if (mBiometricUnlock != null) {
74+
mBiometricUnlock.hide();
75+
mBiometricUnlock.stop();
76+
}
77+
}
78+
7179
@Override
7280
public void onPause() {
7381
if (mBiometricUnlock != null) {

0 commit comments

Comments
 (0)