Merge "Show ripple effect on rear fp auth" into sc-dev am: 6a01a5507c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14441366 Change-Id: I21de8b703a864888287d69b0ce76d7310f3857b2
This commit is contained in:
@@ -54,14 +54,16 @@ import com.android.internal.R;
|
|||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.os.SomeArgs;
|
import com.android.internal.os.SomeArgs;
|
||||||
import com.android.systemui.SystemUI;
|
import com.android.systemui.SystemUI;
|
||||||
|
import com.android.systemui.assist.ui.DisplayUtils;
|
||||||
import com.android.systemui.dagger.SysUISingleton;
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
import com.android.systemui.doze.DozeReceiver;
|
import com.android.systemui.doze.DozeReceiver;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Provider;
|
import javax.inject.Provider;
|
||||||
@@ -79,13 +81,14 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
|
|
||||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||||
private final CommandQueue mCommandQueue;
|
private final CommandQueue mCommandQueue;
|
||||||
private final StatusBarStateController mStatusBarStateController;
|
|
||||||
private final ActivityTaskManager mActivityTaskManager;
|
private final ActivityTaskManager mActivityTaskManager;
|
||||||
@Nullable private final FingerprintManager mFingerprintManager;
|
@Nullable private final FingerprintManager mFingerprintManager;
|
||||||
@Nullable private final FaceManager mFaceManager;
|
@Nullable private final FaceManager mFaceManager;
|
||||||
private final Provider<UdfpsController> mUdfpsControllerFactory;
|
private final Provider<UdfpsController> mUdfpsControllerFactory;
|
||||||
private final Provider<SidefpsController> mSidefpsControllerFactory;
|
private final Provider<SidefpsController> mSidefpsControllerFactory;
|
||||||
@Nullable private final PointF mFaceAuthSensorLocation;
|
@Nullable private final PointF mFaceAuthSensorLocation;
|
||||||
|
@Nullable private final PointF mFingerprintLocation;
|
||||||
|
private final Set<Callback> mCallbacks = new HashSet<>();
|
||||||
|
|
||||||
// TODO: These should just be saved from onSaveState
|
// TODO: These should just be saved from onSaveState
|
||||||
private SomeArgs mCurrentDialogArgs;
|
private SomeArgs mCurrentDialogArgs;
|
||||||
@@ -142,6 +145,10 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
if (mSidefpsProps != null) {
|
if (mSidefpsProps != null) {
|
||||||
mSidefpsController = mSidefpsControllerFactory.get();
|
mSidefpsController = mSidefpsControllerFactory.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Callback cb : mCallbacks) {
|
||||||
|
cb.onAllAuthenticatorsRegistered();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -195,6 +202,20 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a callback. See {@link Callback}.
|
||||||
|
*/
|
||||||
|
public void addCallback(@NonNull Callback callback) {
|
||||||
|
mCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a callback. See {@link Callback}.
|
||||||
|
*/
|
||||||
|
public void removeCallback(@NonNull Callback callback) {
|
||||||
|
mCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dozeTimeTick() {
|
public void dozeTimeTick() {
|
||||||
if (mUdfpsController != null) {
|
if (mUdfpsController != null) {
|
||||||
@@ -334,6 +355,17 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
mUdfpsController.getSensorLocation().centerY());
|
mUdfpsController.getSensorLocation().centerY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return where the fingerprint sensor exists in pixels in portrait mode. devices without an
|
||||||
|
* overridden value will use the default value even if they don't have a fingerprint sensor
|
||||||
|
*/
|
||||||
|
@Nullable public PointF getFingerprintSensorLocation() {
|
||||||
|
if (getUdfpsSensorLocation() != null) {
|
||||||
|
return getUdfpsSensorLocation();
|
||||||
|
}
|
||||||
|
return mFingerprintLocation;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return where the face authentication sensor exists relative to the screen in pixels in
|
* @return where the face authentication sensor exists relative to the screen in pixels in
|
||||||
* portrait mode.
|
* portrait mode.
|
||||||
@@ -387,7 +419,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AuthController(Context context, CommandQueue commandQueue,
|
public AuthController(Context context, CommandQueue commandQueue,
|
||||||
StatusBarStateController statusBarStateController,
|
|
||||||
ActivityTaskManager activityTaskManager,
|
ActivityTaskManager activityTaskManager,
|
||||||
@Nullable FingerprintManager fingerprintManager,
|
@Nullable FingerprintManager fingerprintManager,
|
||||||
@Nullable FaceManager faceManager,
|
@Nullable FaceManager faceManager,
|
||||||
@@ -395,7 +426,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
Provider<SidefpsController> sidefpsControllerFactory) {
|
Provider<SidefpsController> sidefpsControllerFactory) {
|
||||||
super(context);
|
super(context);
|
||||||
mCommandQueue = commandQueue;
|
mCommandQueue = commandQueue;
|
||||||
mStatusBarStateController = statusBarStateController;
|
|
||||||
mActivityTaskManager = activityTaskManager;
|
mActivityTaskManager = activityTaskManager;
|
||||||
mFingerprintManager = fingerprintManager;
|
mFingerprintManager = fingerprintManager;
|
||||||
mFaceManager = faceManager;
|
mFaceManager = faceManager;
|
||||||
@@ -414,6 +444,10 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
(float) faceAuthLocation[1]);
|
(float) faceAuthLocation[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mFingerprintLocation = new PointF(DisplayUtils.getWidth(mContext) / 2,
|
||||||
|
mContext.getResources().getDimensionPixelSize(
|
||||||
|
com.android.systemui.R.dimen.physical_fingerprint_sensor_center_screen_location_y));
|
||||||
|
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
||||||
|
|
||||||
@@ -711,4 +745,12 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
.setMultiSensorConfig(multiSensorConfig)
|
.setMultiSensorConfig(multiSensorConfig)
|
||||||
.build(sensorIds, credentialAllowed, mFpProps, mFaceProps);
|
.build(sensorIds, credentialAllowed, mFpProps, mFaceProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Callback {
|
||||||
|
/**
|
||||||
|
* Called when authenticators are registered. If authenticators are already
|
||||||
|
* registered before this call, this callback will never be triggered.
|
||||||
|
*/
|
||||||
|
void onAllAuthenticatorsRegistered();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController
|
|||||||
import com.android.systemui.statusbar.commandline.Command
|
import com.android.systemui.statusbar.commandline.Command
|
||||||
import com.android.systemui.statusbar.commandline.CommandRegistry
|
import com.android.systemui.statusbar.commandline.CommandRegistry
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBypassController
|
import com.android.systemui.statusbar.phone.KeyguardBypassController
|
||||||
|
import com.android.systemui.statusbar.phone.StatusBar
|
||||||
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope
|
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController
|
import com.android.systemui.statusbar.policy.ConfigurationController
|
||||||
import com.android.systemui.util.ViewController
|
import com.android.systemui.util.ViewController
|
||||||
@@ -40,6 +41,7 @@ import javax.inject.Inject
|
|||||||
*/
|
*/
|
||||||
@StatusBarScope
|
@StatusBarScope
|
||||||
class AuthRippleController @Inject constructor(
|
class AuthRippleController @Inject constructor(
|
||||||
|
private val statusBar: StatusBar,
|
||||||
private val sysuiContext: Context,
|
private val sysuiContext: Context,
|
||||||
private val authController: AuthController,
|
private val authController: AuthController,
|
||||||
private val configurationController: ConfigurationController,
|
private val configurationController: ConfigurationController,
|
||||||
@@ -49,13 +51,14 @@ class AuthRippleController @Inject constructor(
|
|||||||
private val bypassController: KeyguardBypassController,
|
private val bypassController: KeyguardBypassController,
|
||||||
rippleView: AuthRippleView?
|
rippleView: AuthRippleView?
|
||||||
) : ViewController<AuthRippleView>(rippleView) {
|
) : ViewController<AuthRippleView>(rippleView) {
|
||||||
private var fingerprintSensorLocation: PointF? = null
|
var fingerprintSensorLocation: PointF? = null
|
||||||
private var faceSensorLocation: PointF? = null
|
private var faceSensorLocation: PointF? = null
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public override fun onViewAttached() {
|
public override fun onViewAttached() {
|
||||||
updateRippleColor()
|
updateRippleColor()
|
||||||
updateSensorLocation()
|
updateSensorLocation()
|
||||||
|
authController.addCallback(authControllerCallback)
|
||||||
configurationController.addCallback(configurationChangedListener)
|
configurationController.addCallback(configurationChangedListener)
|
||||||
keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback)
|
keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback)
|
||||||
commandRegistry.registerCommand("auth-ripple") { AuthRippleCommand() }
|
commandRegistry.registerCommand("auth-ripple") { AuthRippleCommand() }
|
||||||
@@ -63,6 +66,7 @@ class AuthRippleController @Inject constructor(
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public override fun onViewDetached() {
|
public override fun onViewDetached() {
|
||||||
|
authController.removeCallback(authControllerCallback)
|
||||||
keyguardUpdateMonitor.removeCallback(keyguardUpdateMonitorCallback)
|
keyguardUpdateMonitor.removeCallback(keyguardUpdateMonitorCallback)
|
||||||
configurationController.removeCallback(configurationChangedListener)
|
configurationController.removeCallback(configurationChangedListener)
|
||||||
commandRegistry.unregisterCommand("auth-ripple")
|
commandRegistry.unregisterCommand("auth-ripple")
|
||||||
@@ -97,9 +101,10 @@ class AuthRippleController @Inject constructor(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateSensorLocation() {
|
fun updateSensorLocation() {
|
||||||
fingerprintSensorLocation = authController.udfpsSensorLocation
|
fingerprintSensorLocation = authController.fingerprintSensorLocation
|
||||||
faceSensorLocation = authController.faceAuthSensorLocation
|
faceSensorLocation = authController.faceAuthSensorLocation
|
||||||
|
statusBar.updateCircleReveal()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateRippleColor() {
|
private fun updateRippleColor() {
|
||||||
@@ -134,6 +139,8 @@ class AuthRippleController @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val authControllerCallback = AuthController.Callback { updateSensorLocation() }
|
||||||
|
|
||||||
inner class AuthRippleCommand : Command {
|
inner class AuthRippleCommand : Command {
|
||||||
override fun execute(pw: PrintWriter, args: List<String>) {
|
override fun execute(pw: PrintWriter, args: List<String>) {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
|
|||||||
@@ -496,7 +496,6 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
mSensorProps = findFirstUdfps();
|
mSensorProps = findFirstUdfps();
|
||||||
// At least one UDFPS sensor exists
|
// At least one UDFPS sensor exists
|
||||||
checkArgument(mSensorProps != null);
|
checkArgument(mSensorProps != null);
|
||||||
mStatusBar.setSensorRect(getSensorLocation());
|
|
||||||
|
|
||||||
mCoreLayoutParams = new WindowManager.LayoutParams(
|
mCoreLayoutParams = new WindowManager.LayoutParams(
|
||||||
WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG,
|
WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG,
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.PointF;
|
import android.graphics.PointF;
|
||||||
import android.graphics.RectF;
|
|
||||||
import android.media.AudioAttributes;
|
import android.media.AudioAttributes;
|
||||||
import android.metrics.LogMaker;
|
import android.metrics.LogMaker;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -151,6 +150,7 @@ import com.android.systemui.accessibility.floatingmenu.AccessibilityFloatingMenu
|
|||||||
import com.android.systemui.animation.ActivityLaunchAnimator;
|
import com.android.systemui.animation.ActivityLaunchAnimator;
|
||||||
import com.android.systemui.animation.DelegateLaunchAnimatorController;
|
import com.android.systemui.animation.DelegateLaunchAnimatorController;
|
||||||
import com.android.systemui.assist.AssistManager;
|
import com.android.systemui.assist.AssistManager;
|
||||||
|
import com.android.systemui.biometrics.AuthRippleController;
|
||||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||||
import com.android.systemui.camera.CameraIntents;
|
import com.android.systemui.camera.CameraIntents;
|
||||||
import com.android.systemui.charging.WirelessChargingAnimation;
|
import com.android.systemui.charging.WirelessChargingAnimation;
|
||||||
@@ -387,6 +387,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
protected NotificationShadeWindowView mNotificationShadeWindowView;
|
protected NotificationShadeWindowView mNotificationShadeWindowView;
|
||||||
protected StatusBarWindowView mPhoneStatusBarWindow;
|
protected StatusBarWindowView mPhoneStatusBarWindow;
|
||||||
protected PhoneStatusBarView mStatusBarView;
|
protected PhoneStatusBarView mStatusBarView;
|
||||||
|
private AuthRippleController mAuthRippleController;
|
||||||
private int mStatusBarWindowState = WINDOW_STATE_SHOWING;
|
private int mStatusBarWindowState = WINDOW_STATE_SHOWING;
|
||||||
protected NotificationShadeWindowController mNotificationShadeWindowController;
|
protected NotificationShadeWindowController mNotificationShadeWindowController;
|
||||||
protected StatusBarWindowController mStatusBarWindowController;
|
protected StatusBarWindowController mStatusBarWindowController;
|
||||||
@@ -1559,7 +1560,9 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mPhoneStatusBarWindow = mSuperStatusBarViewFactory.getStatusBarWindowView();
|
mPhoneStatusBarWindow = mSuperStatusBarViewFactory.getStatusBarWindowView();
|
||||||
mNotificationPanelViewController = statusBarComponent.getNotificationPanelViewController();
|
mNotificationPanelViewController = statusBarComponent.getNotificationPanelViewController();
|
||||||
statusBarComponent.getLockIconViewController().init();
|
statusBarComponent.getLockIconViewController().init();
|
||||||
statusBarComponent.getAuthRippleController().init();
|
|
||||||
|
mAuthRippleController = statusBarComponent.getAuthRippleController();
|
||||||
|
mAuthRippleController.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startKeyguard() {
|
protected void startKeyguard() {
|
||||||
@@ -3794,7 +3797,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDozeAmountChanged(float linear, float eased) {
|
public void onDozeAmountChanged(float linear, float eased) {
|
||||||
if (mFeatureFlags.useNewLockscreenAnimations()) {
|
if (mFeatureFlags.useNewLockscreenAnimations()
|
||||||
|
&& !mCircleRevealAnimator.isRunning()) {
|
||||||
mLightRevealScrim.setRevealAmount(1f - linear);
|
mLightRevealScrim.setRevealAmount(1f - linear);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3831,6 +3835,23 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the parameters for the dozing circle reveal that animates when the user authenticates
|
||||||
|
* from AOD using the fingerprint sensor.
|
||||||
|
*/
|
||||||
|
public void updateCircleReveal() {
|
||||||
|
final PointF fpLocation = mAuthRippleController.getFingerprintSensorLocation();
|
||||||
|
if (fpLocation != null) {
|
||||||
|
mCircleReveal =
|
||||||
|
new CircleReveal(
|
||||||
|
fpLocation.x,
|
||||||
|
fpLocation.y,
|
||||||
|
0,
|
||||||
|
Math.max(Math.max(fpLocation.x, getDisplayWidth() - fpLocation.x),
|
||||||
|
Math.max(fpLocation.y, getDisplayHeight() - fpLocation.y)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void startCircleReveal() {
|
private void startCircleReveal() {
|
||||||
mLightRevealScrim.setRevealEffect(mCircleReveal);
|
mLightRevealScrim.setRevealEffect(mCircleReveal);
|
||||||
mCircleRevealAnimator.cancel();
|
mCircleRevealAnimator.cancel();
|
||||||
@@ -3843,7 +3864,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
private boolean shouldShowCircleReveal() {
|
private boolean shouldShowCircleReveal() {
|
||||||
return mCircleReveal != null && !mCircleRevealAnimator.isRunning()
|
return mCircleReveal != null && !mCircleRevealAnimator.isRunning()
|
||||||
&& mKeyguardUpdateMonitor.isUdfpsEnrolled()
|
|
||||||
&& mBiometricUnlockController.getBiometricType() == FINGERPRINT;
|
&& mBiometricUnlockController.getBiometricType() == FINGERPRINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4306,15 +4326,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
updateScrimController();
|
updateScrimController();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the location of the sensor on UDFPS if existent.
|
|
||||||
*/
|
|
||||||
public void setSensorRect(RectF rect) {
|
|
||||||
final float startRadius = (rect.right - rect.left) / 2f;
|
|
||||||
mCircleReveal = new CircleReveal(rect.centerX(), rect.centerY(),
|
|
||||||
startRadius, rect.centerY() - startRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public void updateScrimController() {
|
public void updateScrimController() {
|
||||||
Trace.beginSection("StatusBar#updateScrimController");
|
Trace.beginSection("StatusBar#updateScrimController");
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ import android.testing.TestableLooper.RunWithLooper;
|
|||||||
|
|
||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -96,8 +95,6 @@ public class AuthControllerTest extends SysuiTestCase {
|
|||||||
@Mock
|
@Mock
|
||||||
private CommandQueue mCommandQueue;
|
private CommandQueue mCommandQueue;
|
||||||
@Mock
|
@Mock
|
||||||
private StatusBarStateController mStatusBarStateController;
|
|
||||||
@Mock
|
|
||||||
private ActivityTaskManager mActivityTaskManager;
|
private ActivityTaskManager mActivityTaskManager;
|
||||||
@Mock
|
@Mock
|
||||||
private FingerprintManager mFingerprintManager;
|
private FingerprintManager mFingerprintManager;
|
||||||
@@ -152,7 +149,7 @@ public class AuthControllerTest extends SysuiTestCase {
|
|||||||
when(mFingerprintManager.getSensorPropertiesInternal()).thenReturn(props);
|
when(mFingerprintManager.getSensorPropertiesInternal()).thenReturn(props);
|
||||||
|
|
||||||
mAuthController = new TestableAuthController(context, mCommandQueue,
|
mAuthController = new TestableAuthController(context, mCommandQueue,
|
||||||
mStatusBarStateController, mActivityTaskManager, mFingerprintManager, mFaceManager,
|
mActivityTaskManager, mFingerprintManager, mFaceManager,
|
||||||
() -> mUdfpsController, () -> mSidefpsController);
|
() -> mUdfpsController, () -> mSidefpsController);
|
||||||
|
|
||||||
mAuthController.start();
|
mAuthController.start();
|
||||||
@@ -561,13 +558,12 @@ public class AuthControllerTest extends SysuiTestCase {
|
|||||||
private PromptInfo mLastBiometricPromptInfo;
|
private PromptInfo mLastBiometricPromptInfo;
|
||||||
|
|
||||||
TestableAuthController(Context context, CommandQueue commandQueue,
|
TestableAuthController(Context context, CommandQueue commandQueue,
|
||||||
StatusBarStateController statusBarStateController,
|
|
||||||
ActivityTaskManager activityTaskManager,
|
ActivityTaskManager activityTaskManager,
|
||||||
FingerprintManager fingerprintManager,
|
FingerprintManager fingerprintManager,
|
||||||
FaceManager faceManager,
|
FaceManager faceManager,
|
||||||
Provider<UdfpsController> udfpsControllerFactory,
|
Provider<UdfpsController> udfpsControllerFactory,
|
||||||
Provider<SidefpsController> sidefpsControllerFactory) {
|
Provider<SidefpsController> sidefpsControllerFactory) {
|
||||||
super(context, commandQueue, statusBarStateController, activityTaskManager,
|
super(context, commandQueue, activityTaskManager,
|
||||||
fingerprintManager, faceManager, udfpsControllerFactory,
|
fingerprintManager, faceManager, udfpsControllerFactory,
|
||||||
sidefpsControllerFactory);
|
sidefpsControllerFactory);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.android.systemui.SysuiTestCase
|
|||||||
import com.android.systemui.statusbar.NotificationShadeWindowController
|
import com.android.systemui.statusbar.NotificationShadeWindowController
|
||||||
import com.android.systemui.statusbar.commandline.CommandRegistry
|
import com.android.systemui.statusbar.commandline.CommandRegistry
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBypassController
|
import com.android.systemui.statusbar.phone.KeyguardBypassController
|
||||||
|
import com.android.systemui.statusbar.phone.StatusBar
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController
|
import com.android.systemui.statusbar.policy.ConfigurationController
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@@ -44,6 +45,7 @@ import org.mockito.MockitoAnnotations
|
|||||||
@RunWith(AndroidTestingRunner::class)
|
@RunWith(AndroidTestingRunner::class)
|
||||||
class AuthRippleControllerTest : SysuiTestCase() {
|
class AuthRippleControllerTest : SysuiTestCase() {
|
||||||
private lateinit var controller: AuthRippleController
|
private lateinit var controller: AuthRippleController
|
||||||
|
@Mock private lateinit var statusBar: StatusBar
|
||||||
@Mock private lateinit var rippleView: AuthRippleView
|
@Mock private lateinit var rippleView: AuthRippleView
|
||||||
@Mock private lateinit var commandRegistry: CommandRegistry
|
@Mock private lateinit var commandRegistry: CommandRegistry
|
||||||
@Mock private lateinit var configurationController: ConfigurationController
|
@Mock private lateinit var configurationController: ConfigurationController
|
||||||
@@ -56,6 +58,7 @@ class AuthRippleControllerTest : SysuiTestCase() {
|
|||||||
fun setUp() {
|
fun setUp() {
|
||||||
MockitoAnnotations.initMocks(this)
|
MockitoAnnotations.initMocks(this)
|
||||||
controller = AuthRippleController(
|
controller = AuthRippleController(
|
||||||
|
statusBar,
|
||||||
context,
|
context,
|
||||||
authController,
|
authController,
|
||||||
configurationController,
|
configurationController,
|
||||||
@@ -72,7 +75,7 @@ class AuthRippleControllerTest : SysuiTestCase() {
|
|||||||
fun testFingerprintTrigger_Ripple() {
|
fun testFingerprintTrigger_Ripple() {
|
||||||
// GIVEN fp exists, keyguard is visible, user doesn't need strong auth
|
// GIVEN fp exists, keyguard is visible, user doesn't need strong auth
|
||||||
val fpsLocation = PointF(5f, 5f)
|
val fpsLocation = PointF(5f, 5f)
|
||||||
`when`(authController.udfpsSensorLocation).thenReturn(fpsLocation)
|
`when`(authController.fingerprintSensorLocation).thenReturn(fpsLocation)
|
||||||
controller.onViewAttached()
|
controller.onViewAttached()
|
||||||
`when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true)
|
`when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true)
|
||||||
`when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false)
|
`when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false)
|
||||||
@@ -193,7 +196,7 @@ class AuthRippleControllerTest : SysuiTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testNullFingerprintSensorLocationDoesNothing() {
|
fun testNullFingerprintSensorLocationDoesNothing() {
|
||||||
`when`(authController.udfpsSensorLocation).thenReturn(null)
|
`when`(authController.fingerprintSensorLocation).thenReturn(null)
|
||||||
controller.onViewAttached()
|
controller.onViewAttached()
|
||||||
|
|
||||||
val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java)
|
val captor = ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java)
|
||||||
|
|||||||
Reference in New Issue
Block a user