summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/dagger/BiometricsModule.kt45
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt66
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/Flags.kt1
5 files changed, 45 insertions, 79 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 9ffb770378c5..026435623042 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -23,6 +23,7 @@ import static android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_
import static android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD;
import static android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_ENROLLING;
import static android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_FIND_SENSOR;
+
import static com.android.internal.util.Preconditions.checkNotNull;
import static com.android.systemui.classifier.Classifier.UDFPS_AUTHENTICATION;
import static com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION;
@@ -104,6 +105,8 @@ import com.android.systemui.util.concurrency.Execution;
import com.android.systemui.util.settings.SecureSettings;
import com.android.systemui.util.time.SystemClock;
+import kotlin.Unit;
+
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
@@ -114,8 +117,6 @@ import java.util.concurrent.Executor;
import javax.inject.Inject;
import javax.inject.Provider;
-import kotlin.Unit;
-
import kotlinx.coroutines.ExperimentalCoroutinesApi;
/**
@@ -255,11 +256,12 @@ public class UdfpsController implements DozeReceiver, Dumpable {
@Override
public void dump(@NonNull PrintWriter pw, @NonNull String[] args) {
+ final int touchConfigId = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_selected_udfps_touch_detection);
pw.println("mSensorProps=(" + mSensorProps + ")");
pw.println("Using new touch detection framework: " + mFeatureFlags.isEnabled(
Flags.UDFPS_NEW_TOUCH_DETECTION));
- pw.println("Using ellipse touch detection: " + mFeatureFlags.isEnabled(
- Flags.UDFPS_ELLIPSE_DETECTION));
+ pw.println("touchConfigId: " + touchConfigId);
}
public class UdfpsOverlayController extends IUdfpsOverlayController.Stub {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/BiometricsModule.kt b/packages/SystemUI/src/com/android/systemui/biometrics/dagger/BiometricsModule.kt
index 599e9fcc0c7d..f2d4f8912c3f 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/BiometricsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/dagger/BiometricsModule.kt
@@ -17,6 +17,9 @@
package com.android.systemui.biometrics.dagger
import com.android.systemui.biometrics.UdfpsUtils
+import android.content.res.Resources
+import com.android.internal.R
+import com.android.systemui.biometrics.EllipseOverlapDetectorParams
import com.android.systemui.biometrics.data.repository.FacePropertyRepository
import com.android.systemui.biometrics.data.repository.FacePropertyRepositoryImpl
import com.android.systemui.biometrics.data.repository.FaceSettingsRepository
@@ -37,6 +40,9 @@ import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteracto
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractorImpl
import com.android.systemui.biometrics.domain.interactor.SideFpsOverlayInteractor
import com.android.systemui.biometrics.domain.interactor.SideFpsOverlayInteractorImpl
+import com.android.systemui.biometrics.udfps.BoundingBoxOverlapDetector
+import com.android.systemui.biometrics.udfps.EllipseOverlapDetector
+import com.android.systemui.biometrics.udfps.OverlapDetector
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.util.concurrency.ThreadFactory
import dagger.Binds
@@ -63,8 +69,9 @@ interface BiometricsModule {
@Binds
@SysUISingleton
- fun fingerprintRepository(impl: FingerprintPropertyRepositoryImpl):
- FingerprintPropertyRepository
+ fun fingerprintRepository(
+ impl: FingerprintPropertyRepositoryImpl
+ ): FingerprintPropertyRepository
@Binds
@SysUISingleton
@@ -72,8 +79,9 @@ interface BiometricsModule {
@Binds
@SysUISingleton
- fun providesPromptSelectorInteractor(impl: PromptSelectorInteractorImpl):
- PromptSelectorInteractor
+ fun providesPromptSelectorInteractor(
+ impl: PromptSelectorInteractorImpl
+ ): PromptSelectorInteractor
@Binds
@SysUISingleton
@@ -89,8 +97,9 @@ interface BiometricsModule {
@Binds
@SysUISingleton
- fun providesSideFpsOverlayInteractor(impl: SideFpsOverlayInteractorImpl):
- SideFpsOverlayInteractor
+ fun providesSideFpsOverlayInteractor(
+ impl: SideFpsOverlayInteractorImpl
+ ): SideFpsOverlayInteractor
companion object {
/** Background [Executor] for HAL related operations. */
@@ -103,6 +112,30 @@ interface BiometricsModule {
@Provides
fun providesUdfpsUtils(): UdfpsUtils = UdfpsUtils()
+
+ @Provides
+ @SysUISingleton
+ fun providesOverlapDetector(): OverlapDetector {
+ val selectedOption =
+ Resources.getSystem().getInteger(R.integer.config_selected_udfps_touch_detection)
+ val values =
+ Resources.getSystem()
+ .getStringArray(R.array.config_udfps_touch_detection_options)[selectedOption]
+ .split(",")
+ .map { it.toFloat() }
+
+ return if (values[0] == 1f) {
+ EllipseOverlapDetector(
+ EllipseOverlapDetectorParams(
+ minOverlap = values[3],
+ targetSize = values[2],
+ stepSize = values[4].toInt()
+ )
+ )
+ } else {
+ BoundingBoxOverlapDetector(values[2])
+ }
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt b/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt
deleted file mode 100644
index f7f910391566..000000000000
--- a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.biometrics.dagger
-
-import android.content.res.Resources
-import com.android.internal.R
-import com.android.systemui.biometrics.EllipseOverlapDetectorParams
-import com.android.systemui.biometrics.udfps.BoundingBoxOverlapDetector
-import com.android.systemui.biometrics.udfps.EllipseOverlapDetector
-import com.android.systemui.biometrics.udfps.OverlapDetector
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
-import dagger.Module
-import dagger.Provides
-
-/** Dagger module for all things UDFPS. TODO(b/260558624): Move to BiometricsModule. */
-@Module
-interface UdfpsModule {
- companion object {
-
- @Provides
- @SysUISingleton
- fun providesOverlapDetector(featureFlags: FeatureFlags): OverlapDetector {
- if (featureFlags.isEnabled(Flags.UDFPS_ELLIPSE_DETECTION)) {
- val selectedOption =
- Resources.getSystem()
- .getInteger(R.integer.config_selected_udfps_touch_detection)
- val values =
- Resources.getSystem()
- .getStringArray(R.array.config_udfps_touch_detection_options)[
- selectedOption]
- .split(",")
- .map { it.toFloat() }
-
- return if (values[0] == 1f) {
- EllipseOverlapDetector(
- EllipseOverlapDetectorParams(
- minOverlap = values[3],
- targetSize = values[2],
- stepSize = values[4].toInt()
- )
- )
- } else {
- BoundingBoxOverlapDetector(values[2])
- }
- } else {
- return BoundingBoxOverlapDetector(1f)
- }
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 7ee0ff4568be..3a942bd8203f 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -37,7 +37,6 @@ import com.android.systemui.biometrics.AlternateUdfpsTouchProvider;
import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider;
import com.android.systemui.biometrics.UdfpsDisplayModeProvider;
import com.android.systemui.biometrics.dagger.BiometricsModule;
-import com.android.systemui.biometrics.dagger.UdfpsModule;
import com.android.systemui.bouncer.ui.BouncerViewModule;
import com.android.systemui.classifier.FalsingModule;
import com.android.systemui.clipboardoverlay.dagger.ClipboardOverlayModule;
@@ -207,7 +206,6 @@ import javax.inject.Named;
TelephonyRepositoryModule.class,
TemporaryDisplayModule.class,
TunerModule.class,
- UdfpsModule.class,
UserModule.class,
UtilModule.class,
NoteTaskModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
index 7e8f68225070..37a957295646 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
@@ -662,7 +662,6 @@ object Flags {
// 2200 - biometrics (udfps, sfps, BiometricPrompt, etc.)
// TODO(b/259264861): Tracking Bug
@JvmField val UDFPS_NEW_TOUCH_DETECTION = releasedFlag("udfps_new_touch_detection")
- @JvmField val UDFPS_ELLIPSE_DETECTION = releasedFlag("udfps_ellipse_detection")
// 2300 - stylus
@JvmField val TRACK_STYLUS_EVER_USED = releasedFlag("track_stylus_ever_used")