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

@@ -95,7 +95,6 @@ public class BatterySaverButtonPreferenceController extends
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
mPreference.setTitle(mContext.getString(R.string.battery_saver_master_switch_title));
mPreference.addOnSwitchChangeListener(this);
mPreference.updateStatus(isChecked());
}
@@ -113,7 +112,6 @@ public class BatterySaverButtonPreferenceController extends
@Override
public boolean setChecked(boolean stateOn) {
// This screen already shows a warning, so we don't need another warning.
mPreference.updateStatus(isChecked());
return BatterySaverUtils.setPowerSaveMode(mContext, stateOn,
false /* needFirstTimeWarning */);
}