Improve battery tips cards.

Test: manual
Change-Id: I356648d0fcec5dd1ea724297187ecafb5be55fd8
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:13fec0dbdb2c809f20a1e3b711e2491745f6d506)
Bug: 291689623
This commit is contained in:
mxyyiyi
2023-08-05 14:18:03 +08:00
committed by Xinyi Mao
parent 0fcc479625
commit 14d0a1c102
12 changed files with 452 additions and 111 deletions

View File

@@ -105,10 +105,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
public interface OnBatteryTipsUpdatedListener {
/**
* The callback function for the battery tips card is updated.
* @param title the title of the battery tip card
* @param summary the summary of the battery tip card
* @param powerAnomalyEvent the power anomaly event with highest score
*/
void onBatteryTipsUpdated(String title, String summary);
void onBatteryTipsUpdated(PowerAnomalyEvent powerAnomalyEvent);
}
@@ -365,7 +364,8 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
slotUsageData, getSlotInformation(), isBatteryUsageMapNullOrEmpty());
if (mOnBatteryTipsUpdatedListener != null) {
mOnBatteryTipsUpdatedListener.onBatteryTipsUpdated(null, null);
// TODO: replace with a selected powerAnomalyEvent with highest score
mOnBatteryTipsUpdatedListener.onBatteryTipsUpdated(null);
}
}
return true;