Add ability to speak to provider for enhanced estimate

Added code that checks if the provider for the enhanced battery
drain estimate is available. If it is available we use that
value instead of the one computed by BatteryStats.

Test: Robotests
Bug: 37753227
Change-Id: I7eae01b56f85d33eafc42ee0f18bb752779581b2
This commit is contained in:
Salvador Martinez
2017-05-03 18:58:27 -07:00
parent cdf5fe0d64
commit 126c032afa
4 changed files with 125 additions and 6 deletions

View File

@@ -19,6 +19,8 @@ package com.android.settings.fuelgauge;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Process;
import com.android.internal.os.BatterySipper;
import com.android.internal.util.ArrayUtils;
@@ -89,4 +91,24 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
public boolean isAnomalyDetectionEnabled() {
return false;
}
@Override
public long getEnhancedBatteryPrediction(Context context) {
return -1;
}
@Override
public boolean isEnhancedBatteryPredictionEnabled(Context context) {
return false;
}
@Override
public Uri getEnhancedBatteryPredictionUri() {
return null;
}
@Override
public long getTimeRemainingEstimate(Cursor cursor) {
return 0;
}
}