/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/tips/ |
D | RestrictAppTipTest.java | 104 mNewBatteryTip = new RestrictAppTip(BatteryTip.StateType.NEW, mUsageAppList); in setUp() 105 mHandledBatteryTip = new RestrictAppTip(BatteryTip.StateType.HANDLED, mUsageAppList); in setUp() 107 new RestrictAppTip(BatteryTip.StateType.INVISIBLE, new ArrayList<>()); in setUp() 124 assertThat(parcelTip.getType()).isEqualTo(BatteryTip.TipType.APP_RESTRICTION); in parcelable() 125 assertThat(parcelTip.getState()).isEqualTo(BatteryTip.StateType.NEW); in parcelable() 143 mHandledBatteryTip = new RestrictAppTip(BatteryTip.StateType.HANDLED, mUsageAppList); in getTitle_moreAppsHandled_showHandledTitle() 164 mHandledBatteryTip = new RestrictAppTip(BatteryTip.StateType.HANDLED, mUsageAppList); in getSummary_moreAppsHandled_showHandledSummary() 175 assertThat(mNewBatteryTip.getState()).isEqualTo(BatteryTip.StateType.HANDLED); in update_anomalyBecomeInvisible_stateHandled() 182 assertThat(mHandledBatteryTip.getState()).isEqualTo(BatteryTip.StateType.INVISIBLE); in update_handledAnomlayBecomeInvisible_stateInvisible() 188 assertThat(mInvisibleBatteryTip.getState()).isEqualTo(BatteryTip.StateType.NEW); in update_newAnomalyComes_stateNew() [all …]
|
D | BatteryTipTest.java | 74 final BatteryTip batteryTip = new TestBatteryTip(); in parcelable() 80 final BatteryTip parcelTip = new TestBatteryTip(parcel); in parcelable() 103 for (int i = 0, size = BatteryTip.TIP_ORDER.size(); i < size; i++) { in tipOrder_orderUnique() 104 orders.add(BatteryTip.TIP_ORDER.valueAt(i)); in tipOrder_orderUnique() 116 public static class TestBatteryTip extends BatteryTip { 141 public void updateState(BatteryTip tip) { in updateState() 152 public BatteryTip createFromParcel(Parcel in) { 156 public BatteryTip[] newArray(int size) {
|
D | LowBatteryTipTest.java | 48 mLowBatteryTip = new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */); in setUp() 66 mLowBatteryTip.mState = BatteryTip.StateType.NEW; in updateState_stateNew_showExpectedInformation() 78 new LowBatteryTip(BatteryTip.StateType.NEW, true /* powerSaveModeOn */); in updateState_powerSaveModeOn_notShowTipItem() 82 assertThat(tip.mState).isEqualTo(BatteryTip.StateType.INVISIBLE); in updateState_powerSaveModeOn_notShowTipItem() 93 BatteryTip.StateType.NEW); in log_lowBatteryActionWithCorrectState()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/ |
D | BatteryTipPreferenceController.java | 34 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 53 private List<BatteryTip> mBatteryTips; 54 private Map<String, BatteryTip> mBatteryTipMap; 96 public void updateBatteryTips(List<BatteryTip> batteryTips) { in updateBatteryTips() 103 final BatteryTip batteryTip = mBatteryTips.get(i); in updateBatteryTips() 105 if (batteryTip.getState() != BatteryTip.StateType.INVISIBLE) { in updateBatteryTips() 118 final BatteryTip batteryTip = mBatteryTipMap.get(preference.getKey()); in handlePreferenceTreeClick() 149 List<BatteryTip> batteryTips = bundle.getParcelableArrayList(KEY_BATTERY_TIPS); in restoreInstanceState() 175 public BatteryTip getCurrentBatteryTip() { in getCurrentBatteryTip() 179 Optional<BatteryTip> visibleBatteryTip = in getCurrentBatteryTip() [all …]
|
D | BatteryTipUtils.java | 38 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 90 BatteryTip batteryTip, in getActionForBatteryTip() 94 case BatteryTip.TipType.SMART_BATTERY_MANAGER: in getActionForBatteryTip() 96 case BatteryTip.TipType.BATTERY_SAVER: in getActionForBatteryTip() 97 case BatteryTip.TipType.LOW_BATTERY: in getActionForBatteryTip() 99 case BatteryTip.TipType.APP_RESTRICTION: in getActionForBatteryTip() 100 if (batteryTip.getState() == BatteryTip.StateType.HANDLED) { in getActionForBatteryTip() 105 case BatteryTip.TipType.REMOVE_APP_RESTRICTION: in getActionForBatteryTip()
|
D | BatteryTipLoader.java | 29 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 41 public class BatteryTipLoader extends AsyncLoaderCompat<List<BatteryTip>> { 55 public List<BatteryTip> loadInBackground() { in loadInBackground() 56 final List<BatteryTip> tips = new ArrayList<>(); in loadInBackground() 74 protected void onDiscardResult(List<BatteryTip> result) {} in onDiscardResult()
|
D | BatteryTipDialogFragment.java | 41 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 56 @VisibleForTesting BatteryTip mBatteryTip; 59 public static BatteryTipDialogFragment newInstance(BatteryTip batteryTip, int metricsKey) { in newInstance() 79 case BatteryTip.TipType.SUMMARY: in onCreateDialog() 84 case BatteryTip.TipType.HIGH_DEVICE_USAGE: in onCreateDialog() 100 case BatteryTip.TipType.APP_RESTRICTION: in onCreateDialog() 139 case BatteryTip.TipType.REMOVE_APP_RESTRICTION: in onCreateDialog()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/ |
D | BatteryTipUtilsTest.java | 30 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 61 mRestrictAppTip = spy(new RestrictAppTip(BatteryTip.StateType.NEW, new ArrayList<>())); in setUp() 63 spy(new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */)); in setUp() 65 spy(new BatteryDefenderTip(BatteryTip.StateType.NEW, false /* isPluggedIn */)); in setUp() 70 when(mRestrictAppTip.getState()).thenReturn(BatteryTip.StateType.NEW); in testGetActionForBatteryTip_typeRestrictStateNew_returnActionRestrict() 80 when(mRestrictAppTip.getState()).thenReturn(BatteryTip.StateType.HANDLED); in testGetActionForBatteryTip_typeRestrictStateHandled_returnActionOpen() 90 when(mLowBatteryTip.getState()).thenReturn(BatteryTip.StateType.NEW); in testGetActionForBatteryTip_typeLowBatteryStateNew_returnActionOpen() 100 when(mBatteryDefenderTip.getState()).thenReturn(BatteryTip.StateType.NEW); in testGetActionForBatteryTip_typeBatteryDefenderStateNew_returnNullAction()
|
D | BatteryTipLoaderTest.java | 34 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 53 BatteryTip.TipType.LOW_BATTERY, 54 BatteryTip.TipType.BATTERY_DEFENDER, 55 BatteryTip.TipType.INCOMPATIBLE_CHARGER, 56 BatteryTip.TipType.HIGH_DEVICE_USAGE 90 final List<BatteryTip> batteryTips = mBatteryTipLoader.loadInBackground(); in testLoadBackground_containsAllTipsWithOrder()
|
D | BatteryTipPreferenceControllerTest.java | 18 import static com.android.settings.fuelgauge.batterytip.tips.BatteryTip.TipType.SMART_BATTERY_MANAG… 35 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 59 @Mock private BatteryTip mBatteryTip; 66 private List<BatteryTip> mNewBatteryTips; 123 List<BatteryTip> batteryTips = new ArrayList<>(); in handlePreferenceTreeClick_noDialog_invokeCallback()
|
D | BatteryTipDialogFragmentTest.java | 34 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 110 new RestrictAppTip(BatteryTip.StateType.NEW, new ArrayList<>(restrictApps)); in setUp() 113 new RestrictAppTip(BatteryTip.StateType.NEW, new ArrayList<>(restrictApps)); in setUp() 115 mUnrestrictAppTip = new UnrestrictAppTip(BatteryTip.StateType.NEW, mAppInfo); in setUp() 116 mDefenderTip = new BatteryDefenderTip(BatteryTip.StateType.NEW, false /* isPluggedIn */); in setUp() 200 new RestrictAppTip(BatteryTip.StateType.NEW, appInfos); in testOnCreateDialog_restrictSixAppsTip_fireRestrictSixAppsDialog()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batteryusage/ |
D | PowerUsageSummary.java | 44 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 106 private LoaderManager.LoaderCallbacks<List<BatteryTip>> mBatteryTipsCallbacks = 107 new LoaderManager.LoaderCallbacks<List<BatteryTip>>() { 110 public Loader<List<BatteryTip>> onCreateLoader(int id, Bundle args) { 115 public void onLoadFinished(Loader<List<BatteryTip>> loader, List<BatteryTip> data) { 122 public void onLoaderReset(Loader<List<BatteryTip>> loader) {} 267 public void onBatteryTipHandled(BatteryTip batteryTip) { in onBatteryTipHandled()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | IncompatibleChargerDetector.java | 21 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 36 public BatteryTip detect() { in detect() 39 isIncompatibleCharging ? BatteryTip.StateType.NEW : BatteryTip.StateType.INVISIBLE; in detect()
|
D | BatteryDefenderDetector.java | 23 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 37 public BatteryTip detect() { in detect() 43 isBasicBatteryDefend ? BatteryTip.StateType.NEW : BatteryTip.StateType.INVISIBLE; in detect()
|
D | LowBatteryDetector.java | 24 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 45 public BatteryTip detect() { in detect() 55 ? BatteryTip.StateType.NEW in detect() 56 : BatteryTip.StateType.INVISIBLE; in detect()
|
D | SmartBatteryDetector.java | 25 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 50 public BatteryTip detect() { in detect() 64 enableSmartBatteryTip ? BatteryTip.StateType.NEW : BatteryTip.StateType.INVISIBLE; in detect()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | IncompatibleChargerDetectorTest.java | 28 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 61 BatteryTip batteryTip = mIncompatibleChargerDetector.detect(); in detect_withoutIncompatibleCharger_shouldNotShowTip() 64 assertThat(batteryTip.getState()).isEqualTo(BatteryTip.StateType.INVISIBLE); in detect_withoutIncompatibleCharger_shouldNotShowTip() 71 BatteryTip batteryTip = mIncompatibleChargerDetector.detect(); in detect_withIncompatibleCharger_showTip() 74 assertThat(batteryTip.getState()).isEqualTo(BatteryTip.StateType.NEW); in detect_withIncompatibleCharger_showTip()
|
D | LowBatteryDetectorTest.java | 31 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip; 84 assertThat(mLowBatteryDetector.detect().getState()).isEqualTo(BatteryTip.StateType.NEW); in detect_enabledByTest_tipNew() 92 assertThat(mLowBatteryDetector.detect().getState()).isEqualTo(BatteryTip.StateType.NEW); in detect_lowBattery_tipNew() 101 .isEqualTo(BatteryTip.StateType.INVISIBLE); in detect_batterySaverOn_tipInvisible()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/tips/ |
D | BatteryTip.java | 42 public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable { class 110 public BatteryTip(Parcel in) { in BatteryTip() method in BatteryTip 117 public BatteryTip(int type, int state, boolean showDialog) { in BatteryTip() method in BatteryTip 150 public abstract void updateState(BatteryTip tip); in updateState() 201 public int compareTo(BatteryTip o) { in compareTo()
|
D | SmartBatteryTip.java | 27 public class SmartBatteryTip extends BatteryTip { 53 public void updateState(BatteryTip tip) { in updateState() 64 public BatteryTip createFromParcel(Parcel in) { 68 public BatteryTip[] newArray(int size) {
|
D | UnrestrictAppTip.java | 32 public class UnrestrictAppTip extends BatteryTip { 68 public void updateState(BatteryTip tip) { in updateState() 89 public BatteryTip createFromParcel(Parcel in) { 93 public BatteryTip[] newArray(int size) {
|
D | LowBatteryTip.java | 28 public class LowBatteryTip extends BatteryTip { 69 public void updateState(BatteryTip tip) { in updateState() 80 public BatteryTip createFromParcel(Parcel in) { 84 public BatteryTip[] newArray(int size) {
|
D | IncompatibleChargerTip.java | 35 public final class IncompatibleChargerTip extends BatteryTip { 62 public void updateState(BatteryTip tip) { in updateState() 109 public BatteryTip createFromParcel(Parcel in) { 113 public BatteryTip[] newArray(int size) {
|
D | HighUsageTip.java | 33 public class HighUsageTip extends BatteryTip { 77 public void updateState(BatteryTip tip) { in updateState() 114 public BatteryTip createFromParcel(Parcel in) { 118 public BatteryTip[] newArray(int size) {
|
D | BatteryDefenderTip.java | 37 public class BatteryDefenderTip extends BatteryTip { 68 public void updateState(BatteryTip tip) { in updateState() 138 public BatteryTip createFromParcel(Parcel in) { 142 public BatteryTip[] newArray(int size) {
|