Add BatteryTipDetector and LowBatteryTip stuffs.
This cl adds the infra of BatteryTipDetector and use LowBatteryTip as an example(tip model + detector). Also add SummaryTipDetector and related tests Bug: 70570352 Test: RunSettingsRoboTests Change-Id: Icf1349b6ede9eb7ee5ed69b39ee3a2661ac660fa
This commit is contained in:
@@ -31,7 +31,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
* Each {@link BatteryTip} contains basic data(e.g. title, summary, icon) as well as the
|
||||
* pre-defined action(e.g. turn on battery saver)
|
||||
*/
|
||||
public abstract class BatteryTip {
|
||||
public abstract class BatteryTip implements Comparable<BatteryTip> {
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({StateType.NEW,
|
||||
StateType.HANDLED,
|
||||
@@ -114,4 +114,13 @@ public abstract class BatteryTip {
|
||||
public int getState() {
|
||||
return mState;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return mState != StateType.INVISIBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(BatteryTip o) {
|
||||
return mType - o.mType;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user