Merge "Add dump log for BatteryTip." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-07 18:53:09 +00:00
committed by Android (Google) Code Review
7 changed files with 64 additions and 10 deletions

View File

@@ -68,6 +68,12 @@ public class AppInfo implements Comparable<AppInfo>, Parcelable {
dest.writeInt(uid);
}
@Override
public String toString() {
return "packageName=" + packageName + ",anomalyType=" + anomalyType + ",screenTime="
+ screenOnTimeMs;
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public AppInfo createFromParcel(Parcel in) {
return new AppInfo(in);

View File

@@ -158,4 +158,9 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
public int compareTo(BatteryTip o) {
return TIP_ORDER.get(mType) - TIP_ORDER.get(o.mType);
}
@Override
public String toString() {
return "type=" + mType + " state=" + mState;
}
}

View File

@@ -86,6 +86,19 @@ public class HighUsageTip extends BatteryTip {
return mHighUsageAppList;
}
@Override
public String toString() {
final StringBuilder stringBuilder = new StringBuilder(super.toString());
stringBuilder.append(" {");
for (int i = 0, size = mHighUsageAppList.size(); i < size; i++) {
final AppInfo appInfo = mHighUsageAppList.get(i);
stringBuilder.append(" " + appInfo.toString() + " ");
}
stringBuilder.append('}');
return stringBuilder.toString();
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public BatteryTip createFromParcel(Parcel in) {
return new HighUsageTip(in);

View File

@@ -97,6 +97,19 @@ public class RestrictAppTip extends BatteryTip {
return mRestrictAppList;
}
@Override
public String toString() {
final StringBuilder stringBuilder = new StringBuilder(super.toString());
stringBuilder.append(" {");
for (int i = 0, size = mRestrictAppList.size(); i < size; i++) {
final AppInfo appInfo = mRestrictAppList.get(i);
stringBuilder.append(" " + appInfo.toString() + " ");
}
stringBuilder.append('}');
return stringBuilder.toString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);