Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99d10a4e authored by James Lemieux's avatar James Lemieux
Browse files

Adopt robolectric 3.6.1

Bug: 71596155
Test: make RunSettingsRoboTests
Change-Id: I46362bae1e3ddd3ce19ade1c93250d272f3366e6
parent e9a3a143
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \

LOCAL_JAVA_LIBRARIES := \
    junit \
    platform-robolectric-3.5.1-prebuilt \
    platform-robolectric-3.6.1-prebuilt \
    telephony-common

LOCAL_INSTRUMENTATION_FOR := Settings
@@ -42,4 +42,4 @@ LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))../src

LOCAL_ROBOTEST_TIMEOUT := 36000

include prebuilts/misc/common/robolectric/3.5.1/run_robotests.mk
include prebuilts/misc/common/robolectric/3.6.1/run_robotests.mk
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class BluetoothPairingPreferenceControllerTest {
        Preference pref = mController.createBluetoothPairingPreference(ORDER);

        assertThat(pref.getKey()).isEqualTo(BluetoothPairingPreferenceController.KEY_PAIRING);
        assertThat(pref.getIcon()).isEqualTo(mContext.getDrawable(R.drawable.ic_add));
        assertThat(pref.getIcon()).isEqualTo(mContext.getDrawable(R.drawable.ic_menu_add));
        assertThat(pref.getOrder()).isEqualTo(ORDER);
        assertThat(pref.getTitle()).isEqualTo(
                mContext.getString(R.string.bluetooth_pairing_pref_title));
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class BatteryInfoLoaderTest {
    @Test
    public void test_loadInBackground_dischargingOldEstimate_dischargingLabelNotNull() {
        BatteryInfoLoader loader = new BatteryInfoLoader(mContext, mHelper);
        loader.batteryUtils = new BatteryUtils(mContext);

        BatteryInfo info = loader.loadInBackground();

Loading