Add new database table and proto for battery usage reattribution (2/5)

Bug: 346706894
Test: atest SettingsRoboTests:com.android.settings.fuelgauge.batteryusage
Flag: EXEMPT bug fix
Change-Id: If360246d974abdea7004023aedcf1a4be7b63633
This commit is contained in:
YK Hung
2024-06-16 16:55:27 +00:00
parent be647ab053
commit f5cf54bcc7
9 changed files with 351 additions and 2 deletions

View File

@@ -429,6 +429,7 @@ public final class DatabaseUtils {
database.batteryEventDao().clearAll();
database.batteryStateDao().clearAll();
database.batteryUsageSlotDao().clearAll();
database.batteryReattributeDao().clearAll();
} catch (RuntimeException e) {
Log.e(TAG, "clearAll() failed", e);
}
@@ -446,6 +447,7 @@ public final class DatabaseUtils {
database.batteryEventDao().clearAllAfter(startTimestamp);
database.batteryStateDao().clearAllAfter(startTimestamp);
database.batteryUsageSlotDao().clearAllAfter(startTimestamp);
database.batteryReattributeDao().clearAllAfter(startTimestamp);
} catch (RuntimeException e) {
Log.e(TAG, "clearAllAfter() failed", e);
}
@@ -466,6 +468,7 @@ public final class DatabaseUtils {
database.batteryEventDao().clearAllBefore(earliestTimestamp);
database.batteryStateDao().clearAllBefore(earliestTimestamp);
database.batteryUsageSlotDao().clearAllBefore(earliestTimestamp);
database.batteryReattributeDao().clearAllBefore(earliestTimestamp);
} catch (RuntimeException e) {
Log.e(TAG, "clearAllBefore() failed", e);
}