Unlock latency improvements
- Make sure the latency also gets tracked on first unlocked in
which we cancel the AsyncTask.
- Also add it for pattern authentication
Change-Id: Ie1561264b0a3b75c09819ccc6d269e61e367e1be
diff --git a/core/java/com/android/internal/widget/LockPatternChecker.java b/core/java/com/android/internal/widget/LockPatternChecker.java
index df9b0dd..3d43f5d 100644
--- a/core/java/com/android/internal/widget/LockPatternChecker.java
+++ b/core/java/com/android/internal/widget/LockPatternChecker.java
@@ -29,6 +29,11 @@
* the call. Only non-0 if matched is false.
*/
void onChecked(boolean matched, int throttleTimeoutMs);
+
+ /**
+ * Called when the underlying AsyncTask was cancelled.
+ */
+ default void onCancelled() {}
}
/**
@@ -110,6 +115,11 @@
protected void onPostExecute(Boolean result) {
callback.onChecked(result, mThrottleTimeout);
}
+
+ @Override
+ protected void onCancelled() {
+ callback.onCancelled();
+ }
};
task.execute();
return task;
@@ -217,6 +227,11 @@
protected void onPostExecute(Boolean result) {
callback.onChecked(result, mThrottleTimeout);
}
+
+ @Override
+ protected void onCancelled() {
+ callback.onCancelled();
+ }
};
task.execute();
return task;