Replaces getBatteryHistoryUri and getBatteryHistorySinceLastFullCharge

with the new functions in DatabaseUtils.

Bug: 253395332
Test: make RunSettingsRoboTests + manually
Change-Id: I5f60cef80d1e9ba3f87ab6f84492463152a40276
This commit is contained in:
Kuan Wang
2022-10-25 20:37:11 +08:00
parent df05a1378b
commit c5c87b7774
7 changed files with 6 additions and 109 deletions

View File

@@ -123,7 +123,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
super.onPause();
// Resets the flag to reload usage data in onResume() callback.
mIsChartDataLoaded = false;
final Uri uri = mPowerUsageFeatureProvider.getBatteryHistoryUri();
final Uri uri = DatabaseUtils.BATTERY_CONTENT_URI;
if (uri != null) {
getContext().getContentResolver().unregisterContentObserver(mBatteryObserver);
}
@@ -132,7 +132,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
@Override
public void onResume() {
super.onResume();
final Uri uri = mPowerUsageFeatureProvider.getBatteryHistoryUri();
final Uri uri = DatabaseUtils.BATTERY_CONTENT_URI;
if (uri != null) {
getContext().getContentResolver().registerContentObserver(
uri, /*notifyForDescendants*/ true, mBatteryObserver);