use of com.android.settings.fuelgauge.batterytip.tips.LowBatteryTip in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryFixSliceTest method getSlice_unimportantSlice_shouldSkip.
@Test
public void getSlice_unimportantSlice_shouldSkip() {
final List<BatteryTip> tips = new ArrayList<>();
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false, ""));
tips.add(new EarlyWarningTip(BatteryTip.StateType.HANDLED, false));
ShadowBatteryTipLoader.setBatteryTips(tips);
BatteryFixSlice.updateBatteryTipAvailabilityCache(mContext);
final Slice slice = mSlice.getSlice();
assertThat(SliceMetadata.from(mContext, slice).isErrorSlice()).isTrue();
}
use of com.android.settings.fuelgauge.batterytip.tips.LowBatteryTip in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryTipLoader method getFakeData.
private List<BatteryTip> getFakeData() {
final List<BatteryTip> tips = new ArrayList<>();
tips.add(new SummaryTip(BatteryTip.StateType.NEW, EstimateKt.AVERAGE_TIME_TO_DISCHARGE_UNKNOWN));
tips.add(new LowBatteryTip(BatteryTip.StateType.NEW, false, /* powerSaveModeOn */
"Fake data"));
return tips;
}
use of com.android.settings.fuelgauge.batterytip.tips.LowBatteryTip in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryFixSliceTest method updateBatteryTipAvailabilityCache_hasImportantTip_shouldReturnTrue.
@Test
public void updateBatteryTipAvailabilityCache_hasImportantTip_shouldReturnTrue() {
final List<BatteryTip> tips = new ArrayList<>();
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false, ""));
tips.add(new EarlyWarningTip(BatteryTip.StateType.NEW, false));
ShadowBatteryTipLoader.setBatteryTips(tips);
BatteryFixSlice.updateBatteryTipAvailabilityCache(mContext);
assertThat(BatteryFixSlice.isBatteryTipAvailableFromCache(mContext)).isTrue();
}
Aggregations