Adopt robolectric 3.6.1

Bug: 71596155
Test: make RunSettingsRoboTests
Change-Id: I46362bae1e3ddd3ce19ade1c93250d272f3366e6
This commit is contained in:
James Lemieux
2018-01-11 18:07:54 -08:00
parent e9a3a14330
commit 99d10a4e62
8 changed files with 55 additions and 78 deletions

View File

@@ -20,6 +20,8 @@ import android.content.Context;
import com.android.internal.os.BatteryStatsHelper;
import com.android.settingslib.utils.AsyncLoader;
import com.android.internal.annotations.VisibleForTesting;
/**
* Loader that can be used by classes to load BatteryInfo in a background thread. This loader will
* automatically grab enhanced battery estimates if available or fall back to the system estimate
@@ -30,9 +32,13 @@ public class BatteryInfoLoader extends AsyncLoader<BatteryInfo>{
BatteryStatsHelper mStatsHelper;
private static final String LOG_TAG = "BatteryInfoLoader";
@VisibleForTesting
BatteryUtils batteryUtils;
public BatteryInfoLoader(Context context, BatteryStatsHelper batteryStatsHelper) {
super(context);
mStatsHelper = batteryStatsHelper;
batteryUtils = BatteryUtils.getInstance(context);
}
@Override
@@ -42,7 +48,6 @@ public class BatteryInfoLoader extends AsyncLoader<BatteryInfo>{
@Override
public BatteryInfo loadInBackground() {
final BatteryUtils batteryUtils = BatteryUtils.getInstance(getContext());
return batteryUtils.getBatteryInfo(mStatsHelper, LOG_TAG);
}
}

View File

@@ -136,7 +136,7 @@ public class SlicesDatabaseHelper extends SQLiteOpenHelper {
mContext.getSharedPreferences(SHARED_PREFS_TAG, Context.MODE_PRIVATE)
.edit()
.clear()
.commit();
.apply();
dropTables(db);
createDatabases(db);
}