Loading services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/HidlToAidlSensorAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class HidlToAidlSensorAdapter extends Sensor implements IHwBinder.DeathRe gestureAvailabilityDispatcher, () -> mCurrentUserId, getUserSwitchCallback())); mLockoutTracker = new LockoutFrameworkImpl(getContext(), userId -> mLockoutResetDispatcher.notifyLockoutResetCallbacks( getSensorProperties().sensorId)); getSensorProperties().sensorId), getHandler()); } @Override Loading services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java +15 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.biometrics.sensors.fingerprint.hidl; import static android.Manifest.permission.RESET_FINGERPRINT_LOCKOUT; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; Loading Loading @@ -81,19 +82,30 @@ public class LockoutFrameworkImpl implements LockoutTracker { @NonNull LockoutResetCallback lockoutResetCallback) { this(context, lockoutResetCallback, (userId) -> PendingIntent.getBroadcast(context, userId, new Intent(ACTION_LOCKOUT_RESET).putExtra(KEY_LOCKOUT_RESET_USER, userId), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE)); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE), null /* handler */); } public LockoutFrameworkImpl(@NonNull Context context, @NonNull LockoutResetCallback lockoutResetCallback, @NonNull Handler handler) { this(context, lockoutResetCallback, (userId) -> PendingIntent.getBroadcast(context, userId, new Intent(ACTION_LOCKOUT_RESET).putExtra(KEY_LOCKOUT_RESET_USER, userId), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE), handler); } @VisibleForTesting LockoutFrameworkImpl(@NonNull Context context, @NonNull LockoutResetCallback lockoutResetCallback, @NonNull Function<Integer, PendingIntent> lockoutResetIntent) { @NonNull Function<Integer, PendingIntent> lockoutResetIntent, @Nullable Handler handler) { mLockoutResetCallback = lockoutResetCallback; mTimedLockoutCleared = new SparseBooleanArray(); mFailedAttempts = new SparseIntArray(); mAlarmManager = context.getSystemService(AlarmManager.class); mLockoutReceiver = new LockoutReceiver(); mHandler = new Handler(Looper.getMainLooper()); mHandler = handler == null ? new Handler(Looper.getMainLooper()) : handler; mLockoutResetIntent = lockoutResetIntent; context.registerReceiver(mLockoutReceiver, new IntentFilter(ACTION_LOCKOUT_RESET), Loading services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/hidl/HidlToAidlSensorAdapterTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvide import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintResetLockoutClient; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; Loading Loading @@ -248,7 +247,6 @@ public class HidlToAidlSensorAdapterTest { } @Test @Ignore("b/317403648") public void lockoutPermanentResetViaClient() { setLockoutPermanent(); Loading Loading
services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/HidlToAidlSensorAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class HidlToAidlSensorAdapter extends Sensor implements IHwBinder.DeathRe gestureAvailabilityDispatcher, () -> mCurrentUserId, getUserSwitchCallback())); mLockoutTracker = new LockoutFrameworkImpl(getContext(), userId -> mLockoutResetDispatcher.notifyLockoutResetCallbacks( getSensorProperties().sensorId)); getSensorProperties().sensorId), getHandler()); } @Override Loading
services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java +15 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.biometrics.sensors.fingerprint.hidl; import static android.Manifest.permission.RESET_FINGERPRINT_LOCKOUT; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; Loading Loading @@ -81,19 +82,30 @@ public class LockoutFrameworkImpl implements LockoutTracker { @NonNull LockoutResetCallback lockoutResetCallback) { this(context, lockoutResetCallback, (userId) -> PendingIntent.getBroadcast(context, userId, new Intent(ACTION_LOCKOUT_RESET).putExtra(KEY_LOCKOUT_RESET_USER, userId), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE)); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE), null /* handler */); } public LockoutFrameworkImpl(@NonNull Context context, @NonNull LockoutResetCallback lockoutResetCallback, @NonNull Handler handler) { this(context, lockoutResetCallback, (userId) -> PendingIntent.getBroadcast(context, userId, new Intent(ACTION_LOCKOUT_RESET).putExtra(KEY_LOCKOUT_RESET_USER, userId), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE), handler); } @VisibleForTesting LockoutFrameworkImpl(@NonNull Context context, @NonNull LockoutResetCallback lockoutResetCallback, @NonNull Function<Integer, PendingIntent> lockoutResetIntent) { @NonNull Function<Integer, PendingIntent> lockoutResetIntent, @Nullable Handler handler) { mLockoutResetCallback = lockoutResetCallback; mTimedLockoutCleared = new SparseBooleanArray(); mFailedAttempts = new SparseIntArray(); mAlarmManager = context.getSystemService(AlarmManager.class); mLockoutReceiver = new LockoutReceiver(); mHandler = new Handler(Looper.getMainLooper()); mHandler = handler == null ? new Handler(Looper.getMainLooper()) : handler; mLockoutResetIntent = lockoutResetIntent; context.registerReceiver(mLockoutReceiver, new IntentFilter(ACTION_LOCKOUT_RESET), Loading
services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/hidl/HidlToAidlSensorAdapterTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvide import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintResetLockoutClient; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; Loading Loading @@ -248,7 +247,6 @@ public class HidlToAidlSensorAdapterTest { } @Test @Ignore("b/317403648") public void lockoutPermanentResetViaClient() { setLockoutPermanent(); Loading