Loading packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.MASTER_CLEAR" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE_SYSTEM_CONSTANTS" /> <uses-permission android:name="android.permission.MANAGE_SENSOR_PRIVACY" /> <uses-permission android:name="android.permission.OBSERVE_SENSOR_PRIVACY" /> <uses-permission android:name="android.permission.ACCESS_AMBIENT_CONTEXT_EVENT" /> Loading packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt +4 −4 Original line number Diff line number Diff line Loading @@ -941,16 +941,16 @@ constructor( private fun vibrateOnSuccess() { _hapticsToPlay.value = HapticsToPlay( HapticFeedbackConstants.CONFIRM, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_CONFIRM, null, ) } private fun vibrateOnError() { _hapticsToPlay.value = HapticsToPlay( HapticFeedbackConstants.REJECT, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_REJECT, null, ) } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +2 −4 Original line number Diff line number Diff line Loading @@ -369,8 +369,7 @@ object KeyguardRootViewBinder { } else { vibratorHelper.performHapticFeedback( view, HapticFeedbackConstants.CONFIRM, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_CONFIRM, ) } } Loading @@ -390,8 +389,7 @@ object KeyguardRootViewBinder { } else { vibratorHelper.performHapticFeedback( view, HapticFeedbackConstants.REJECT, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_REJECT, ) } } Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt +17 −20 Original line number Diff line number Diff line Loading @@ -717,13 +717,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa assertThat(confirmHaptics?.hapticFeedbackConstant) .isEqualTo( if (expectConfirmation) HapticFeedbackConstants.NO_HAPTICS else HapticFeedbackConstants.CONFIRM ) assertThat(confirmHaptics?.flag) .isEqualTo( if (expectConfirmation) null else HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING else HapticFeedbackConstants.BIOMETRIC_CONFIRM ) assertThat(confirmHaptics?.flag).isNull() if (expectConfirmation) { kosmos.promptViewModel.confirmAuthenticated() Loading @@ -731,9 +727,8 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val confirmedHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(confirmedHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(confirmedHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) assertThat(confirmedHaptics?.flag).isNull() } @Test Loading @@ -747,9 +742,8 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val currentHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(currentHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(currentHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) assertThat(currentHaptics?.flag).isNull() } @Test Loading @@ -757,9 +751,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa kosmos.promptViewModel.showTemporaryError("test", "messageAfterError", false) val currentHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(currentHaptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(currentHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(currentHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(currentHaptics?.flag).isNull() } // biometricprompt_sfps_fingerprint_authenticating reused across rotations Loading Loading @@ -870,8 +864,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa ) val haptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(haptics?.flag).isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(haptics?.flag).isNull() } @Test Loading Loading @@ -901,10 +896,12 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val haptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) if (expectConfirmation) { assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(haptics?.flag).isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(haptics?.flag).isNull() } else { assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) } } Loading Loading
packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.MASTER_CLEAR" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE_SYSTEM_CONSTANTS" /> <uses-permission android:name="android.permission.MANAGE_SENSOR_PRIVACY" /> <uses-permission android:name="android.permission.OBSERVE_SENSOR_PRIVACY" /> <uses-permission android:name="android.permission.ACCESS_AMBIENT_CONTEXT_EVENT" /> Loading
packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt +4 −4 Original line number Diff line number Diff line Loading @@ -941,16 +941,16 @@ constructor( private fun vibrateOnSuccess() { _hapticsToPlay.value = HapticsToPlay( HapticFeedbackConstants.CONFIRM, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_CONFIRM, null, ) } private fun vibrateOnError() { _hapticsToPlay.value = HapticsToPlay( HapticFeedbackConstants.REJECT, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_REJECT, null, ) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +2 −4 Original line number Diff line number Diff line Loading @@ -369,8 +369,7 @@ object KeyguardRootViewBinder { } else { vibratorHelper.performHapticFeedback( view, HapticFeedbackConstants.CONFIRM, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_CONFIRM, ) } } Loading @@ -390,8 +389,7 @@ object KeyguardRootViewBinder { } else { vibratorHelper.performHapticFeedback( view, HapticFeedbackConstants.REJECT, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING, HapticFeedbackConstants.BIOMETRIC_REJECT, ) } } Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt +17 −20 Original line number Diff line number Diff line Loading @@ -717,13 +717,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa assertThat(confirmHaptics?.hapticFeedbackConstant) .isEqualTo( if (expectConfirmation) HapticFeedbackConstants.NO_HAPTICS else HapticFeedbackConstants.CONFIRM ) assertThat(confirmHaptics?.flag) .isEqualTo( if (expectConfirmation) null else HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING else HapticFeedbackConstants.BIOMETRIC_CONFIRM ) assertThat(confirmHaptics?.flag).isNull() if (expectConfirmation) { kosmos.promptViewModel.confirmAuthenticated() Loading @@ -731,9 +727,8 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val confirmedHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(confirmedHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(confirmedHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) assertThat(confirmedHaptics?.flag).isNull() } @Test Loading @@ -747,9 +742,8 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val currentHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(currentHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(currentHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) assertThat(currentHaptics?.flag).isNull() } @Test Loading @@ -757,9 +751,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa kosmos.promptViewModel.showTemporaryError("test", "messageAfterError", false) val currentHaptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(currentHaptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(currentHaptics?.flag) .isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(currentHaptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(currentHaptics?.flag).isNull() } // biometricprompt_sfps_fingerprint_authenticating reused across rotations Loading Loading @@ -870,8 +864,9 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa ) val haptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(haptics?.flag).isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(haptics?.flag).isNull() } @Test Loading Loading @@ -901,10 +896,12 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa val haptics by collectLastValue(kosmos.promptViewModel.hapticsToPlay) if (expectConfirmation) { assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.REJECT) assertThat(haptics?.flag).isEqualTo(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_REJECT) assertThat(haptics?.flag).isNull() } else { assertThat(haptics?.hapticFeedbackConstant).isEqualTo(HapticFeedbackConstants.CONFIRM) assertThat(haptics?.hapticFeedbackConstant) .isEqualTo(HapticFeedbackConstants.BIOMETRIC_CONFIRM) } } Loading