Loading packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +14 −8 Original line number Diff line number Diff line Loading @@ -496,7 +496,8 @@ public class UdfpsControllerTest extends SysuiTestCase { final float[] scaleFactor = new float[]{1f, displayHeight[1] / (float) displayHeight[0]}; final int[] rotation = new int[]{Surface.ROTATION_0, Surface.ROTATION_90}; final UdfpsOverlayParams oldParams = new UdfpsOverlayParams(sensorBounds[0], sensorBounds[0], displayWidth[0], displayHeight[0], scaleFactor[0], rotation[0]); sensorBounds[0], displayWidth[0], displayHeight[0], scaleFactor[0], rotation[0], FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); for (int i1 = 0; i1 <= 1; ++i1) { for (int i2 = 0; i2 <= 1; ++i2) { Loading @@ -505,7 +506,8 @@ public class UdfpsControllerTest extends SysuiTestCase { for (int i5 = 0; i5 <= 1; ++i5) { final UdfpsOverlayParams newParams = new UdfpsOverlayParams( sensorBounds[i1], sensorBounds[i1], displayWidth[i2], displayHeight[i3], scaleFactor[i4], rotation[i5]); displayHeight[i3], scaleFactor[i4], rotation[i5], FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); if (newParams.equals(oldParams)) { continue; Loading Loading @@ -549,7 +551,7 @@ public class UdfpsControllerTest extends SysuiTestCase { // Initialize the overlay. mUdfpsController.updateOverlayParams(mOpticalProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, rotation)); scaleFactor, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); // Show the overlay. mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, mOpticalProps.sensorId, Loading @@ -560,7 +562,7 @@ public class UdfpsControllerTest extends SysuiTestCase { // Update overlay with the same parameters. mUdfpsController.updateOverlayParams(mOpticalProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, rotation)); scaleFactor, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); mFgExecutor.runAllReady(); // Ensure the overlay was not recreated. Loading Loading @@ -642,7 +644,8 @@ public class UdfpsControllerTest extends SysuiTestCase { // Test ROTATION_0 mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_0)); scaleFactor, Surface.ROTATION_0, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); MotionEvent event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); Loading @@ -657,7 +660,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_90)); scaleFactor, Surface.ROTATION_90, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); event = obtainMotionEvent(ACTION_DOWN, displayHeight, 0, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); mBiometricExecutor.runAllReady(); Loading @@ -671,7 +675,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_270)); scaleFactor, Surface.ROTATION_270, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); event = obtainMotionEvent(ACTION_DOWN, 0, displayWidth, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); mBiometricExecutor.runAllReady(); Loading @@ -685,7 +690,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_180)); scaleFactor, Surface.ROTATION_180, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); // ROTATION_180 is not supported. It should be treated like ROTATION_0. event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); Loading packages/SystemUI/shared/biometrics/src/com/android/systemui/biometrics/shared/model/UdfpsOverlayParams.kt +6 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.biometrics.shared.model import android.graphics.Rect import android.hardware.fingerprint.FingerprintSensorProperties.SensorType import android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL import android.view.Surface import android.view.Surface.Rotation Loading @@ -39,6 +41,8 @@ import android.view.Surface.Rotation * the native resolution. * * [rotation] current rotation of the display. * * [sensorType] fingerprint sensor type */ data class UdfpsOverlayParams( val sensorBounds: Rect = Rect(), Loading @@ -46,7 +50,8 @@ data class UdfpsOverlayParams( val naturalDisplayWidth: Int = 0, val naturalDisplayHeight: Int = 0, val scaleFactor: Float = 1f, @Rotation val rotation: Int = Surface.ROTATION_0 @Rotation val rotation: Int = Surface.ROTATION_0, @SensorType val sensorType: Int = TYPE_UDFPS_OPTICAL ) { /** Same as [sensorBounds], but in native resolution. */ Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +2 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,8 @@ public class AuthController implements mCachedDisplayInfo.getNaturalWidth(), mCachedDisplayInfo.getNaturalHeight(), mScaleFactor, mCachedDisplayInfo.rotation); mCachedDisplayInfo.rotation, udfpsProp.sensorType); mUdfpsController.updateOverlayParams(udfpsProp, mUdfpsOverlayParams); if (!Objects.equals(previousUdfpsBounds, mUdfpsBounds) || !Objects.equals( Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsUtilsTest.java +25 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import android.content.res.Resources; import android.graphics.Rect; import android.hardware.fingerprint.FingerprintSensorProperties; import android.view.Surface; import androidx.test.filters.SmallTest; Loading Loading @@ -63,28 +64,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); // touch at 90 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); // touch at 270 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); } Loading @@ -97,28 +102,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 90 degrees -> 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); // touch at 180 degrees -> 270 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); // touch at 270 degrees -> 0 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); } Loading @@ -131,28 +140,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); // touch at 90 degrees -> 0 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); // touch at 180 degrees -> 90 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 270 degrees -> 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +14 −8 Original line number Diff line number Diff line Loading @@ -496,7 +496,8 @@ public class UdfpsControllerTest extends SysuiTestCase { final float[] scaleFactor = new float[]{1f, displayHeight[1] / (float) displayHeight[0]}; final int[] rotation = new int[]{Surface.ROTATION_0, Surface.ROTATION_90}; final UdfpsOverlayParams oldParams = new UdfpsOverlayParams(sensorBounds[0], sensorBounds[0], displayWidth[0], displayHeight[0], scaleFactor[0], rotation[0]); sensorBounds[0], displayWidth[0], displayHeight[0], scaleFactor[0], rotation[0], FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); for (int i1 = 0; i1 <= 1; ++i1) { for (int i2 = 0; i2 <= 1; ++i2) { Loading @@ -505,7 +506,8 @@ public class UdfpsControllerTest extends SysuiTestCase { for (int i5 = 0; i5 <= 1; ++i5) { final UdfpsOverlayParams newParams = new UdfpsOverlayParams( sensorBounds[i1], sensorBounds[i1], displayWidth[i2], displayHeight[i3], scaleFactor[i4], rotation[i5]); displayHeight[i3], scaleFactor[i4], rotation[i5], FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); if (newParams.equals(oldParams)) { continue; Loading Loading @@ -549,7 +551,7 @@ public class UdfpsControllerTest extends SysuiTestCase { // Initialize the overlay. mUdfpsController.updateOverlayParams(mOpticalProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, rotation)); scaleFactor, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); // Show the overlay. mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, mOpticalProps.sensorId, Loading @@ -560,7 +562,7 @@ public class UdfpsControllerTest extends SysuiTestCase { // Update overlay with the same parameters. mUdfpsController.updateOverlayParams(mOpticalProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, rotation)); scaleFactor, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); mFgExecutor.runAllReady(); // Ensure the overlay was not recreated. Loading Loading @@ -642,7 +644,8 @@ public class UdfpsControllerTest extends SysuiTestCase { // Test ROTATION_0 mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_0)); scaleFactor, Surface.ROTATION_0, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); MotionEvent event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); Loading @@ -657,7 +660,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_90)); scaleFactor, Surface.ROTATION_90, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); event = obtainMotionEvent(ACTION_DOWN, displayHeight, 0, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); mBiometricExecutor.runAllReady(); Loading @@ -671,7 +675,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_270)); scaleFactor, Surface.ROTATION_270, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); event = obtainMotionEvent(ACTION_DOWN, 0, displayWidth, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); mBiometricExecutor.runAllReady(); Loading @@ -685,7 +690,8 @@ public class UdfpsControllerTest extends SysuiTestCase { reset(mFingerprintManager); mUdfpsController.updateOverlayParams(testParams.sensorProps, new UdfpsOverlayParams(sensorBounds, sensorBounds, displayWidth, displayHeight, scaleFactor, Surface.ROTATION_180)); scaleFactor, Surface.ROTATION_180, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL)); // ROTATION_180 is not supported. It should be treated like ROTATION_0. event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event); Loading
packages/SystemUI/shared/biometrics/src/com/android/systemui/biometrics/shared/model/UdfpsOverlayParams.kt +6 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.biometrics.shared.model import android.graphics.Rect import android.hardware.fingerprint.FingerprintSensorProperties.SensorType import android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL import android.view.Surface import android.view.Surface.Rotation Loading @@ -39,6 +41,8 @@ import android.view.Surface.Rotation * the native resolution. * * [rotation] current rotation of the display. * * [sensorType] fingerprint sensor type */ data class UdfpsOverlayParams( val sensorBounds: Rect = Rect(), Loading @@ -46,7 +50,8 @@ data class UdfpsOverlayParams( val naturalDisplayWidth: Int = 0, val naturalDisplayHeight: Int = 0, val scaleFactor: Float = 1f, @Rotation val rotation: Int = Surface.ROTATION_0 @Rotation val rotation: Int = Surface.ROTATION_0, @SensorType val sensorType: Int = TYPE_UDFPS_OPTICAL ) { /** Same as [sensorBounds], but in native resolution. */ Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +2 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,8 @@ public class AuthController implements mCachedDisplayInfo.getNaturalWidth(), mCachedDisplayInfo.getNaturalHeight(), mScaleFactor, mCachedDisplayInfo.rotation); mCachedDisplayInfo.rotation, udfpsProp.sensorType); mUdfpsController.updateOverlayParams(udfpsProp, mUdfpsOverlayParams); if (!Objects.equals(previousUdfpsBounds, mUdfpsBounds) || !Objects.equals( Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsUtilsTest.java +25 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import android.content.res.Resources; import android.graphics.Rect; import android.hardware.fingerprint.FingerprintSensorProperties; import android.view.Surface; import androidx.test.filters.SmallTest; Loading Loading @@ -63,28 +64,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); // touch at 90 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); // touch at 270 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); } Loading @@ -97,28 +102,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 90 degrees -> 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); // touch at 180 degrees -> 270 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0 /* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); // touch at 270 degrees -> 0 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); } Loading @@ -131,28 +140,32 @@ public class UdfpsUtilsTest extends SysuiTestCase { assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[3]); // touch at 90 degrees -> 0 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, -1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[0]); // touch at 180 degrees -> 90 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, -1 /* touchX */, 0/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[1]); // touch at 270 degrees -> 180 degrees assertThat( mUdfpsUtils.onTouchOutsideOfSensorArea(true, mContext, 0 /* touchX */, 1/* touchY */, new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation) new UdfpsOverlayParams(new Rect(), new Rect(), 0, 0, 1f, rotation, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) ) ).isEqualTo(mTouchHints[2]); } Loading