|
|
|
@ -2643,6 +2643,10 @@ public class Helper {
|
|
|
|
|
static void authenticate(final FragmentActivity activity, final LifecycleOwner owner,
|
|
|
|
|
Boolean enabled, final
|
|
|
|
|
Runnable authenticated, final Runnable cancelled) {
|
|
|
|
|
// https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android12-release/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java#195
|
|
|
|
|
ApplicationEx.getMainHandler().post(new RunnableEx("authenticate") {
|
|
|
|
|
@Override
|
|
|
|
|
public void delegate() {
|
|
|
|
|
Log.i("Authenticate " + activity);
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
|
|
|
@ -2730,6 +2734,7 @@ public class Helper {
|
|
|
|
|
@Override
|
|
|
|
|
public void delegate() {
|
|
|
|
|
try {
|
|
|
|
|
Log.i("Authenticate cancel prompt");
|
|
|
|
|
prompt.cancelAuthentication();
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
@ -2870,6 +2875,8 @@ public class Helper {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void setAuthenticated(Context context) {
|
|
|
|
|
Date now = new Date();
|
|
|
|
|