Add extra log for battery tip.

For each visible battery tip, logs its type and state. For battery tip
with app list, also log that list:

1. HighUsageTip: apps that used too much battery
2. RestrictAppTip: apps with anomaly, also logs the anomaly type

Bug: 73888115
Test: RunSettingsRoboTests
Change-Id: I1b61eb1d793d979baab4864d2d652e12260b590d
This commit is contained in:
jackqdyulei
2018-03-02 16:33:59 -08:00
committed by Lei Yu
parent 7caecd36f7
commit 513ddb14a6
16 changed files with 231 additions and 17 deletions

View File

@@ -104,9 +104,7 @@ public class BatteryTipPreferenceController extends BasePreferenceController {
final Preference preference = batteryTip.buildPreference(mPrefContext);
mBatteryTipMap.put(preference.getKey(), batteryTip);
mPreferenceGroup.addPreference(preference);
mMetricsFeatureProvider.action(mContext,
MetricsProto.MetricsEvent.ACTION_BATTERY_TIP_SHOWN,
batteryTip.getType());
batteryTip.log(mContext, mMetricsFeatureProvider);
break;
}
}