Merge "Conditionally block battery percantage from search" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-07-03 21:35:32 +00:00
committed by Android (Google) Code Review
2 changed files with 36 additions and 0 deletions

View File

@@ -472,6 +472,12 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList
@Override
public List<String> getNonIndexableKeys(Context context) {
List<String> niks = super.getNonIndexableKeys(context);
final BatteryPercentagePreferenceController controller =
new BatteryPercentagePreferenceController(context);
if (!controller.isAvailable()) {
niks.add(controller.getPreferenceKey());
}
niks.add(KEY_BATTERY_SAVER_SUMMARY);
return niks;
}