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:
@@ -20,7 +20,9 @@ import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
|
||||
/**
|
||||
* Tip to suggest turn on smart battery if it is not on
|
||||
@@ -55,6 +57,12 @@ public class SmartBatteryTip extends BatteryTip {
|
||||
mState = tip.mState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
|
||||
metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_SMART_BATTERY_TIP,
|
||||
mState);
|
||||
}
|
||||
|
||||
public static final Creator CREATOR = new Creator() {
|
||||
public BatteryTip createFromParcel(Parcel in) {
|
||||
return new SmartBatteryTip(in);
|
||||
|
Reference in New Issue
Block a user