Render enhanced battery projection curves.

BatteryInfo now supplies standard linear or enhanced projection curves,
depending on the provider.

Note that the semantics of parsing have changed slightly in that the
value of endTime supplied to onParsingStarted is now the end time of the
historical data and does not include the projection. However, as far as
I can see there is no existing code that depends on the parsing
functionality besides BatteryInfo itself.

Also slightly optimizes the updating behavior of the UsageGraph, since
we are now reconfiguring it multiple times.

Bug: 38400320
Test: make RunSettingsRoboTests, manual on device
Change-Id: Ieff26d31356b34bb38e49f54f979fd80549864b2
This commit is contained in:
Alex Kulesza
2017-06-29 12:26:59 -04:00
parent 43d4fefb36
commit 82dbcd973d
5 changed files with 196 additions and 35 deletions

View File

@@ -22,9 +22,10 @@ import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Process;
import android.util.SparseIntArray;
import com.android.internal.os.BatterySipper;
import com.android.internal.util.ArrayUtils;
import com.android.settings.fuelgauge.anomaly.Anomaly;
public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider {
@@ -93,6 +94,11 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
return -1;
}
@Override
public SparseIntArray getEnhancedBatteryPredictionCurve(Context context, long zeroTime) {
return null;
}
@Override
public boolean isEnhancedBatteryPredictionEnabled(Context context) {
return false;