Update and expose the low battery tip.

This tip was punted however we need to bring it back to P. It happens
when battery level is low or remaining time is less than 3 hour. The
suggestion is to turn on battery saver.

1. Extend tip from EarlyWarningTip since it has most common logic
2. Update the detector to align it to battery saver notifcation in
systemui.
3. Update tip order to surface low battery tip.

Follow CL will:
1. Hook up the low battery threshold to server side
2. Add test stub for this tip, so we could trigger it by adb.

Change-Id: I14f9696a549393bf980e31838fb86afd5d9efbc7
Bug: 76113067
Test: RunSettingsRoboTests
This commit is contained in:
Lei Yu
2018-04-20 14:58:05 -07:00
parent 99902e1faf
commit b2f089c468
7 changed files with 179 additions and 41 deletions

View File

@@ -74,10 +74,10 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
TIP_ORDER.append(TipType.APP_RESTRICTION, 0);
TIP_ORDER.append(TipType.BATTERY_SAVER, 1);
TIP_ORDER.append(TipType.HIGH_DEVICE_USAGE, 2);
TIP_ORDER.append(TipType.SUMMARY, 3);
TIP_ORDER.append(TipType.SMART_BATTERY_MANAGER, 4);
TIP_ORDER.append(TipType.REDUCED_BATTERY, 5);
TIP_ORDER.append(TipType.LOW_BATTERY, 6);
TIP_ORDER.append(TipType.LOW_BATTERY, 3);
TIP_ORDER.append(TipType.SUMMARY, 4);
TIP_ORDER.append(TipType.SMART_BATTERY_MANAGER, 5);
TIP_ORDER.append(TipType.REDUCED_BATTERY, 6);
TIP_ORDER.append(TipType.REMOVE_APP_RESTRICTION, 7);
}