Fix the problem that voice search can not find the

Use Battery Saver slice.

There is no title for preference in xml, so the preference cannot
be indexed.

Fix: 172276695
Test: manual test and see the UI
Change-Id: Ieb7836805e66515629064800e4119ca17b5ac2e0
This commit is contained in:
Stanley Wang
2022-02-25 19:06:18 +08:00
parent 0ece869924
commit 21564efa8b
3 changed files with 3 additions and 4 deletions

View File

@@ -75,7 +75,7 @@ public class BatterySaverButtonPreferenceControllerTest {
public void updateState_lowPowerOn_preferenceIsChecked() {
when(mPowerManager.isPowerSaveMode()).thenReturn(true);
mController.onSwitchChanged(null, mPowerManager.isPowerSaveMode());
mPreference.updateStatus(mPowerManager.isPowerSaveMode());
assertThat(mPreference.isChecked()).isTrue();
}
@@ -84,7 +84,7 @@ public class BatterySaverButtonPreferenceControllerTest {
public void testUpdateState_lowPowerOff_preferenceIsUnchecked() {
when(mPowerManager.isPowerSaveMode()).thenReturn(false);
mController.onSwitchChanged(null, mPowerManager.isPowerSaveMode());
mPreference.updateStatus(mPowerManager.isPowerSaveMode());
assertThat(mPreference.isChecked()).isFalse();
}