Display anomaly in battery usage page

This cl adds a new parameter, mAnomalies, for
AdvancedPowerUsageDetail.

If it is null, fragment will start AnomalyLoader to detect anomaly.
If not null, just display the anomaly.

Bug: 36925180
Test: RunSettingsRoboTests

Change-Id: I572bc5954c1cdb210d18b6dbe1ab9dba25c0a61f
This commit is contained in:
jackqdyulei
2017-06-13 10:17:59 -07:00
parent 1dc3f38506
commit 3fb054f3d3
6 changed files with 127 additions and 16 deletions

View File

@@ -286,7 +286,8 @@ public class PowerUsageSummary extends PowerUsageBase implements
PowerGaugePreference pgp = (PowerGaugePreference) preference;
BatteryEntry entry = pgp.getInfo();
AdvancedPowerUsageDetail.startBatteryDetailPage((SettingsActivity) getActivity(),
this, mStatsHelper, mStatsType, entry, pgp.getPercent());
this, mStatsHelper, mStatsType, entry, pgp.getPercent(),
mAnomalySparseArray.get(entry.sipper.getUid()));
return super.onPreferenceTreeClick(preference);
}