Add battery saver conditional

Change-Id: If80b749185537f252dae88230f80b29bcf321fdf
This commit is contained in:
Jason Monk
2015-12-15 14:38:04 -05:00
parent 29d3b16fc4
commit af24b6377e
4 changed files with 83 additions and 0 deletions

View File

@@ -131,6 +131,7 @@ public class ConditionManager {
addIfMissing(AirplaneModeCondition.class);
addIfMissing(HotspotCondition.class);
addIfMissing(DndCondition.class);
addIfMissing(BatterySaverCondition.class);
}
private void addIfMissing(Class<? extends Condition> clz) {
@@ -147,6 +148,8 @@ public class ConditionManager {
return new HotspotCondition(this);
} else if (DndCondition.class == clz) {
return new DndCondition(this);
} else if (BatterySaverCondition.class == clz) {
return new BatterySaverCondition(this);
}
try {
Constructor<?> constructor = clz.getConstructor(ConditionManager.class);