Home
last modified time | relevance | path

Searched refs:BatteryHistEntry (Results 1 – 15 of 15) sorted by relevance

/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/
DBatteryHistEntryTest.java85 new BatteryHistEntry(values), in testConstructor_contentValues_returnsExpectedResult()
92 final BatteryHistEntry entry = new BatteryHistEntry(new ContentValues()); in testConstructor_invalidField_returnsInvalidEntry()
120 values.put(BatteryHistEntry.KEY_UID, 3); in testGetKey_consumerUidType_returnExpectedString()
121 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testGetKey_consumerUidType_returnExpectedString()
130 values.put(BatteryHistEntry.KEY_USER_ID, 2); in testGetKey_consumerUserType_returnExpectedString()
131 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testGetKey_consumerUserType_returnExpectedString()
143 BatteryHistEntry.KEY_BATTERY_INFORMATION, in testGetKey_consumerSystemType_returnExpectedString()
145 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testGetKey_consumerSystemType_returnExpectedString()
205 final BatteryHistEntry lowerHistEntry = in testInterpolate_returnExpectedResult()
219 final BatteryHistEntry upperHistEntry = in testInterpolate_returnExpectedResult()
[all …]
DBatteryDiffEntryTest.java76 @Mock private BatteryHistEntry mBatteryHistEntry;
206 BatteryHistEntry.KEY_BATTERY_INFORMATION, in testLoadLabelAndIcon_forSystemBattery_returnExpectedResult()
208 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testLoadLabelAndIcon_forSystemBattery_returnExpectedResult()
232 values.put(BatteryHistEntry.KEY_USER_ID, Integer.valueOf(1001)); in testLoadLabelAndIcon_forUserBattery_returnExpectedResult()
233 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testLoadLabelAndIcon_forUserBattery_returnExpectedResult()
257 values.put(BatteryHistEntry.KEY_UID, /*invalid uid*/ 10001); in testGetAppLabel_loadDataFromApplicationInfo()
258 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, fakePackageName); in testGetAppLabel_loadDataFromApplicationInfo()
261 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testGetAppLabel_loadDataFromApplicationInfo()
282 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(values); in testGetAppLabel_loadDataFromPreDefinedNameAndUid()
302 BatteryHistEntry.KEY_BATTERY_INFORMATION, in testGetAppLabel_nullAppLabel_returnAppLabelInBatteryHistEntry()
[all …]
DBatteryDiffDataTest.java184 final BatteryHistEntry batteryHistEntry = in createBatteryDiffEntry()
220 private static BatteryHistEntry createBatteryHistEntry( in createBatteryHistEntry()
248 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, packageName); in createBatteryHistEntry()
249 values.put(BatteryHistEntry.KEY_UID, uid); in createBatteryHistEntry()
250 values.put(BatteryHistEntry.KEY_USER_ID, userId); in createBatteryHistEntry()
251 values.put(BatteryHistEntry.KEY_CONSUMER_TYPE, consumerType); in createBatteryHistEntry()
253 BatteryHistEntry.KEY_BATTERY_INFORMATION, in createBatteryHistEntry()
255 return new BatteryHistEntry(values); in createBatteryHistEntry()
DConvertUtilsTest.java112 values, BatteryHistEntry.KEY_BATTERY_INFORMATION); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
115 assertThat(values.getAsLong(BatteryHistEntry.KEY_UID)).isEqualTo(1001L); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
116 assertThat(values.getAsLong(BatteryHistEntry.KEY_USER_ID)) in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
118 assertThat(values.getAsString(BatteryHistEntry.KEY_PACKAGE_NAME)) in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
120 assertThat(values.getAsLong(BatteryHistEntry.KEY_TIMESTAMP)).isEqualTo(10001L); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
121 assertThat(values.getAsInteger(BatteryHistEntry.KEY_CONSUMER_TYPE)) in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
123 assertThat(values.getAsBoolean(BatteryHistEntry.KEY_IS_FULL_CHARGE_CYCLE_START)).isTrue(); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
178 values, BatteryHistEntry.KEY_BATTERY_INFORMATION); in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
181 assertThat(values.getAsLong(BatteryHistEntry.KEY_UID)).isEqualTo(-1); in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
182 assertThat(values.getAsLong(BatteryHistEntry.KEY_USER_ID)) in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
[all …]
DDataProcessorTest.java433 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getHistoryMapWithExpectedTimestamps_returnExpectedMap()
437 final Map<Long, Map<String, BatteryHistEntry>> resultMap = in getHistoryMapWithExpectedTimestamps_returnExpectedMap()
474 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getLevelDataThroughProcessedHistoryMap_OneDayData_returnExpectedResult()
505 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getLevelDataThroughProcessedHistoryMap_MultipleDaysData_returnExpectedResult()
565 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getLevelDataThroughProcessedHistoryMap_daylightSaving25Hour_returnExpectedResult()
666 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getLevelDataThroughProcessedHistoryMap_daylightSaving23Hour_returnExpectedResult()
816 final Map<String, BatteryHistEntry> entryMap = new HashMap<>(); in isFromFullCharge_notChargedData_returnFalse()
819 final BatteryHistEntry entry = new BatteryHistEntry(values); in isFromFullCharge_notChargedData_returnFalse()
827 final Map<String, BatteryHistEntry> entryMap = new HashMap<>(); in isFromFullCharge_chargedData_returnTrue()
829 final BatteryHistEntry entry = new BatteryHistEntry(values); in isFromFullCharge_chargedData_returnTrue()
[all …]
DDatabaseUtilsTest.java378 BatteryHistEntry.KEY_UID, in getHistoryMap_emptyCursorContent_returnEmptyMap()
379 BatteryHistEntry.KEY_USER_ID, in getHistoryMap_emptyCursorContent_returnEmptyMap()
380 BatteryHistEntry.KEY_TIMESTAMP in getHistoryMap_emptyCursorContent_returnEmptyMap()
417 final Map<Long, Map<String, BatteryHistEntry>> batteryHistMap = in getHistoryMap_returnExpectedMap()
422 Map<String, BatteryHistEntry> batteryMap = batteryHistMap.get(timestamp1); in getHistoryMap_returnExpectedMap()
447 final Map<Long, Map<String, BatteryHistEntry>> batteryHistMap = in getHistoryMap_withWorkProfile_returnExpectedMap()
563 values, BatteryHistEntry.KEY_BATTERY_INFORMATION); in verifyBatteryEntryContentValues()
576 values, BatteryHistEntry.KEY_BATTERY_INFORMATION); in verifyFakeBatteryEntryContentValues()
598 BatteryHistEntry.KEY_PACKAGE_NAME, in getMatrixCursor()
599 BatteryHistEntry.KEY_TIMESTAMP, in getMatrixCursor()
[all …]
DBatteryUsageContentProviderTest.java299 values.put(BatteryHistEntry.KEY_UID, Long.valueOf(101L)); in insert_batteryState_returnsExpectedResult()
300 values.put(BatteryHistEntry.KEY_USER_ID, Long.valueOf(1001L)); in insert_batteryState_returnsExpectedResult()
301 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, new String("com.android.settings")); in insert_batteryState_returnsExpectedResult()
302 values.put(BatteryHistEntry.KEY_TIMESTAMP, Long.valueOf(2100021L)); in insert_batteryState_returnsExpectedResult()
303 values.put(BatteryHistEntry.KEY_CONSUMER_TYPE, Integer.valueOf(2)); in insert_batteryState_returnsExpectedResult()
304 values.put(BatteryHistEntry.KEY_IS_FULL_CHARGE_CYCLE_START, true); in insert_batteryState_returnsExpectedResult()
305 values.put(BatteryHistEntry.KEY_BATTERY_INFORMATION, expectedBatteryInformationString); in insert_batteryState_returnsExpectedResult()
337 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, new String("fake_data")); in insert_partialFieldsContentValues_returnsExpectedResult()
338 values.put(BatteryHistEntry.KEY_TIMESTAMP, Long.valueOf(2100022L)); in insert_partialFieldsContentValues_returnsExpectedResult()
339 values.put(BatteryHistEntry.KEY_BATTERY_INFORMATION, expectedBatteryInformationString); in insert_partialFieldsContentValues_returnsExpectedResult()
DBatteryUsageBreakdownControllerTest.java66 @Mock private BatteryHistEntry mBatteryHistEntry;
453 BatteryHistEntry.KEY_CONSUMER_TYPE, in createBatteryDiffEntry()
458 contentValues.put(BatteryHistEntry.KEY_USER_ID, Integer.valueOf(1001)); in createBatteryDiffEntry()
459 final BatteryHistEntry batteryHistEntry = new BatteryHistEntry(contentValues); in createBatteryDiffEntry()
DDataProcessManagerTest.java449 private static Map<Long, Map<String, BatteryHistEntry>> createHistoryMap( in createHistoryMap()
451 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = new HashMap<>(); in createHistoryMap()
453 final Map<String, BatteryHistEntry> entryMap = new HashMap<>(); in createHistoryMap()
455 final BatteryHistEntry entry = new BatteryHistEntry(values); in createHistoryMap()
469 BatteryHistEntry.KEY_BATTERY_INFORMATION, in getContentValuesWithBatteryLevel()
/packages/apps/Settings/src/com/android/settings/fuelgauge/batteryusage/
DDataProcessor.java86 private static final Map<String, BatteryHistEntry> EMPTY_BATTERY_MAP = new ArrayMap<>();
87 private static final BatteryHistEntry EMPTY_BATTERY_HIST_ENTRY =
88 new BatteryHistEntry(new ContentValues());
136 @Nullable final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) { in getBatteryUsageData()
142 final Map<Long, Map<String, BatteryHistEntry>> processedBatteryHistoryMap = in getBatteryUsageData()
148 final Map<String, BatteryHistEntry> currentBatteryHistoryMap = in getBatteryUsageData()
151 for (Map.Entry<Long, Map<String, BatteryHistEntry>> mapEntry : in getBatteryUsageData()
401 public static Map<String, BatteryHistEntry> getCurrentBatteryHistoryMapFromStatsService( in getCurrentBatteryHistoryMapFromStatsService()
403 final List<BatteryHistEntry> batteryHistEntryList = in getCurrentBatteryHistoryMapFromStatsService()
416 static Map<Long, Map<String, BatteryHistEntry>> getHistoryMapWithExpectedTimestamps( in getHistoryMapWithExpectedTimestamps()
[all …]
DBatteryHistEntry.java24 public class BatteryHistEntry { class
70 public BatteryHistEntry(ContentValues values) { in BatteryHistEntry() method in BatteryHistEntry
100 public BatteryHistEntry(Cursor cursor) { in BatteryHistEntry() method in BatteryHistEntry
130 private BatteryHistEntry( in BatteryHistEntry() method in BatteryHistEntry
131 BatteryHistEntry fromEntry, in BatteryHistEntry()
287 public static BatteryHistEntry interpolate( in interpolate()
291 BatteryHistEntry lowerHistEntry, in interpolate()
292 BatteryHistEntry upperHistEntry) { in interpolate()
365 return new BatteryHistEntry( in interpolate()
DDataProcessManager.java78 @VisibleForTesting static Map<Long, Map<String, BatteryHistEntry>> sFakeBatteryHistoryMap;
92 private final Map<Long, Map<String, BatteryHistEntry>> mBatteryHistoryMap;
133 @NonNull final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) { in DataProcessManager()
233 new AsyncTask<Void, Void, Map<String, BatteryHistEntry>>() { in loadCurrentBatteryHistoryMap()
235 protected Map<String, BatteryHistEntry> doInBackground(Void... voids) { in loadCurrentBatteryHistoryMap()
238 final Map<String, BatteryHistEntry> currentBatteryHistoryMap = in loadCurrentBatteryHistoryMap()
251 final Map<String, BatteryHistEntry> currentBatteryHistoryMap) { in loadCurrentBatteryHistoryMap()
254 for (Map.Entry<Long, Map<String, BatteryHistEntry>> mapEntry : in loadCurrentBatteryHistoryMap()
643 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = in getPeriodBatteryLevelData()
660 final Map<Long, Map<String, BatteryHistEntry>> processedBatteryHistoryMap = in getPeriodBatteryLevelData()
DConvertUtils.java110 values.put(BatteryHistEntry.KEY_UID, Long.valueOf(entry.getUid())); in convertBatteryEntryToContentValues()
112 BatteryHistEntry.KEY_USER_ID, in convertBatteryEntryToContentValues()
115 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, packageName != null ? packageName : ""); in convertBatteryEntryToContentValues()
117 BatteryHistEntry.KEY_CONSUMER_TYPE, Integer.valueOf(entry.getConsumerType())); in convertBatteryEntryToContentValues()
119 values.put(BatteryHistEntry.KEY_PACKAGE_NAME, FAKE_PACKAGE_NAME); in convertBatteryEntryToContentValues()
121 values.put(BatteryHistEntry.KEY_TIMESTAMP, Long.valueOf(timestamp)); in convertBatteryEntryToContentValues()
123 BatteryHistEntry.KEY_IS_FULL_CHARGE_CYCLE_START, in convertBatteryEntryToContentValues()
134 BatteryHistEntry.KEY_BATTERY_INFORMATION, in convertBatteryEntryToContentValues()
139 BatteryHistEntry.KEY_BATTERY_INFORMATION_DEBUG, batteryInformation.toString()); in convertBatteryEntryToContentValues()
219 public static BatteryHistEntry convertToBatteryHistEntry( in convertToBatteryHistEntry()
[all …]
DDatabaseUtils.java348 static Map<Long, Map<String, BatteryHistEntry>> getHistoryMapSinceQueryTimestamp( in getHistoryMapSinceQueryTimestamp()
360 final List<BatteryHistEntry> batteryHistEntryList = in getHistoryMapSinceQueryTimestamp()
362 context, batteryStateUri, cursor -> new BatteryHistEntry(cursor)); in getHistoryMapSinceQueryTimestamp()
363 final Map<Long, Map<String, BatteryHistEntry>> resultMap = new ArrayMap(); in getHistoryMapSinceQueryTimestamp()
364 for (final BatteryHistEntry entry : batteryHistEntryList) { in getHistoryMapSinceQueryTimestamp()
393 public static Map<Long, Map<String, BatteryHistEntry>>
414 public static Map<Long, Map<String, BatteryHistEntry>> getHistoryMapSinceLastFullCharge( in getHistoryMapSinceLastFullCharge()
DBatteryChartPreferenceController.java556 final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap =