import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {ShadowEntityHeaderController.class, ShadowActivityManager.class})
public class AdvancedPowerUsageDetailTest {
private static final String APP_LABEL = "app label";
import org.robolectric.util.ReflectionHelpers;
@RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppButtonsPreferenceControllerTest {
private static final String PACKAGE_NAME = "com.android.settings";
private static final String RESOURCE_STRING = "string";
import static org.mockito.Mockito.verify;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryBroadcastReceiverTest {
private static final String BATTERY_INIT_LEVEL = "100%";
private static final String BATTERY_INIT_STATUS = "Not charging";
import static org.mockito.Mockito.when;
@RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryEntryTest {
private static final int APP_UID = 123;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O
+ ,
shadows = {
SettingsShadowResources.class,
SettingsShadowResources.SettingsShadowTheme.class
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryInfoLoaderTest {
private static final long TEST_TIME_REMAINING = 1000L;
import java.util.concurrent.TimeUnit;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryInfoTest {
private static final String STATUS_FULL = "Full";
@RunWith(SettingsRobolectricTestRunner.class)
// TODO: Consider making the shadow class set global using a robolectric.properties file.
@Config(manifest = TestConfig.MANIFEST_PATH,
- sdk = TestConfig.SDK_VERSION,
+ sdk = TestConfig.SDK_VERSION_O,
shadows = {
SettingsShadowResources.class,
SettingsShadowTheme.class,
import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryOptimizationPreferenceControllerTest {
private static final String PKG_IN_WHITELIST = "com.pkg.in.whitelist";
private static final String PKG_NOT_IN_WHITELIST = "com.pkg.not.in.whitelist";
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatterySaverControllerTest {
@Mock
private MasterSwitchPreference mBatterySaverPref;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatterySaverReceiverTest {
@Mock
private BatterySaverReceiver.BatterySaverListener mBatterySaverListener;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatterySaverSettingsTest {
private Context mContext;
private BatterySaverSettings mBatterySaverSettings;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryStatsHelperLoaderTest {
@Mock
private BatteryUtils mBatteryUtils;
import static org.mockito.Mockito.spy;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BatteryUtilsTest {
// unit that used to converted ms to us
private static final long UNIT = 1000;
import org.robolectric.util.FragmentTestUtil;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
ShadowEventLogWriter.class
})
public class ButtonActionDialogFragmentTest {
import static org.mockito.Mockito.verify;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class HighPowerDetailTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PowerGaugePreferenceTest {
private static final String SUBTITLE = "Summary";
private static final String CONTENT_DESCRIPTION = "Content description";
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PowerUsageAdvancedTest {
private static final int FAKE_UID_1 = 50;
private static final int FAKE_UID_2 = 100;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PowerUsageAnomalyDetailsTest {
private static final String NAME_APP_1 = "app1";
private static final String NAME_APP_2 = "app2";
* Unit tests for {@link PowerUsageBase}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowDashboardFragment.class)
public class PowerUsageBaseTest {
@Mock
import static com.google.common.truth.Truth.assertThat;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PowerUsageFeatureProviderImplTest {
private static final int UID_OTHER = Process.FIRST_APPLICATION_UID + 2;
private static final int UID_CALENDAR = Process.FIRST_APPLICATION_UID + 3;
// TODO: Improve this test class so that it starts up the real activity and fragment.
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH,
- sdk = TestConfig.SDK_VERSION,
+ sdk = TestConfig.SDK_VERSION_O,
shadows = {
SettingsShadowResources.class,
SettingsShadowResources.SettingsShadowTheme.class,
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AnomalyDetectionPolicyTest {
private static final String ANOMALY_DETECTION_CONSTANTS_VALUE =
"anomaly_detection_enabled=true"
import org.robolectric.util.FragmentTestUtil;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowRuntimePermissionPresenter.class)
public class AnomalyDialogFragmentTest {
private static final String PACKAGE_NAME = "com.android.app";
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O
+)
public class AnomalyLoaderTest {
private static final String PACKAGE_NAME = "com.android.settings";
private static final CharSequence DISPLAY_NAME = "Settings";
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AnomalyPreferenceTest {
@Anomaly.AnomalyType
private static final int ANOMALY_TYPE = Anomaly.AnomalyType.WAKE_LOCK;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AnomalyTest {
private static int TYPE = Anomaly.AnomalyType.WAKE_LOCK;
private static int UID = 111;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
ShadowKeyValueListParserWrapperImpl.class})
public class AnomalyUtilsTest {
private static final String PACKAGE_NAME_WAKEUP = "com.android.app1";
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AnomalyActionTest {
private static final String PACKAGE_NAME = "com.android.app";
private static final int UID = 111;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BackgroundCheckActionTest {
private static final String PACKAGE_NAME = "com.android.app";
private static final int UID = 111;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class ForceStopActionTest {
private static final String PACKAGE_NAME = "com.android.app";
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows =
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows =
ShadowPermissionChecker.class)
public class LocationCheckActionTest {
private static final String PACKAGE_NAME = "com.android.app";
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class StopAndBackgroundActionTest {
private static final String PACKAGE_NAME = "com.android.app";
private static final int UID = 111;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothScanAnomalyDetectorTest {
private static final String TARGET_PACKAGE_NAME = "com.android.app";
private static final int ANOMALY_UID = 111;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class WakeLockAnomalyDetectorTest {
private static final String TARGET_PACKAGE_NAME = "com.android.app";
private static final long ANOMALY_WAKELOCK_TIME_MS = 2 * DateUtils.HOUR_IN_MILLIS;
import java.util.Set;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class WakeupAlarmAnomalyDetectorTest {
private static final String TARGET_PACKAGE_NAME = "com.android.target";
private static final String ANOMALY_PACKAGE_NAME = "com.android.anomaly";