Adopt new battery history map with interpolation method

Bug: 184807417
Test: make SettingsRoboTests
Change-Id: I5c45a443d0a72df352d4bb707412328ad009f6d4
This commit is contained in:
ykhung
2021-05-06 15:29:41 +08:00
parent 953b7e3bf5
commit f76ba1189a
9 changed files with 94 additions and 147 deletions

View File

@@ -20,12 +20,11 @@ import android.content.Context;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.utils.AsyncLoaderCompat;
import java.util.List;
import java.util.Map;
/** Loader that can be used to load battery history information. */
public class BatteryHistoryLoader
extends AsyncLoaderCompat<Map<Long, List<BatteryHistEntry>>> {
extends AsyncLoaderCompat<Map<Long, Map<String, BatteryHistEntry>>> {
private static final String TAG = "BatteryHistoryLoader";
private final Context mContext;
@@ -36,11 +35,11 @@ public class BatteryHistoryLoader
}
@Override
protected void onDiscardResult(Map<Long, List<BatteryHistEntry>> result) {
protected void onDiscardResult(Map<Long, Map<String, BatteryHistEntry>> result) {
}
@Override
public Map<Long, List<BatteryHistEntry>> loadInBackground() {
public Map<Long, Map<String, BatteryHistEntry>> loadInBackground() {
final PowerUsageFeatureProvider powerUsageFeatureProvider =
FeatureFactory.getFactory(mContext).getPowerUsageFeatureProvider(mContext);
return powerUsageFeatureProvider.getBatteryHistory(mContext);