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:
@@ -20,8 +20,9 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.internal.os.BatterySipper;
|
||||
import com.android.settings.fuelgauge.anomaly.Anomaly;
|
||||
|
||||
/**
|
||||
* Feature Provider used in power usage
|
||||
@@ -67,6 +68,12 @@ public interface PowerUsageFeatureProvider {
|
||||
*/
|
||||
long getEnhancedBatteryPrediction(Context context);
|
||||
|
||||
/**
|
||||
* Returns an improved projection curve for future battery level.
|
||||
* @param zeroTime timestamps (array keys) are shifted by this amount
|
||||
*/
|
||||
SparseIntArray getEnhancedBatteryPredictionCurve(Context context, long zeroTime);
|
||||
|
||||
/**
|
||||
* Checks whether the toggle for enhanced battery predictions is enabled.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user