Commit Graph

7 Commits

Author SHA1 Message Date
Lais Andrade
08a7f6a5e7 [Catalyst] Vibration and haptics main switch migration
- Migrate "Use Vibration & haptics" main toggle in
  vibration settings screen.

- Add screen for VibrationScreen dashboard fragment

NO_IFTTT=introducing preference metadata files, no change in preference
controllers required.

Bug: 368360218
Flag: com.android.settings.flags.catalyst_vibration_intensity_screen
Test: VibrationIntensityScreenTest
      VibrationScreenTest
      VibrationMainSwitchPreferenceTest
Change-Id: I1dee7fdd59e093bd2dd12204554fe5198e7b76b4
2024-11-28 12:18:16 +00:00
Chun-Ku Lin
d077ca6dd9 Pass null looper if the looper is not prepared in the calling thread
**Root cause**
The PreferenceController can be constructed by the
SettingsSearchIndexablesProvider where the looper of the thread is not
prepared. This result in not able to construct the PreferenceController
that will be used as part of the SettingsSearch.

Currently, if the SettingsSearchIndexablesProvider is not able to
construct the PreferenceController defined in xml, it would just
silently failed.

Test: atest SettingsUnitTests
Test: atest SettingsRoboTests

Flag: EXEMPT low risk bugfix
Bug: 352622249
Change-Id: I72a4ce24ec6842b9efe067e3cb7d1c73cd98a566
2024-08-29 23:02:34 +00:00
Lais Andrade
699bbe760d Fix feedback for main haptic settings toggle
The SettingsMainSwitchPreferenceController might trigger a state change
twice on the page main switch when the user toggles the setting value.

Make sure we only trigger haptic feedback when the state is changing
between untoggled to toggled to avoid a double-click feedback.

No flag for small bug fix, no UI changes.

Fix: 338334977
Test: enable the "Use vibration & haptics" settings and feel a single
      click feedback
Change-Id: I0c22b99bcb40f35ebe09c153133c354306ed1ff0
2024-05-03 14:56:30 +01:00
Lais Andrade
b827221ed3 Make sure vibration previews in Settings apply latest intensities
Update the Settings app to enforce fresh settings are applied to preview
vibrations triggered after the intensity is updated.

Add preview haptics to main switch, only when touch feedback is enabled,
and to the "apply ramping ringer" toggle for consistency with the rest
of the screen, using ringtone intensity for preview.

Bug: 219693646
Bug: 219695212
Bug: 157533521
Test: manual
Change-Id: I872a75d6b00dffae943b0f403185a39047909884
2022-03-21 18:33:44 +00:00
Lais Andrade
8919e0ee50 Add primary switch for vibration settings screen
This re-lands commit fd54fc34c6.

Add primary switch that updates the VIBRATE_ON user setting. Update all settings in this page to be disabled when this main toggle is
off.

Bug: 30028435
Test: VibrationMainSwitchPreferenceControllerTest
Reason for revert: Re-landing change with fixed tests
Change-Id: If9219e3d81dd698f47219c80cac10b079b63e45d
2022-01-19 14:40:18 +00:00
Tsung-Mao Fang
47875a5dff Revert "Add primary switch for vibration settings screen"
This reverts commit fd54fc34c6.

Reason for revert: b/215275738

Change-Id: I93612df6493a2a4184a98b3f049e23aa888095f2
2022-01-19 03:40:40 +00:00
Lais Andrade
fd54fc34c6 Add primary switch for vibration settings screen
Add primary switch that updates the VIBRATE_ON user setting.

Update all settings in this page to be disabled when this main toggle is
off.

Bug: 30028435
Test: VibrationMainSwitchPreferenceControllerTest
Change-Id: I752ca3b914c46678a1347034c5b6cf24fd40cc13
2022-01-18 22:31:30 +00:00