Fix IntentReceiver leaked on Sound & vibration

The root cause is that PreferenceController migrated to Catalyst will be
removed by DashboardFragment and VolumeSeekBarPreferenceController
onPause() is not invoked.

NO_IFTTT=Controller only

Fix: 386162594
Flag: EXEMPT bugfix
Test: atest&manual
Change-Id: I13f8588c8259ed4ddb9895ffc60e209c99c05269
This commit is contained in:
Jacky Wang
2025-01-24 15:24:23 +08:00
parent a7fa6efe8f
commit 402e5bb38b
8 changed files with 62 additions and 106 deletions

View File

@@ -88,24 +88,6 @@ public class VolumeSeekBarPreferenceControllerTest {
verify(mPreference, never()).setListener(mListener);
}
@Test
public void onResume_shouldResumePreference() {
mController.displayPreference(mScreen);
mController.onResume();
verify(mPreference).onActivityResume();
}
@Test
public void onPause_shouldPausePreference() {
mController.displayPreference(mScreen);
mController.onPause();
verify(mPreference).onActivityPause();
}
@Test
public void sliderMethods_handleNullPreference() {
when(mHelper.getStreamVolume(mController.getAudioStream())).thenReturn(4);