Add a flag for moving UdfpsEnroll* from SystemUI to settings.
- Adds SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS flag to guard the change. - Remove the black fp drawable in udfps_fpm_other_view.xml - Uses UdfpsFpmOtherViewController when the flag is enabled, so that SystemUI doesn't show anything for settings enrollment. Turn this flag on via adb: adb shell setprop sys.fflag.override.settings_show_udfps_enroll_in_settings true Test: manually tested on device Bug: 260617060 Change-Id: I1842c4351041fdabc16bde9d5d5a708efb258cb2
This commit is contained in:
@@ -464,6 +464,12 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
* @param remaining The number of remaining steps
|
||||
*/
|
||||
public void onEnrollmentProgress(int remaining) { }
|
||||
|
||||
/**
|
||||
* Called when a fingerprint image has been acquired.
|
||||
* @param isAcquiredGood whether the fingerprint image was good.
|
||||
*/
|
||||
public void onAcquired(boolean isAcquiredGood){ }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1392,6 +1398,9 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
if (mAuthenticationCallback != null) {
|
||||
mAuthenticationCallback.onAuthenticationAcquired(acquireInfo);
|
||||
}
|
||||
if (mEnrollmentCallback != null) {
|
||||
mEnrollmentCallback.onAcquired(acquireInfo == FINGERPRINT_ACQUIRED_GOOD);
|
||||
}
|
||||
final String msg = getAcquiredString(mContext, acquireInfo, vendorCode);
|
||||
if (msg == null) {
|
||||
return;
|
||||
|
||||
@@ -151,6 +151,14 @@ public class FeatureFlagUtils {
|
||||
*/
|
||||
public static final String SETTINGS_FLASH_ALERTS = "settings_flash_alerts";
|
||||
|
||||
/**
|
||||
* Flag to disable/enable showing udfps enroll view in settings. If it's disabled, udfps enroll
|
||||
* view is shown in system ui.
|
||||
* @hide
|
||||
*/
|
||||
public static final String SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS =
|
||||
"settings_show_udfps_enroll_in_settings";
|
||||
|
||||
private static final Map<String, String> DEFAULT_FLAGS;
|
||||
|
||||
static {
|
||||
@@ -190,6 +198,7 @@ public class FeatureFlagUtils {
|
||||
DEFAULT_FLAGS.put(SETTINGS_ACCESSIBILITY_HEARING_AID_PAGE, "false");
|
||||
DEFAULT_FLAGS.put(SETTINGS_AUDIO_ROUTING, "false");
|
||||
DEFAULT_FLAGS.put(SETTINGS_FLASH_ALERTS, "false");
|
||||
DEFAULT_FLAGS.put(SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS, "false");
|
||||
}
|
||||
|
||||
private static final Set<String> PERSISTENT_FLAGS;
|
||||
|
||||
@@ -80,8 +80,8 @@
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDrawable.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpDrawable.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherView.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherViewController.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmEmptyView.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmEmptyViewController.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsHapticsSimulator.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsOverlayParams.kt
|
||||
-packages/SystemUI/src/com/android/systemui/biometrics/UdfpsShell.kt
|
||||
|
||||
@@ -14,15 +14,9 @@
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<com.android.systemui.biometrics.UdfpsFpmOtherView
|
||||
<com.android.systemui.biometrics.UdfpsFpmEmptyView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/udfps_animation_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- Fingerprint -->
|
||||
<ImageView
|
||||
android:id="@+id/udfps_fpm_other_fp_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</com.android.systemui.biometrics.UdfpsFpmOtherView>
|
||||
</com.android.systemui.biometrics.UdfpsFpmEmptyView>
|
||||
@@ -33,6 +33,7 @@ import android.hardware.fingerprint.IUdfpsOverlayControllerCallback
|
||||
import android.os.Build
|
||||
import android.os.RemoteException
|
||||
import android.provider.Settings
|
||||
import android.util.FeatureFlagUtils
|
||||
import android.util.Log
|
||||
import android.util.RotationUtils
|
||||
import android.view.LayoutInflater
|
||||
@@ -232,18 +233,30 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
|
||||
return when (filteredRequestReason) {
|
||||
REASON_ENROLL_FIND_SENSOR,
|
||||
REASON_ENROLL_ENROLLING -> {
|
||||
UdfpsEnrollViewController(
|
||||
view.addUdfpsView(R.layout.udfps_enroll_view) {
|
||||
updateSensorLocation(sensorBounds)
|
||||
},
|
||||
enrollHelper ?: throw IllegalStateException("no enrollment helper"),
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
dialogManager,
|
||||
dumpManager,
|
||||
featureFlags,
|
||||
overlayParams.scaleFactor
|
||||
)
|
||||
if (FeatureFlagUtils.isEnabled(context,
|
||||
FeatureFlagUtils.SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS)) {
|
||||
// Enroll udfps UI is handled by settings, so use empty view here
|
||||
UdfpsFpmEmptyViewController(
|
||||
view.addUdfpsView(R.layout.udfps_fpm_empty_view),
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
dialogManager,
|
||||
dumpManager
|
||||
)
|
||||
} else {
|
||||
UdfpsEnrollViewController(
|
||||
view.addUdfpsView(R.layout.udfps_enroll_view) {
|
||||
updateSensorLocation(sensorBounds)
|
||||
},
|
||||
enrollHelper ?: throw IllegalStateException("no enrollment helper"),
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
dialogManager,
|
||||
dumpManager,
|
||||
featureFlags,
|
||||
overlayParams.scaleFactor
|
||||
)
|
||||
}
|
||||
}
|
||||
REASON_AUTH_KEYGUARD -> {
|
||||
UdfpsKeyguardViewController(
|
||||
@@ -277,8 +290,8 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
|
||||
}
|
||||
REASON_AUTH_OTHER,
|
||||
REASON_AUTH_SETTINGS -> {
|
||||
UdfpsFpmOtherViewController(
|
||||
view.addUdfpsView(R.layout.udfps_fpm_other_view),
|
||||
UdfpsFpmEmptyViewController(
|
||||
view.addUdfpsView(R.layout.udfps_fpm_empty_view),
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
dialogManager,
|
||||
|
||||
@@ -17,24 +17,19 @@ package com.android.systemui.biometrics
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import com.android.systemui.R
|
||||
|
||||
/**
|
||||
* View corresponding with udfps_fpm_other_view.xml
|
||||
* View corresponding with udfps_fpm_empty_view.xml
|
||||
*
|
||||
* Currently doesn't draw anything.
|
||||
*/
|
||||
class UdfpsFpmOtherView(
|
||||
class UdfpsFpmEmptyView(
|
||||
context: Context,
|
||||
attrs: AttributeSet?
|
||||
) : UdfpsAnimationView(context, attrs) {
|
||||
|
||||
// Drawable isn't ever added to the view, so we don't currently show anything
|
||||
private val fingerprintDrawable: UdfpsFpDrawable = UdfpsFpDrawable(context)
|
||||
private lateinit var fingerprintView: ImageView
|
||||
|
||||
override fun onFinishInflate() {
|
||||
fingerprintView = findViewById(R.id.udfps_fpm_other_fp_view)!!
|
||||
fingerprintView.setImageDrawable(fingerprintDrawable)
|
||||
}
|
||||
|
||||
override fun getDrawable(): UdfpsDrawable = fingerprintDrawable
|
||||
}
|
||||
@@ -21,18 +21,17 @@ import com.android.systemui.shade.ShadeExpansionStateManager
|
||||
import com.android.systemui.statusbar.phone.SystemUIDialogManager
|
||||
|
||||
/**
|
||||
* Class that coordinates non-HBM animations for non keyguard, enrollment or biometric prompt
|
||||
* states.
|
||||
* Class that coordinates non-HBM animations for non keyguard, or biometric prompt states.
|
||||
*
|
||||
* Currently only shows the fp drawable.
|
||||
* Currently doesn't draw anything.
|
||||
*/
|
||||
class UdfpsFpmOtherViewController(
|
||||
view: UdfpsFpmOtherView,
|
||||
class UdfpsFpmEmptyViewController(
|
||||
view: UdfpsFpmEmptyView,
|
||||
statusBarStateController: StatusBarStateController,
|
||||
shadeExpansionStateManager: ShadeExpansionStateManager,
|
||||
systemUIDialogManager: SystemUIDialogManager,
|
||||
dumpManager: DumpManager
|
||||
) : UdfpsAnimationViewController<UdfpsFpmOtherView>(
|
||||
) : UdfpsAnimationViewController<UdfpsFpmEmptyView>(
|
||||
view,
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
@@ -124,8 +124,8 @@ class UdfpsControllerOverlayTest : SysuiTestCase() {
|
||||
.thenReturn(mock(UdfpsBpView::class.java))
|
||||
whenever(inflater.inflate(R.layout.udfps_keyguard_view, null))
|
||||
.thenReturn(mock(UdfpsKeyguardView::class.java))
|
||||
whenever(inflater.inflate(R.layout.udfps_fpm_other_view, null))
|
||||
.thenReturn(mock(UdfpsFpmOtherView::class.java))
|
||||
whenever(inflater.inflate(R.layout.udfps_fpm_empty_view, null))
|
||||
.thenReturn(mock(UdfpsFpmEmptyView::class.java))
|
||||
whenever(udfpsEnrollView.context).thenReturn(context)
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private UdfpsBpView mBpView;
|
||||
@Mock
|
||||
private UdfpsFpmOtherView mFpmOtherView;
|
||||
private UdfpsFpmEmptyView mFpmEmptyView;
|
||||
@Mock
|
||||
private UdfpsKeyguardView mKeyguardView;
|
||||
private final UdfpsAnimationViewController mUdfpsKeyguardViewController =
|
||||
@@ -240,8 +240,8 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
.thenReturn(mKeyguardView); // for showOverlay REASON_AUTH_FPM_KEYGUARD
|
||||
when(mLayoutInflater.inflate(R.layout.udfps_bp_view, null))
|
||||
.thenReturn(mBpView);
|
||||
when(mLayoutInflater.inflate(R.layout.udfps_fpm_other_view, null))
|
||||
.thenReturn(mFpmOtherView);
|
||||
when(mLayoutInflater.inflate(R.layout.udfps_fpm_empty_view, null))
|
||||
.thenReturn(mFpmEmptyView);
|
||||
when(mEnrollView.getContext()).thenReturn(mContext);
|
||||
when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
|
||||
when(mSessionTracker.getSessionId(anyInt())).thenReturn(
|
||||
|
||||
Reference in New Issue
Block a user