Merge "Don't override expand count when page is opened from search"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 07908e5..8eaf761 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2213,16 +2213,13 @@
         <activity android:name="Settings$PowerUsageSummaryActivity"
                 android:label="@string/power_usage_summary_title"
                 android:icon="@drawable/ic_settings_battery"
-                android:taskAffinity="">
-            <intent-filter android:priority="1">
+                android:enabled="false">
+            <!-- TODO(b/69867246): add priority for this intent-filter -->
+            <intent-filter>
                 <action android:name="android.intent.action.POWER_USAGE_SUMMARY" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.settings.SHORTCUT" />
-            </intent-filter>
+            <!-- TODO(b/69867246): add shortcut intent-filter  -->
             <intent-filter android:priority="8">
                 <action android:name="com.android.settings.action.SETTINGS" />
             </intent-filter>
@@ -2241,6 +2238,27 @@
                 android:value="com.android.settings.fuelgauge.PowerUsageSummary" />
         </activity-alias>
 
+        <activity android:name=".Settings$PowerUsageSummaryLegacyActivity"
+                  android:label="@string/power_usage_summary_title"
+                  android:icon="@drawable/ic_settings_battery">
+            <intent-filter android:priority="1">
+                <action android:name="android.intent.action.POWER_USAGE_SUMMARY" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="com.android.settings.SHORTCUT" />
+            </intent-filter>
+            <intent-filter android:priority="8">
+                <action android:name="com.android.settings.action.SETTINGS" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.category"
+                       android:value="com.android.settings.category.ia.homepage" />
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                       android:value="com.android.settings.fuelgauge.PowerUsageSummaryLegacy" />
+        </activity>
+
         <activity android:name="Settings$BatterySaverSettingsActivity"
                 android:label="@string/battery_saver"
                 android:icon="@drawable/ic_settings_battery"
diff --git a/res/values/bools.xml b/res/values/bools.xml
index 59367b55..c896a45 100644
--- a/res/values/bools.xml
+++ b/res/values/bools.xml
@@ -48,4 +48,7 @@
 
     <!--Whether help links are defined. -->
     <bool name="config_has_help">false</bool>
+
+    <!-- Whether location mode is available or not. -->
+    <bool name="config_location_mode_available">true</bool>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ab9e878..7331d72 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1486,7 +1486,7 @@
     <string name="bluetooth_display_passkey_pin_msg">To pair with:<xliff:g id="bold1">&lt;br>&lt;b></xliff:g><xliff:g id="device_name">%1$s</xliff:g><xliff:g id="end_bold1">&lt;/b>&lt;br>&lt;br></xliff:g>Type on it:<xliff:g id="bold2">&lt;br>&lt;b></xliff:g><xliff:g id="passkey">%2$s</xliff:g><xliff:g id="end_bold2">&lt;/b></xliff:g>, then press Return or Enter.</string>
 
     <!-- Checkbox message in pairing dialogs.  [CHAR LIMIT=NONE] -->
-    <string name="bluetooth_pairing_shares_phonebook">Allow <xliff:g id="device_name">%1$s</xliff:g> to access your contacts and call history</string>
+    <string name="bluetooth_pairing_shares_phonebook">Allow access to your contacts and call history</string>
 
     <!-- Title for BT error dialogs. -->
     <string name="bluetooth_error_title"></string>
@@ -6741,6 +6741,9 @@
     <!--  Do not disturb: Title for the zen mode automatic rules page in settings. [CHAR LIMIT=30] -->
     <string name="zen_mode_automation_settings_page_title">Automatic rules</string>
 
+    <!--  Do not disturb: Title for a specific zen mode automatic rule in settings. [CHAR LIMIT=30] -->
+    <string name="zen_mode_automatic_rule_settings_page_title">Automatic rule</string>
+
     <!--  Do not disturb: Title for the zen mode automation option Suggestion. [CHAR LIMIT=50] -->
     <string name="zen_mode_automation_suggestion_title">Set Do Not Disturb rules</string>
 
diff --git a/res/xml/power_usage_summary_legacy.xml b/res/xml/power_usage_summary_legacy.xml
new file mode 100644
index 0000000..80179c0
--- /dev/null
+++ b/res/xml/power_usage_summary_legacy.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:key="power_usage_summary_screen"
+    android:title="@string/power_usage_summary_title"
+    settings:keywords="@string/keywords_battery">
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="battery_header"
+        android:selectable="true"
+        android:layout="@layout/battery_header"/>
+
+    <Preference
+        android:key="high_usage"
+        android:icon="@drawable/ic_battery_alert_24dp"
+        android:title="@string/power_high_usage_title"/>
+
+    <PreferenceCategory
+        android:key="device_usage_list">
+
+        <com.android.settings.fuelgauge.PowerGaugePreference
+            android:key="last_full_charge"
+            android:title="@string/battery_last_full_charge"
+            android:selectable="false"/>
+
+        <com.android.settings.fuelgauge.PowerGaugePreference
+            android:key="screen_usage"
+            android:title="@string/device_screen_usage"
+            android:selectable="false"/>
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:key="power_management"
+        android:title="@string/battery_power_management">
+
+        <com.android.settings.widget.MasterSwitchPreference
+            android:fragment="com.android.settings.fuelgauge.BatterySaverSettings"
+            android:key="battery_saver_summary"
+            android:title="@string/battery_saver"/>
+
+        <SwitchPreference
+            android:key="battery_percentage"
+            android:title="@string/battery_percentage"
+            android:summary="@string/battery_percentage_description"/>
+
+        <!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
+        <SwitchPreference
+            android:key="auto_brightness_battery"
+            android:title="@string/auto_brightness_title"
+            android:summary="@string/auto_brightness_summary"
+            settings:keywords="@string/keywords_display_auto_brightness"/>
+
+        <!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
+        <com.android.settings.TimeoutListPreference
+            android:key="screen_timeout_battery"
+            android:title="@string/screen_timeout"
+            android:summary="@string/screen_timeout_summary"
+            android:entries="@array/screen_timeout_entries"
+            android:entryValues="@array/screen_timeout_values"/>
+
+        <!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
+        <Preference
+            android:key="ambient_display_battery"
+            android:title="@string/ambient_display_screen_title"
+            android:fragment="com.android.settings.display.AmbientDisplaySettings" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:key="app_list"
+        android:title="@string/power_usage_list_summary"/>
+
+</PreferenceScreen>
diff --git a/res/xml/zen_mode_event_rule_settings.xml b/res/xml/zen_mode_event_rule_settings.xml
index 102d2a2..159dbe0 100644
--- a/res/xml/zen_mode_event_rule_settings.xml
+++ b/res/xml/zen_mode_event_rule_settings.xml
@@ -15,8 +15,18 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-    android:key="zen_mode_event_rule_settings" >
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:key="zen_mode_event_rule_settings"
+    android:title="@string/zen_mode_automatic_rule_settings_page_title">
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="pref_app_header"
+        android:layout="@layout/settings_entity_header" />
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="zen_automatic_rule_switch"
+        android:layout="@layout/styled_switch_bar" />
 
     <!-- Rule name -->
     <Preference
@@ -36,10 +46,4 @@
         android:title="@string/zen_mode_event_rule_reply"
         android:summary="%s" />
 
-    <!-- Zen mode -->
-    <DropDownPreference
-        android:key="zen_mode"
-        android:title="@string/zen_mode_settings_title"
-        android:summary="%s" />
-
 </PreferenceScreen>
diff --git a/res/xml/zen_mode_schedule_rule_settings.xml b/res/xml/zen_mode_schedule_rule_settings.xml
index 6224ce1..a0c52c0 100644
--- a/res/xml/zen_mode_schedule_rule_settings.xml
+++ b/res/xml/zen_mode_schedule_rule_settings.xml
@@ -15,8 +15,18 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-    android:key="zen_mode_schedule_rule_settings" >
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:key="zen_mode_schedule_rule_settings"
+    android:title="@string/zen_mode_automatic_rule_settings_page_title">
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="pref_app_header"
+        android:layout="@layout/settings_entity_header" />
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="zen_automatic_rule_switch"
+        android:layout="@layout/styled_switch_bar" />
 
     <!-- Rule name -->
     <Preference
@@ -39,11 +49,4 @@
         android:summary="@string/zen_mode_schedule_alarm_summary"
         android:order="99" />
 
-    <!-- Zen mode -->
-    <DropDownPreference
-            android:key="zen_mode"
-            android:title="@string/zen_mode_settings_title"
-            android:order="100"
-            android:summary="%s" />
-
 </PreferenceScreen>
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index da35c4b..ff0f59f 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -16,6 +16,7 @@
 
 package com.android.settings;
 
+import static com.android.settings.core.FeatureFlags.BATTERY_SETTINGS_V2;
 import static com.android.settings.core.FeatureFlags.CONNECTED_DEVICE_V2;
 
 import android.os.Bundle;
@@ -72,7 +73,6 @@
     public static class PrivacySettingsActivity extends SettingsActivity { /* empty */ }
     public static class FactoryResetActivity extends SettingsActivity { /* empty */ }
     public static class RunningServicesActivity extends SettingsActivity { /* empty */ }
-    public static class PowerUsageSummaryActivity extends SettingsActivity { /* empty */ }
     public static class BatterySaverSettingsActivity extends SettingsActivity { /* empty */ }
     public static class AccountSyncSettingsActivity extends SettingsActivity { /* empty */ }
     public static class AccountSyncSettingsInAddAccountActivity extends SettingsActivity { /* empty */ }
@@ -174,6 +174,8 @@
         }
     }
     public static class ConnectedDeviceDashboardActivityOld extends SettingsActivity {}
+    public static class PowerUsageSummaryActivity extends SettingsActivity { /* empty */ }
+    public static class PowerUsageSummaryLegacyActivity extends SettingsActivity { /* empty */ }
     public static class AppAndNotificationDashboardActivity extends SettingsActivity {}
     public static class StorageDashboardActivity extends SettingsActivity {}
     public static class UserAndAccountDashboardActivity extends SettingsActivity {}
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index dc961be..e684e5e 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -810,9 +810,17 @@
                 Utils.showSimCardTile(this), isAdmin)
                 || somethingChanged;
 
+        final boolean isBatterySettingsV2Enabled = FeatureFactory.getFactory(this)
+                .getPowerUsageFeatureProvider(this)
+                .isBatteryV2Enabled();
+        // Enable new battery page if v2 enabled
         somethingChanged = setTileEnabled(new ComponentName(packageName,
                         Settings.PowerUsageSummaryActivity.class.getName()),
-                mBatteryPresent, isAdmin) || somethingChanged;
+                mBatteryPresent && isBatterySettingsV2Enabled, isAdmin) || somethingChanged;
+        // Enable legacy battery page if v2 disabled
+        somethingChanged = setTileEnabled(new ComponentName(packageName,
+                        Settings.PowerUsageSummaryLegacyActivity.class.getName()),
+                mBatteryPresent && !isBatterySettingsV2Enabled, isAdmin) || somethingChanged;
 
         somethingChanged = setTileEnabled(new ComponentName(packageName,
                         Settings.UserSettingsActivity.class.getName()),
diff --git a/src/com/android/settings/core/FeatureFlags.java b/src/com/android/settings/core/FeatureFlags.java
index 547318f..197876f 100644
--- a/src/com/android/settings/core/FeatureFlags.java
+++ b/src/com/android/settings/core/FeatureFlags.java
@@ -25,4 +25,5 @@
     public static final String SUGGESTIONS_V2 = "new_settings_suggestion";
     public static final String APP_INFO_V2 = "settings_app_info_v2";
     public static final String CONNECTED_DEVICE_V2 = "settings_connected_device_v2";
+    public static final String BATTERY_SETTINGS_V2 = "settings_battery_v2";
 }
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 37cd431..7720b48 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -79,6 +79,7 @@
 import com.android.settings.fuelgauge.AdvancedPowerUsageDetail;
 import com.android.settings.fuelgauge.BatterySaverSettings;
 import com.android.settings.fuelgauge.PowerUsageSummary;
+import com.android.settings.fuelgauge.PowerUsageSummaryLegacy;
 import com.android.settings.gestures.AssistGestureSettings;
 import com.android.settings.gestures.DoubleTapPowerSettings;
 import com.android.settings.gestures.DoubleTapScreenSettings;
@@ -181,6 +182,7 @@
             AndroidBeam.class.getName(),
             WifiDisplaySettings.class.getName(),
             PowerUsageSummary.class.getName(),
+            PowerUsageSummaryLegacy.class.getName(),
             AccountSyncSettings.class.getName(),
             AssistGestureSettings.class.getName(),
             SwipeToNotificationSettings.class.getName(),
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
index 6d7e1e8..1fb02c4 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
@@ -115,4 +115,9 @@
      * enabled. This string notifies users that the estimate is using enhanced prediction.
      */
     String getAdvancedUsageScreenInfoString();
+
+    /**
+     * Checks whether to display the battery v2.
+     */
+    boolean isBatteryV2Enabled();
 }
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
index 0814364..cda4d3d 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
@@ -16,12 +16,15 @@
 
 package com.android.settings.fuelgauge;
 
+import static com.android.settings.core.FeatureFlags.BATTERY_SETTINGS_V2;
+
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Process;
+import android.util.FeatureFlagUtils;
 import android.util.SparseIntArray;
 
 import com.android.internal.os.BatterySipper;
@@ -36,9 +39,11 @@
             PACKAGE_CALENDAR_PROVIDER, PACKAGE_SYSTEMUI};
 
     protected PackageManager mPackageManager;
+    protected Context mContext;
 
     public PowerUsageFeatureProviderImpl(Context context) {
         mPackageManager = context.getPackageManager();
+        mContext = context.getApplicationContext();
     }
 
     @Override
@@ -133,4 +138,9 @@
     public String getAdvancedUsageScreenInfoString() {
         return null;
     }
+
+    @Override
+    public boolean isBatteryV2Enabled() {
+        return FeatureFlagUtils.isEnabled(mContext, BATTERY_SETTINGS_V2);
+    }
 }
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index bf3cc64..ed5b6f4 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -251,7 +251,7 @@
 
     @Override
     public int getMetricsCategory() {
-        return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY;
+        return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY_V2;
     }
 
     @Override
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java b/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java
new file mode 100644
index 0000000..c50d580
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java
@@ -0,0 +1,889 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.fuelgauge;
+
+import android.app.Activity;
+import android.app.LoaderManager.LoaderCallbacks;
+import android.content.Context;
+import android.content.Loader;
+import android.graphics.drawable.Drawable;
+import android.os.BatteryStats;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Process;
+import android.os.UserHandle;
+import android.support.annotation.VisibleForTesting;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceGroup;
+import android.text.TextUtils;
+import android.text.format.DateUtils;
+import android.text.format.Formatter;
+import android.util.Log;
+import android.util.SparseArray;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnLongClickListener;
+import android.widget.TextView;
+
+import com.android.internal.hardware.AmbientDisplayConfiguration;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.os.BatterySipper;
+import com.android.internal.os.BatterySipper.DrainType;
+import com.android.internal.os.PowerProfile;
+import com.android.settings.R;
+import com.android.settings.Settings.HighPowerApplicationsActivity;
+import com.android.settings.SettingsActivity;
+import com.android.settings.Utils;
+import com.android.settings.applications.LayoutPreference;
+import com.android.settings.applications.manageapplications.ManageApplications;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
+import com.android.settings.dashboard.SummaryLoader;
+import com.android.settings.display.AmbientDisplayPreferenceController;
+import com.android.settings.display.AutoBrightnessPreferenceController;
+import com.android.settings.display.BatteryPercentagePreferenceController;
+import com.android.settings.display.TimeoutPreferenceController;
+import com.android.settings.fuelgauge.anomaly.Anomaly;
+import com.android.settings.fuelgauge.anomaly.AnomalyDetectionPolicy;
+import com.android.settings.fuelgauge.anomaly.AnomalyDialogFragment.AnomalyDialogListener;
+import com.android.settings.fuelgauge.anomaly.AnomalyLoader;
+import com.android.settings.fuelgauge.anomaly.AnomalySummaryPreferenceController;
+import com.android.settings.fuelgauge.anomaly.AnomalyUtils;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Displays a list of apps and subsystems that consume power, ordered by how much power was
+ * consumed since the last time it was unplugged.
+ *
+ * This is the battery page used in Android O with the app usage list. It is also used for battery
+ * debug.
+ */
+public class PowerUsageSummaryLegacy extends PowerUsageBase implements
+        AnomalyDialogListener, OnLongClickListener, OnClickListener {
+
+    static final String TAG = "PowerUsageSummaryLegacy";
+
+    private static final boolean DEBUG = false;
+    private static final boolean USE_FAKE_DATA = false;
+    private static final String KEY_APP_LIST = "app_list";
+    private static final String KEY_BATTERY_HEADER = "battery_header";
+    private static final String KEY_SHOW_ALL_APPS = "show_all_apps";
+    private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 10;
+    private static final int MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP = 10;
+
+    private static final String KEY_SCREEN_USAGE = "screen_usage";
+    private static final String KEY_TIME_SINCE_LAST_FULL_CHARGE = "last_full_charge";
+
+    private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_battery";
+    private static final String KEY_SCREEN_TIMEOUT = "screen_timeout_battery";
+    private static final String KEY_AMBIENT_DISPLAY = "ambient_display_battery";
+    private static final String KEY_BATTERY_SAVER_SUMMARY = "battery_saver_summary";
+    private static final String KEY_HIGH_USAGE = "high_usage";
+
+    @VisibleForTesting
+    static final int ANOMALY_LOADER = 1;
+    @VisibleForTesting
+    static final int BATTERY_INFO_LOADER = 2;
+    private static final int MENU_STATS_TYPE = Menu.FIRST;
+    @VisibleForTesting
+    static final int MENU_HIGH_POWER_APPS = Menu.FIRST + 3;
+    @VisibleForTesting
+    static final int MENU_TOGGLE_APPS = Menu.FIRST + 4;
+    private static final int MENU_HELP = Menu.FIRST + 5;
+    public static final int DEBUG_INFO_LOADER = 3;
+
+    @VisibleForTesting
+    boolean mShowAllApps = false;
+    @VisibleForTesting
+    PowerGaugePreference mScreenUsagePref;
+    @VisibleForTesting
+    PowerGaugePreference mLastFullChargePref;
+    @VisibleForTesting
+    PowerUsageFeatureProvider mPowerFeatureProvider;
+    @VisibleForTesting
+    BatteryUtils mBatteryUtils;
+    @VisibleForTesting
+    LayoutPreference mBatteryLayoutPref;
+
+    /**
+     * SparseArray that maps uid to {@link Anomaly}, so we could find {@link Anomaly} by uid
+     */
+    @VisibleForTesting
+    SparseArray<List<Anomaly>> mAnomalySparseArray;
+    @VisibleForTesting
+    PreferenceGroup mAppListGroup;
+    @VisibleForTesting
+    BatteryHeaderPreferenceController mBatteryHeaderPreferenceController;
+    private AnomalySummaryPreferenceController mAnomalySummaryPreferenceController;
+    private int mStatsType = BatteryStats.STATS_SINCE_CHARGED;
+
+    private LoaderCallbacks<List<Anomaly>> mAnomalyLoaderCallbacks =
+            new LoaderCallbacks<List<Anomaly>>() {
+
+                @Override
+                public Loader<List<Anomaly>> onCreateLoader(int id, Bundle args) {
+                    return new AnomalyLoader(getContext(), mStatsHelper);
+                }
+
+                @Override
+                public void onLoadFinished(Loader<List<Anomaly>> loader, List<Anomaly> data) {
+                    final AnomalyUtils anomalyUtils = AnomalyUtils.getInstance(getContext());
+                    anomalyUtils.logAnomalies(mMetricsFeatureProvider, data,
+                            MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY);
+
+                    // show high usage preference if possible
+                    mAnomalySummaryPreferenceController.updateAnomalySummaryPreference(data);
+
+                    updateAnomalySparseArray(data);
+                    refreshAnomalyIcon();
+                }
+
+                @Override
+                public void onLoaderReset(Loader<List<Anomaly>> loader) {
+
+                }
+            };
+
+    @VisibleForTesting
+    LoaderCallbacks<BatteryInfo> mBatteryInfoLoaderCallbacks =
+            new LoaderCallbacks<BatteryInfo>() {
+
+                @Override
+                public Loader<BatteryInfo> onCreateLoader(int i, Bundle bundle) {
+                    return new BatteryInfoLoader(getContext(), mStatsHelper);
+                }
+
+                @Override
+                public void onLoadFinished(Loader<BatteryInfo> loader, BatteryInfo batteryInfo) {
+                    mBatteryHeaderPreferenceController.updateHeaderPreference(batteryInfo);
+                }
+
+                @Override
+                public void onLoaderReset(Loader<BatteryInfo> loader) {
+                    // do nothing
+                }
+            };
+
+    LoaderCallbacks<List<BatteryInfo>> mBatteryInfoDebugLoaderCallbacks =
+            new LoaderCallbacks<List<BatteryInfo>>() {
+                @Override
+                public Loader<List<BatteryInfo>> onCreateLoader(int i, Bundle bundle) {
+                    return new DebugEstimatesLoader(getContext(), mStatsHelper);
+                }
+
+                @Override
+                public void onLoadFinished(Loader<List<BatteryInfo>> loader,
+                        List<BatteryInfo> batteryInfos) {
+                    final BatteryMeterView batteryView = (BatteryMeterView) mBatteryLayoutPref
+                            .findViewById(R.id.battery_header_icon);
+                    final TextView percentRemaining =
+                            mBatteryLayoutPref.findViewById(R.id.battery_percent);
+                    final TextView summary1 = mBatteryLayoutPref.findViewById(R.id.summary1);
+                    final TextView summary2 = mBatteryLayoutPref.findViewById(R.id.summary2);
+                    BatteryInfo oldInfo = batteryInfos.get(0);
+                    BatteryInfo newInfo = batteryInfos.get(1);
+                    percentRemaining.setText(Utils.formatPercentage(oldInfo.batteryLevel));
+
+                    // set the text to the old estimate (copied from battery info). Note that this
+                    // can sometimes say 0 time remaining because battery stats requires the phone
+                    // be unplugged for a period of time before being willing ot make an estimate.
+                    summary1.setText(mPowerFeatureProvider.getOldEstimateDebugString(
+                            Formatter.formatShortElapsedTime(getContext(),
+                                    BatteryUtils.convertUsToMs(oldInfo.remainingTimeUs))));
+
+                    // for this one we can just set the string directly
+                    summary2.setText(mPowerFeatureProvider.getEnhancedEstimateDebugString(
+                            Formatter.formatShortElapsedTime(getContext(),
+                                    BatteryUtils.convertUsToMs(newInfo.remainingTimeUs))));
+
+                    batteryView.setBatteryLevel(oldInfo.batteryLevel);
+                    batteryView.setCharging(!oldInfo.discharging);
+                }
+
+                @Override
+                public void onLoaderReset(Loader<List<BatteryInfo>> loader) {
+                }
+            };
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        setAnimationAllowed(true);
+
+        initFeatureProvider();
+        mBatteryLayoutPref = (LayoutPreference) findPreference(KEY_BATTERY_HEADER);
+
+        mAppListGroup = (PreferenceGroup) findPreference(KEY_APP_LIST);
+        mScreenUsagePref = (PowerGaugePreference) findPreference(KEY_SCREEN_USAGE);
+        mLastFullChargePref = (PowerGaugePreference) findPreference(
+                KEY_TIME_SINCE_LAST_FULL_CHARGE);
+        mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.battery_footer_summary);
+        mAnomalySummaryPreferenceController = new AnomalySummaryPreferenceController(
+                (SettingsActivity) getActivity(), this, MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY);
+        mBatteryUtils = BatteryUtils.getInstance(getContext());
+        mAnomalySparseArray = new SparseArray<>();
+
+        restartBatteryInfoLoader();
+        restoreSavedInstance(icicle);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY;
+    }
+
+    @Override
+    public void onPause() {
+        BatteryEntry.stopRequestQueue();
+        mHandler.removeMessages(BatteryEntry.MSG_UPDATE_NAME_ICON);
+        super.onPause();
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (getActivity().isChangingConfigurations()) {
+            BatteryEntry.clearUidCache();
+        }
+    }
+
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putBoolean(KEY_SHOW_ALL_APPS, mShowAllApps);
+    }
+
+    @Override
+    public boolean onPreferenceTreeClick(Preference preference) {
+        if (mAnomalySummaryPreferenceController.onPreferenceTreeClick(preference)) {
+            return true;
+        }
+        if (KEY_BATTERY_HEADER.equals(preference.getKey())) {
+            performBatteryHeaderClick();
+            return true;
+        } else if (!(preference instanceof PowerGaugePreference)) {
+            return super.onPreferenceTreeClick(preference);
+        }
+        PowerGaugePreference pgp = (PowerGaugePreference) preference;
+        BatteryEntry entry = pgp.getInfo();
+        AdvancedPowerUsageDetail.startBatteryDetailPage((SettingsActivity) getActivity(),
+                this, mStatsHelper, mStatsType, entry, pgp.getPercent(),
+                mAnomalySparseArray.get(entry.sipper.getUid()));
+        return super.onPreferenceTreeClick(preference);
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.power_usage_summary_legacy;
+    }
+
+    @Override
+    protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+        final List<AbstractPreferenceController> controllers = new ArrayList<>();
+        mBatteryHeaderPreferenceController = new BatteryHeaderPreferenceController(
+                context, getActivity(), this /* host */, getLifecycle());
+        controllers.add(mBatteryHeaderPreferenceController);
+        controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
+        controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
+        controllers.add(new BatterySaverController(context, getLifecycle()));
+        controllers.add(new BatteryPercentagePreferenceController(context));
+        controllers.add(new AmbientDisplayPreferenceController(
+                context,
+                new AmbientDisplayConfiguration(context),
+                KEY_AMBIENT_DISPLAY));
+        return controllers;
+    }
+
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        if (DEBUG) {
+            menu.add(Menu.NONE, MENU_STATS_TYPE, Menu.NONE, R.string.menu_stats_total)
+                    .setIcon(com.android.internal.R.drawable.ic_menu_info_details)
+                    .setAlphabeticShortcut('t');
+        }
+
+        menu.add(Menu.NONE, MENU_HIGH_POWER_APPS, Menu.NONE, R.string.high_power_apps);
+
+        if (mPowerFeatureProvider.isPowerAccountingToggleEnabled()) {
+            menu.add(Menu.NONE, MENU_TOGGLE_APPS, Menu.NONE,
+                    mShowAllApps ? R.string.hide_extra_apps : R.string.show_all_apps);
+        }
+
+        super.onCreateOptionsMenu(menu, inflater);
+    }
+
+    @Override
+    public int getHelpResource() {
+        return R.string.help_url_battery;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        final SettingsActivity sa = (SettingsActivity) getActivity();
+        final Context context = getContext();
+        final MetricsFeatureProvider metricsFeatureProvider =
+                FeatureFactory.getFactory(context).getMetricsFeatureProvider();
+
+        switch (item.getItemId()) {
+            case MENU_STATS_TYPE:
+                if (mStatsType == BatteryStats.STATS_SINCE_CHARGED) {
+                    mStatsType = BatteryStats.STATS_SINCE_UNPLUGGED;
+                } else {
+                    mStatsType = BatteryStats.STATS_SINCE_CHARGED;
+                }
+                refreshUi();
+                return true;
+            case MENU_HIGH_POWER_APPS:
+                Bundle args = new Bundle();
+                args.putString(ManageApplications.EXTRA_CLASSNAME,
+                        HighPowerApplicationsActivity.class.getName());
+                sa.startPreferencePanel(this, ManageApplications.class.getName(), args,
+                        R.string.high_power_apps, null, null, 0);
+                metricsFeatureProvider.action(context,
+                        MetricsEvent.ACTION_SETTINGS_MENU_BATTERY_OPTIMIZATION);
+                return true;
+            case MENU_TOGGLE_APPS:
+                mShowAllApps = !mShowAllApps;
+                item.setTitle(mShowAllApps ? R.string.hide_extra_apps : R.string.show_all_apps);
+                metricsFeatureProvider.action(context,
+                        MetricsEvent.ACTION_SETTINGS_MENU_BATTERY_APPS_TOGGLE, mShowAllApps);
+                restartBatteryStatsLoader(false /* clearHeader */);
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
+
+    @VisibleForTesting
+    void restoreSavedInstance(Bundle savedInstance) {
+        if (savedInstance != null) {
+            mShowAllApps = savedInstance.getBoolean(KEY_SHOW_ALL_APPS, false);
+        }
+    }
+
+    private void addNotAvailableMessage() {
+        final String NOT_AVAILABLE = "not_available";
+        Preference notAvailable = getCachedPreference(NOT_AVAILABLE);
+        if (notAvailable == null) {
+            notAvailable = new Preference(getPrefContext());
+            notAvailable.setKey(NOT_AVAILABLE);
+            notAvailable.setTitle(R.string.power_usage_not_available);
+            mAppListGroup.addPreference(notAvailable);
+        }
+    }
+
+    private void performBatteryHeaderClick() {
+        if (mPowerFeatureProvider.isAdvancedUiEnabled()) {
+            Utils.startWithFragment(getContext(), PowerUsageAdvanced.class.getName(), null,
+                    null, 0, R.string.advanced_battery_title, null, getMetricsCategory());
+        } else {
+            mStatsHelper.storeStatsHistoryInFile(BatteryHistoryDetail.BATTERY_HISTORY_FILE);
+            Bundle args = new Bundle(2);
+            args.putString(BatteryHistoryDetail.EXTRA_STATS,
+                    BatteryHistoryDetail.BATTERY_HISTORY_FILE);
+            args.putParcelable(BatteryHistoryDetail.EXTRA_BROADCAST,
+                    mStatsHelper.getBatteryBroadcast());
+            Utils.startWithFragment(getContext(), BatteryHistoryDetail.class.getName(), args,
+                    null, 0, R.string.history_details_title, null, getMetricsCategory());
+        }
+    }
+
+    private static boolean isSharedGid(int uid) {
+        return UserHandle.getAppIdFromSharedAppGid(uid) > 0;
+    }
+
+    private static boolean isSystemUid(int uid) {
+        final int appUid = UserHandle.getAppId(uid);
+        return appUid >= Process.SYSTEM_UID && appUid < Process.FIRST_APPLICATION_UID;
+    }
+
+    /**
+     * We want to coalesce some UIDs. For example, dex2oat runs under a shared gid that
+     * exists for all users of the same app. We detect this case and merge the power use
+     * for dex2oat to the device OWNER's use of the app.
+     *
+     * @return A sorted list of apps using power.
+     */
+    private List<BatterySipper> getCoalescedUsageList(final List<BatterySipper> sippers) {
+        final SparseArray<BatterySipper> uidList = new SparseArray<>();
+
+        final ArrayList<BatterySipper> results = new ArrayList<>();
+        final int numSippers = sippers.size();
+        for (int i = 0; i < numSippers; i++) {
+            BatterySipper sipper = sippers.get(i);
+            if (sipper.getUid() > 0) {
+                int realUid = sipper.getUid();
+
+                // Check if this UID is a shared GID. If so, we combine it with the OWNER's
+                // actual app UID.
+                if (isSharedGid(sipper.getUid())) {
+                    realUid = UserHandle.getUid(UserHandle.USER_SYSTEM,
+                            UserHandle.getAppIdFromSharedAppGid(sipper.getUid()));
+                }
+
+                // Check if this UID is a system UID (mediaserver, logd, nfc, drm, etc).
+                if (isSystemUid(realUid)
+                        && !"mediaserver".equals(sipper.packageWithHighestDrain)) {
+                    // Use the system UID for all UIDs running in their own sandbox that
+                    // are not apps. We exclude mediaserver because we already are expected to
+                    // report that as a separate item.
+                    realUid = Process.SYSTEM_UID;
+                }
+
+                if (realUid != sipper.getUid()) {
+                    // Replace the BatterySipper with a new one with the real UID set.
+                    BatterySipper newSipper = new BatterySipper(sipper.drainType,
+                            new FakeUid(realUid), 0.0);
+                    newSipper.add(sipper);
+                    newSipper.packageWithHighestDrain = sipper.packageWithHighestDrain;
+                    newSipper.mPackages = sipper.mPackages;
+                    sipper = newSipper;
+                }
+
+                int index = uidList.indexOfKey(realUid);
+                if (index < 0) {
+                    // New entry.
+                    uidList.put(realUid, sipper);
+                } else {
+                    // Combine BatterySippers if we already have one with this UID.
+                    final BatterySipper existingSipper = uidList.valueAt(index);
+                    existingSipper.add(sipper);
+                    if (existingSipper.packageWithHighestDrain == null
+                            && sipper.packageWithHighestDrain != null) {
+                        existingSipper.packageWithHighestDrain = sipper.packageWithHighestDrain;
+                    }
+
+                    final int existingPackageLen = existingSipper.mPackages != null ?
+                            existingSipper.mPackages.length : 0;
+                    final int newPackageLen = sipper.mPackages != null ?
+                            sipper.mPackages.length : 0;
+                    if (newPackageLen > 0) {
+                        String[] newPackages = new String[existingPackageLen + newPackageLen];
+                        if (existingPackageLen > 0) {
+                            System.arraycopy(existingSipper.mPackages, 0, newPackages, 0,
+                                    existingPackageLen);
+                        }
+                        System.arraycopy(sipper.mPackages, 0, newPackages, existingPackageLen,
+                                newPackageLen);
+                        existingSipper.mPackages = newPackages;
+                    }
+                }
+            } else {
+                results.add(sipper);
+            }
+        }
+
+        final int numUidSippers = uidList.size();
+        for (int i = 0; i < numUidSippers; i++) {
+            results.add(uidList.valueAt(i));
+        }
+
+        // The sort order must have changed, so re-sort based on total power use.
+        mBatteryUtils.sortUsageList(results);
+        return results;
+    }
+
+    protected void refreshUi() {
+        final Context context = getContext();
+        if (context == null) {
+            return;
+        }
+
+        restartAnomalyDetectionIfPossible();
+
+        // reload BatteryInfo and updateUI
+        restartBatteryInfoLoader();
+        final long lastFullChargeTime = mBatteryUtils.calculateLastFullChargeTime(mStatsHelper,
+                System.currentTimeMillis());
+        updateScreenPreference();
+        updateLastFullChargePreference(lastFullChargeTime);
+
+        final CharSequence timeSequence = Utils.formatRelativeTime(context, lastFullChargeTime,
+                false);
+        final int resId = mShowAllApps ? R.string.power_usage_list_summary_device
+                : R.string.power_usage_list_summary;
+        mAppListGroup.setTitle(TextUtils.expandTemplate(getText(resId), timeSequence));
+
+        refreshAppListGroup();
+    }
+
+    private void refreshAppListGroup() {
+        final PowerProfile powerProfile = mStatsHelper.getPowerProfile();
+        final BatteryStats stats = mStatsHelper.getStats();
+        final double averagePower = powerProfile.getAveragePower(PowerProfile.POWER_SCREEN_FULL);
+        boolean addedSome = false;
+        final int dischargeAmount = USE_FAKE_DATA ? 5000
+                : stats != null ? stats.getDischargeAmount(mStatsType) : 0;
+
+        cacheRemoveAllPrefs(mAppListGroup);
+        mAppListGroup.setOrderingAsAdded(false);
+
+        if (averagePower >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP || USE_FAKE_DATA) {
+            final List<BatterySipper> usageList = getCoalescedUsageList(
+                    USE_FAKE_DATA ? getFakeStats() : mStatsHelper.getUsageList());
+            double hiddenPowerMah = mShowAllApps ? 0 :
+                    mBatteryUtils.removeHiddenBatterySippers(usageList);
+            mBatteryUtils.sortUsageList(usageList);
+
+            final int numSippers = usageList.size();
+            for (int i = 0; i < numSippers; i++) {
+                final BatterySipper sipper = usageList.get(i);
+                double totalPower = USE_FAKE_DATA ? 4000 : mStatsHelper.getTotalPower();
+
+                final double percentOfTotal = mBatteryUtils.calculateBatteryPercent(
+                        sipper.totalPowerMah, totalPower, hiddenPowerMah, dischargeAmount);
+
+                if (((int) (percentOfTotal + .5)) < 1) {
+                    continue;
+                }
+                if (shouldHideSipper(sipper)) {
+                    continue;
+                }
+                final UserHandle userHandle = new UserHandle(UserHandle.getUserId(sipper.getUid()));
+                final BatteryEntry entry = new BatteryEntry(getActivity(), mHandler, mUm, sipper);
+                final Drawable badgedIcon = mUm.getBadgedIconForUser(entry.getIcon(),
+                        userHandle);
+                final CharSequence contentDescription = mUm.getBadgedLabelForUser(entry.getLabel(),
+                        userHandle);
+
+                final String key = extractKeyFromSipper(sipper);
+                PowerGaugePreference pref = (PowerGaugePreference) getCachedPreference(key);
+                if (pref == null) {
+                    pref = new PowerGaugePreference(getPrefContext(), badgedIcon,
+                            contentDescription, entry);
+                    pref.setKey(key);
+                }
+                sipper.percent = percentOfTotal;
+                pref.setTitle(entry.getLabel());
+                pref.setOrder(i + 1);
+                pref.setPercent(percentOfTotal);
+                pref.shouldShowAnomalyIcon(false);
+                if (sipper.usageTimeMs == 0 && sipper.drainType == DrainType.APP) {
+                    sipper.usageTimeMs = mBatteryUtils.getProcessTimeMs(
+                            BatteryUtils.StatusType.FOREGROUND, sipper.uidObj, mStatsType);
+                }
+                setUsageSummary(pref, sipper);
+                addedSome = true;
+                mAppListGroup.addPreference(pref);
+                if (mAppListGroup.getPreferenceCount() - getCachedCount()
+                        > (MAX_ITEMS_TO_LIST + 1)) {
+                    break;
+                }
+            }
+        }
+        if (!addedSome) {
+            addNotAvailableMessage();
+        }
+        removeCachedPrefs(mAppListGroup);
+
+        BatteryEntry.startRequestQueue();
+    }
+
+    @VisibleForTesting
+    boolean shouldHideSipper(BatterySipper sipper) {
+        // Don't show over-counted and unaccounted in any condition
+        return sipper.drainType == DrainType.OVERCOUNTED
+                || sipper.drainType == DrainType.UNACCOUNTED;
+    }
+
+    @VisibleForTesting
+    void refreshAnomalyIcon() {
+        for (int i = 0, size = mAnomalySparseArray.size(); i < size; i++) {
+            final String key = extractKeyFromUid(mAnomalySparseArray.keyAt(i));
+            final PowerGaugePreference pref = (PowerGaugePreference) mAppListGroup.findPreference(
+                    key);
+            if (pref != null) {
+                pref.shouldShowAnomalyIcon(true);
+            }
+        }
+    }
+
+    @VisibleForTesting
+    void restartAnomalyDetectionIfPossible() {
+        if (getAnomalyDetectionPolicy().isAnomalyDetectionEnabled()) {
+            getLoaderManager().restartLoader(ANOMALY_LOADER, Bundle.EMPTY, mAnomalyLoaderCallbacks);
+        }
+    }
+
+    @VisibleForTesting
+    AnomalyDetectionPolicy getAnomalyDetectionPolicy() {
+        return new AnomalyDetectionPolicy(getContext());
+    }
+
+    @VisibleForTesting
+    BatterySipper findBatterySipperByType(List<BatterySipper> usageList, DrainType type) {
+        for (int i = 0, size = usageList.size(); i < size; i++) {
+            final BatterySipper sipper = usageList.get(i);
+            if (sipper.drainType == type) {
+                return sipper;
+            }
+        }
+        return null;
+    }
+
+    @VisibleForTesting
+    void updateScreenPreference() {
+        final BatterySipper sipper = findBatterySipperByType(
+                mStatsHelper.getUsageList(), DrainType.SCREEN);
+        final long usageTimeMs = sipper != null ? sipper.usageTimeMs : 0;
+
+        mScreenUsagePref.setSubtitle(Utils.formatElapsedTime(getContext(), usageTimeMs, false));
+    }
+
+    @VisibleForTesting
+    void updateLastFullChargePreference(long timeMs) {
+        final CharSequence timeSequence = Utils.formatRelativeTime(getContext(), timeMs, false);
+        mLastFullChargePref.setSubtitle(timeSequence);
+    }
+
+    @VisibleForTesting
+    void showBothEstimates() {
+        final Context context = getContext();
+        if (context == null
+                || !mPowerFeatureProvider.isEnhancedBatteryPredictionEnabled(context)) {
+            return;
+        }
+        getLoaderManager().restartLoader(DEBUG_INFO_LOADER, Bundle.EMPTY,
+                mBatteryInfoDebugLoaderCallbacks);
+    }
+
+    @VisibleForTesting
+    double calculatePercentage(double powerUsage, double dischargeAmount) {
+        final double totalPower = mStatsHelper.getTotalPower();
+        return totalPower == 0 ? 0 :
+                ((powerUsage / totalPower) * dischargeAmount);
+    }
+
+    @VisibleForTesting
+    void setUsageSummary(Preference preference, BatterySipper sipper) {
+        // Only show summary when usage time is longer than one minute
+        final long usageTimeMs = sipper.usageTimeMs;
+        if (usageTimeMs >= DateUtils.MINUTE_IN_MILLIS) {
+            final CharSequence timeSequence = Utils.formatElapsedTime(getContext(), usageTimeMs,
+                    false);
+            preference.setSummary(
+                    (sipper.drainType != DrainType.APP || mBatteryUtils.shouldHideSipper(sipper))
+                            ? timeSequence
+                            : TextUtils.expandTemplate(getText(R.string.battery_used_for),
+                                    timeSequence));
+        }
+    }
+
+    @VisibleForTesting
+    String extractKeyFromSipper(BatterySipper sipper) {
+        if (sipper.uidObj != null) {
+            return extractKeyFromUid(sipper.getUid());
+        } else if (sipper.drainType == DrainType.USER) {
+            return sipper.drainType.toString() + sipper.userId;
+        } else if (sipper.drainType != DrainType.APP) {
+            return sipper.drainType.toString();
+        } else if (sipper.getPackages() != null) {
+            return TextUtils.concat(sipper.getPackages()).toString();
+        } else {
+            Log.w(TAG, "Inappropriate BatterySipper without uid and package names: " + sipper);
+            return "-1";
+        }
+    }
+
+    @VisibleForTesting
+    String extractKeyFromUid(int uid) {
+        return Integer.toString(uid);
+    }
+
+    @VisibleForTesting
+    void setBatteryLayoutPreference(LayoutPreference layoutPreference) {
+        mBatteryLayoutPref = layoutPreference;
+    }
+
+    @VisibleForTesting
+    void initFeatureProvider() {
+        final Context context = getContext();
+        mPowerFeatureProvider = FeatureFactory.getFactory(context)
+                .getPowerUsageFeatureProvider(context);
+    }
+
+    @VisibleForTesting
+    void updateAnomalySparseArray(List<Anomaly> anomalies) {
+        mAnomalySparseArray.clear();
+        for (int i = 0, size = anomalies.size(); i < size; i++) {
+            final Anomaly anomaly = anomalies.get(i);
+            if (mAnomalySparseArray.get(anomaly.uid) == null) {
+                mAnomalySparseArray.append(anomaly.uid, new ArrayList<>());
+            }
+            mAnomalySparseArray.get(anomaly.uid).add(anomaly);
+        }
+    }
+
+    @VisibleForTesting
+    void restartBatteryInfoLoader() {
+        getLoaderManager().restartLoader(BATTERY_INFO_LOADER, Bundle.EMPTY,
+                mBatteryInfoLoaderCallbacks);
+        if (mPowerFeatureProvider.isEstimateDebugEnabled()) {
+            // Unfortunately setting a long click listener on a view means it will no
+            // longer pass the regular click event to the parent, so we have to register
+            // a regular click listener as well.
+            View header = mBatteryLayoutPref.findViewById(R.id.summary1);
+            header.setOnLongClickListener(this);
+            header.setOnClickListener(this);
+        }
+    }
+
+    private static List<BatterySipper> getFakeStats() {
+        ArrayList<BatterySipper> stats = new ArrayList<>();
+        float use = 5;
+        for (DrainType type : DrainType.values()) {
+            if (type == DrainType.APP) {
+                continue;
+            }
+            stats.add(new BatterySipper(type, null, use));
+            use += 5;
+        }
+        for (int i = 0; i < 100; i++) {
+            stats.add(new BatterySipper(DrainType.APP,
+                    new FakeUid(Process.FIRST_APPLICATION_UID + i), use));
+        }
+        stats.add(new BatterySipper(DrainType.APP,
+                new FakeUid(0), use));
+
+        // Simulate dex2oat process.
+        BatterySipper sipper = new BatterySipper(DrainType.APP,
+                new FakeUid(UserHandle.getSharedAppGid(Process.FIRST_APPLICATION_UID)), 10.0f);
+        sipper.packageWithHighestDrain = "dex2oat";
+        stats.add(sipper);
+
+        sipper = new BatterySipper(DrainType.APP,
+                new FakeUid(UserHandle.getSharedAppGid(Process.FIRST_APPLICATION_UID + 1)), 10.0f);
+        sipper.packageWithHighestDrain = "dex2oat";
+        stats.add(sipper);
+
+        sipper = new BatterySipper(DrainType.APP,
+                new FakeUid(UserHandle.getSharedAppGid(Process.LOG_UID)), 9.0f);
+        stats.add(sipper);
+
+        return stats;
+    }
+
+    Handler mHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case BatteryEntry.MSG_UPDATE_NAME_ICON:
+                    BatteryEntry entry = (BatteryEntry) msg.obj;
+                    PowerGaugePreference pgp =
+                            (PowerGaugePreference) findPreference(
+                                    Integer.toString(entry.sipper.uidObj.getUid()));
+                    if (pgp != null) {
+                        final int userId = UserHandle.getUserId(entry.sipper.getUid());
+                        final UserHandle userHandle = new UserHandle(userId);
+                        pgp.setIcon(mUm.getBadgedIconForUser(entry.getIcon(), userHandle));
+                        pgp.setTitle(entry.name);
+                        if (entry.sipper.drainType == DrainType.APP) {
+                            pgp.setContentDescription(entry.name);
+                        }
+                    }
+                    break;
+                case BatteryEntry.MSG_REPORT_FULLY_DRAWN:
+                    Activity activity = getActivity();
+                    if (activity != null) {
+                        activity.reportFullyDrawn();
+                    }
+                    break;
+            }
+            super.handleMessage(msg);
+        }
+    };
+
+    @Override
+    public void onAnomalyHandled(Anomaly anomaly) {
+        mAnomalySummaryPreferenceController.hideHighUsagePreference();
+    }
+
+    @Override
+    public boolean onLongClick(View view) {
+        showBothEstimates();
+        view.setOnLongClickListener(null);
+        return true;
+    }
+
+    @Override
+    public void onClick(View view) {
+        performBatteryHeaderClick();
+    }
+
+    @Override
+    protected void restartBatteryStatsLoader() {
+        restartBatteryStatsLoader(true /* clearHeader */);
+    }
+
+    void restartBatteryStatsLoader(boolean clearHeader) {
+        super.restartBatteryStatsLoader();
+        if (clearHeader) {
+            mBatteryHeaderPreferenceController.quickUpdateHeaderPreference();
+        }
+    }
+
+    private static class SummaryProvider implements SummaryLoader.SummaryProvider {
+        private final Context mContext;
+        private final SummaryLoader mLoader;
+        private final BatteryBroadcastReceiver mBatteryBroadcastReceiver;
+
+        private SummaryProvider(Context context, SummaryLoader loader) {
+            mContext = context;
+            mLoader = loader;
+            mBatteryBroadcastReceiver = new BatteryBroadcastReceiver(mContext);
+            mBatteryBroadcastReceiver.setBatteryChangedListener(() -> {
+                BatteryInfo.getBatteryInfo(mContext, new BatteryInfo.Callback() {
+                    @Override
+                    public void onBatteryInfoLoaded(BatteryInfo info) {
+                        mLoader.setSummary(PowerUsageSummaryLegacy.SummaryProvider.this, info.chargeLabel);
+                    }
+                }, true /* shortString */);
+            });
+        }
+
+        @Override
+        public void setListening(boolean listening) {
+            if (listening) {
+                mBatteryBroadcastReceiver.register();
+            } else {
+                mBatteryBroadcastReceiver.unRegister();
+            }
+        }
+    }
+
+    public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY
+            = new SummaryLoader.SummaryProviderFactory() {
+        @Override
+        public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
+                SummaryLoader summaryLoader) {
+            return new SummaryProvider(activity, summaryLoader);
+        }
+    };
+}
diff --git a/src/com/android/settings/location/LocationModePreferenceController.java b/src/com/android/settings/location/LocationModePreferenceController.java
index a9ed6ad..265a9df 100644
--- a/src/com/android/settings/location/LocationModePreferenceController.java
+++ b/src/com/android/settings/location/LocationModePreferenceController.java
@@ -41,6 +41,11 @@
     }
 
     @Override
+    public boolean isAvailable() {
+        return mContext.getResources().getBoolean(R.bool.config_location_mode_available);
+    }
+
+    @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
         mPreference = screen.findPreference(KEY_LOCATION_MODE);
diff --git a/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java b/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
index ec9cf2a..cc70a6f 100644
--- a/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
+++ b/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
@@ -29,8 +29,9 @@
 import android.service.notification.ZenModeConfig;
 import android.support.v7.preference.Preference;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import java.util.Arrays;
 import java.util.Comparator;
@@ -38,19 +39,19 @@
 import java.util.Set;
 
 abstract public class AbstractZenModeAutomaticRulePreferenceController extends
-        AbstractPreferenceController implements PreferenceControllerMixin {
+        AbstractZenModePreferenceController implements PreferenceControllerMixin {
 
-    private static final String TAG = "ZenModeAutomaticRule";
     protected ZenModeBackend mBackend;
     protected Fragment mParent;
     protected Set<Map.Entry<String, AutomaticZenRule>> mRules;
     protected PackageManager mPm;
 
-    public AbstractZenModeAutomaticRulePreferenceController(Context context, Fragment parent) {
-        super(context);
+    public AbstractZenModeAutomaticRulePreferenceController(Context context, String key, Fragment
+            parent, Lifecycle lifecycle) {
+        super(context, key, lifecycle);
         mBackend = ZenModeBackend.getInstance(context);
-        mParent = parent;
         mPm = mContext.getPackageManager();
+        mParent = parent;
     }
 
     @Override
@@ -65,19 +66,9 @@
         return ruleMap.entrySet();
     }
 
-    protected void showNameRuleDialog(final ZenRuleInfo ri) {
-        new ZenRuleNameDialog(mContext, null, ri.defaultConditionId) {
-            @Override
-            public void onOk(String ruleName) {
-                AutomaticZenRule rule = new AutomaticZenRule(ruleName, ri.serviceComponent,
-                        ri.defaultConditionId, NotificationManager.INTERRUPTION_FILTER_PRIORITY,
-                        true);
-                String savedRuleId = mBackend.addZenRule(rule);
-                if (savedRuleId != null) {
-                    mParent.startActivity(getRuleIntent(ri.settingsAction, null, savedRuleId));
-                }
-            }
-        }.show();
+    protected void showNameRuleDialog(final ZenRuleInfo ri, Fragment parent) {
+        ZenRuleNameDialog.show(parent, null, ri.defaultConditionId, new
+                RuleNameChangeListener(ri));
     }
 
     protected Map.Entry<String, AutomaticZenRule>[] sortedRules() {
@@ -157,4 +148,26 @@
         }
         return null;
     }
+
+    public class RuleNameChangeListener implements ZenRuleNameDialog.PositiveClickListener {
+        ZenRuleInfo mRuleInfo;
+
+        public RuleNameChangeListener(ZenRuleInfo ruleInfo) {
+            mRuleInfo = ruleInfo;
+        }
+
+        @Override
+        public void onOk(String ruleName, Fragment parent) {
+            mMetricsFeatureProvider.action(mContext,
+                    MetricsProto.MetricsEvent.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
+            AutomaticZenRule rule = new AutomaticZenRule(ruleName, mRuleInfo.serviceComponent,
+                    mRuleInfo.defaultConditionId,
+                    NotificationManager.INTERRUPTION_FILTER_PRIORITY, true);
+            String savedRuleId = mBackend.addZenRule(rule);
+            if (savedRuleId != null) {
+                parent.startActivity(getRuleIntent(mRuleInfo.settingsAction, null,
+                        savedRuleId));
+            }
+        }
+    }
 }
diff --git a/src/com/android/settings/notification/AbstractZenModePreferenceController.java b/src/com/android/settings/notification/AbstractZenModePreferenceController.java
index 2642f81..33c027c 100644
--- a/src/com/android/settings/notification/AbstractZenModePreferenceController.java
+++ b/src/com/android/settings/notification/AbstractZenModePreferenceController.java
@@ -35,6 +35,8 @@
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
@@ -51,6 +53,7 @@
     private final String KEY;
     final private NotificationManager mNotificationManager;
     protected static ZenModeConfigWrapper mZenModeConfigWrapper;
+    protected MetricsFeatureProvider mMetricsFeatureProvider;
 
     public AbstractZenModePreferenceController(Context context, String key,
             Lifecycle lifecycle) {
@@ -62,6 +65,9 @@
         KEY = key;
         mNotificationManager = (NotificationManager) context.getSystemService(
                 Context.NOTIFICATION_SERVICE);
+
+        final FeatureFactory featureFactory = FeatureFactory.getFactory(mContext);
+        mMetricsFeatureProvider = featureFactory.getMetricsFeatureProvider();
     }
 
     @Override
diff --git a/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java b/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java
new file mode 100644
index 0000000..8494998
--- /dev/null
+++ b/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import static com.android.settings.widget.EntityHeaderController.PREF_KEY_APP_HEADER;
+
+import android.app.AutomaticZenRule;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.support.v14.preference.PreferenceFragment;
+import android.support.v7.preference.Preference;
+import android.util.Slog;
+import android.view.View;
+
+import com.android.settings.R;
+import com.android.settings.applications.LayoutPreference;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.widget.EntityHeaderController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
+public class ZenAutomaticRuleHeaderPreferenceController extends AbstractZenModePreferenceController
+        implements PreferenceControllerMixin {
+
+    private final String KEY = PREF_KEY_APP_HEADER;
+    private final PreferenceFragment mFragment;
+    private AutomaticZenRule mRule;
+    private EntityHeaderController mController;
+
+    public ZenAutomaticRuleHeaderPreferenceController(Context context, PreferenceFragment fragment,
+            Lifecycle lifecycle) {
+        super(context, PREF_KEY_APP_HEADER, lifecycle);
+        mFragment = fragment;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY;
+    }
+
+    @Override
+    public boolean isAvailable() {
+        return mRule != null;
+    }
+
+    public void updateState(Preference preference) {
+        if (mRule == null) {
+            return;
+        }
+
+        if (mFragment != null) {
+            LayoutPreference pref = (LayoutPreference) preference;
+
+            if (mController == null) {
+                mController = EntityHeaderController
+                        .newInstance(mFragment.getActivity(), mFragment,
+                                pref.findViewById(R.id.entity_header));
+            }
+
+            pref = mController.setIcon(getIcon())
+                    .setLabel(mRule.getName())
+                    .setPackageName(mRule.getOwner().getPackageName())
+                    .setUid(mContext.getUserId())
+                    .setHasAppInfoLink(false)
+                    .setButtonActions(EntityHeaderController.ActionType.ACTION_NONE,
+                            EntityHeaderController.ActionType.ACTION_NONE)
+                    .done(mFragment.getActivity(), mContext);
+
+            pref.findViewById(R.id.entity_header).setVisibility(View.VISIBLE);
+        }
+    }
+
+    private Drawable getIcon() {
+        try {
+            PackageManager packageManager =  mContext.getPackageManager();
+            ApplicationInfo info = packageManager.getApplicationInfo(
+                    mRule.getOwner().getPackageName(), 0);
+            return info.loadIcon(packageManager);
+        } catch (PackageManager.NameNotFoundException e) {
+           Slog.w(TAG, "Unable to load icon - PackageManager.NameNotFoundException");
+        }
+
+        return null;
+    }
+
+    protected void onResume(AutomaticZenRule rule) {
+        mRule = rule;
+    }
+}
diff --git a/src/com/android/settings/notification/ZenAutomaticRuleSwitchPreferenceController.java b/src/com/android/settings/notification/ZenAutomaticRuleSwitchPreferenceController.java
new file mode 100644
index 0000000..bc3fa25
--- /dev/null
+++ b/src/com/android/settings/notification/ZenAutomaticRuleSwitchPreferenceController.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.app.AutomaticZenRule;
+import android.app.Fragment;
+import android.content.Context;
+import android.support.v7.preference.Preference;
+import android.widget.Switch;
+import android.widget.Toast;
+
+import com.android.settings.R;
+import com.android.settings.applications.LayoutPreference;
+import com.android.settings.widget.SwitchBar;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
+public class ZenAutomaticRuleSwitchPreferenceController extends
+        AbstractZenModeAutomaticRulePreferenceController implements
+        SwitchBar.OnSwitchChangeListener {
+
+    private static final String KEY = "zen_automatic_rule_switch";
+    private AutomaticZenRule mRule;
+    private String mId;
+    private Toast mEnabledToast;
+    private int mToastTextResource;
+
+    public ZenAutomaticRuleSwitchPreferenceController(Context context, Fragment parent,
+            int toastTextResource, Lifecycle lifecycle) {
+        super(context, KEY, parent, lifecycle);
+        mToastTextResource = toastTextResource;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY;
+    }
+
+    @Override
+    public boolean isAvailable() {
+        return mRule != null && mId != null;
+    }
+
+    public void onResume(AutomaticZenRule rule, String id) {
+        mRule = rule;
+        mId = id;
+    }
+
+    public void updateState(Preference preference) {
+        LayoutPreference pref = (LayoutPreference) preference;
+        SwitchBar bar = pref.findViewById(R.id.switch_bar);
+        if (mRule != null) {
+            bar.setChecked(mRule.isEnabled());
+        }
+        if (bar != null) {
+            bar.show();
+            try {
+                bar.addOnSwitchChangeListener(this);
+            } catch (IllegalStateException e) {
+                // an exception is thrown if you try to add the listener twice
+            }
+        }
+        bar.show();
+    }
+
+    @Override
+    public void onSwitchChanged(Switch switchView, boolean isChecked) {
+        final boolean enabled = isChecked;
+        if (enabled == mRule.isEnabled()) return;
+        mRule.setEnabled(enabled);
+        mBackend.setZenRule(mId, mRule);
+        if (enabled) {
+            final int toastText = mToastTextResource;
+            if (toastText != 0) {
+                mEnabledToast = Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT);
+                mEnabledToast.show();
+            }
+        } else {
+            if (mEnabledToast != null) {
+                mEnabledToast.cancel();
+            }
+        }
+    }
+}
diff --git a/src/com/android/settings/notification/ZenDeleteRuleDialog.java b/src/com/android/settings/notification/ZenDeleteRuleDialog.java
new file mode 100644
index 0000000..d9061d3
--- /dev/null
+++ b/src/com/android/settings/notification/ZenDeleteRuleDialog.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Fragment;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.view.View;
+
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+
+public class ZenDeleteRuleDialog extends InstrumentedDialogFragment {
+    protected static final String TAG = "ZenDeleteRuleDialog";
+    private static final String EXTRA_ZEN_RULE_NAME = "zen_rule_name";
+    private static final String EXTRA_ZEN_RULE_ID = "zen_rule_id";
+    protected static PositiveClickListener mPositiveClickListener;
+
+    /**
+     * The interface we expect a listener to implement.
+     */
+    public interface PositiveClickListener {
+        void onOk(String id);
+    }
+
+    public static void show(Fragment parent, String ruleName, String id, PositiveClickListener
+            listener) {
+        final Bundle args = new Bundle();
+        args.putString(EXTRA_ZEN_RULE_NAME, ruleName);
+        args.putString(EXTRA_ZEN_RULE_ID, id);
+        mPositiveClickListener = listener;
+
+        ZenDeleteRuleDialog dialog = new ZenDeleteRuleDialog();
+        dialog.setArguments(args);
+        dialog.setTargetFragment(parent, 0);
+        dialog.show(parent.getFragmentManager(), TAG);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_DELETE_RULE_DIALOG;
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        Bundle arguments = getArguments();
+        String ruleName = arguments.getString(EXTRA_ZEN_RULE_NAME);
+        String id = arguments.getString(EXTRA_ZEN_RULE_ID);
+
+        final AlertDialog dialog = new AlertDialog.Builder(getContext())
+                .setMessage(getString(R.string.zen_mode_delete_rule_confirmation, ruleName))
+                .setNegativeButton(R.string.cancel, null)
+                .setPositiveButton(R.string.zen_mode_delete_rule_button,
+                        new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        if (arguments != null) {
+                            mPositiveClickListener.onOk(id);
+                        }
+                    }
+                }).create();
+        final View messageView = dialog.findViewById(android.R.id.message);
+        if (messageView != null) {
+            messageView.setTextDirection(View.TEXT_DIRECTION_LOCALE);
+        }
+        return dialog;
+    }
+
+}
diff --git a/src/com/android/settings/notification/ZenModeAddAutomaticRulePreferenceController.java b/src/com/android/settings/notification/ZenModeAddAutomaticRulePreferenceController.java
index a15536c..b2e69d8 100644
--- a/src/com/android/settings/notification/ZenModeAddAutomaticRulePreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAddAutomaticRulePreferenceController.java
@@ -21,6 +21,7 @@
 import android.content.Intent;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import com.android.settings.utils.ZenServiceListing;
 
@@ -28,19 +29,18 @@
         AbstractZenModeAutomaticRulePreferenceController implements
         Preference.OnPreferenceClickListener {
 
-    private final String KEY_ADD_RULE;
+    protected static final String KEY = "zen_mode_add_automatic_rule";
     private final ZenServiceListing mZenServiceListing;
 
-    public ZenModeAddAutomaticRulePreferenceController(Context context, String key,
-            Fragment parent, ZenServiceListing serviceListing) {
-        super(context, parent);
-        KEY_ADD_RULE = key;
+    public ZenModeAddAutomaticRulePreferenceController(Context context, Fragment parent,
+            ZenServiceListing serviceListing, Lifecycle lifecycle) {
+        super(context, KEY, parent, lifecycle);
         mZenServiceListing = serviceListing;
     }
 
     @Override
     public String getPreferenceKey() {
-        return KEY_ADD_RULE;
+        return KEY;
     }
 
     @Override
@@ -51,25 +51,30 @@
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
-        Preference pref = screen.findPreference(KEY_ADD_RULE);
+        Preference pref = screen.findPreference(KEY);
         pref.setPersistent(false);
         pref.setOnPreferenceClickListener(this);
     }
 
     @Override
     public boolean onPreferenceClick(Preference preference) {
-        new ZenRuleSelectionDialog(mContext, mZenServiceListing) {
-            @Override
-            public void onSystemRuleSelected(ZenRuleInfo ri) {
-                showNameRuleDialog(ri);
-            }
-
-            @Override
-            public void onExternalRuleSelected(ZenRuleInfo ri) {
-                Intent intent = new Intent().setComponent(ri.configurationActivity);
-                mParent.startActivity(intent);
-            }
-        }.show();
+        ZenRuleSelectionDialog.show(mContext, mParent, new RuleSelectionListener(),
+                mZenServiceListing);
         return true;
     }
+
+    public class RuleSelectionListener implements ZenRuleSelectionDialog.PositiveClickListener {
+        public RuleSelectionListener() {}
+
+        @Override
+        public void onSystemRuleSelected(ZenRuleInfo ri, Fragment parent) {
+            showNameRuleDialog(ri, parent);
+        }
+
+        @Override
+        public void onExternalRuleSelected(ZenRuleInfo ri, Fragment parent) {
+            Intent intent = new Intent().setComponent(ri.configurationActivity);
+            parent.startActivity(intent);
+        }
+    }
 }
diff --git a/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java b/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
index ef8d026..a15f7fc 100644
--- a/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
@@ -23,6 +23,7 @@
 import android.support.v7.preference.Preference;
 import android.util.Log;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeAlarmsPreferenceController extends
@@ -73,6 +74,9 @@
         if (ZenModeSettingsBase.DEBUG) {
             Log.d(TAG, "onPrefChange allowAlarms=" + allowAlarms);
         }
+
+        mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_ALARMS,
+                allowAlarms);
         mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_ALARMS, allowAlarms);
         return true;
     }
diff --git a/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java b/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
index f91bdd6..55fe927 100644
--- a/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
@@ -19,28 +19,31 @@
 import android.app.AutomaticZenRule;
 import android.app.Fragment;
 import android.content.Context;
+import android.support.annotation.VisibleForTesting;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceCategory;
 import android.support.v7.preference.PreferenceScreen;
+
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
 import java.util.Map;
 
 public class ZenModeAutomaticRulesPreferenceController extends
         AbstractZenModeAutomaticRulePreferenceController {
 
-    private final String KEY_AUTOMATIC_RULES;
-    private PreferenceCategory mPreferenceCategory;
-    Map.Entry<String, AutomaticZenRule>[] mSortedRules;
+    protected static final String KEY = "zen_mode_automatic_rules";
 
-    public ZenModeAutomaticRulesPreferenceController(Context context, String key,
-            Fragment parent) {
-        super(context, parent);
-        KEY_AUTOMATIC_RULES = key;
-        mSortedRules = sortedRules();
+    @VisibleForTesting
+    protected PreferenceCategory mPreferenceCategory;
+
+    public ZenModeAutomaticRulesPreferenceController(Context context, Fragment parent, Lifecycle
+            lifecycle) {
+        super(context, KEY, parent, lifecycle);
     }
 
     @Override
     public String getPreferenceKey() {
-        return KEY_AUTOMATIC_RULES;
+        return KEY;
     }
 
     @Override
@@ -59,40 +62,14 @@
     public void updateState(Preference preference) {
         super.updateState(preference);
 
-        // no need to update AutomaticRule if a rule was deleted
-        // (on rule deletion, the preference removes itself from its parent)
-        int oldRuleLength = mSortedRules.length;
-        mSortedRules = sortedRules();
-        if  (!wasRuleDeleted(oldRuleLength)) {
-            updateAutomaticRules();
+        mPreferenceCategory.removeAll();
+        Map.Entry<String, AutomaticZenRule>[] sortedRules = sortedRules();
+        for (Map.Entry<String, AutomaticZenRule> sortedRule : sortedRules) {
+            ZenRulePreference pref = new ZenRulePreference(mPreferenceCategory.getContext(),
+                    sortedRule, mParent, mMetricsFeatureProvider);
+            mPreferenceCategory.addPreference(pref);
         }
     }
-
-    private boolean wasRuleDeleted(int oldRuleLength) {
-        int newRuleLength = mSortedRules.length;
-        int prefCount =  mPreferenceCategory.getPreferenceCount();
-
-        return (prefCount == oldRuleLength -1) && (prefCount == newRuleLength);
-    }
-
-    private void updateAutomaticRules() {
-        for (Map.Entry<String, AutomaticZenRule> sortedRule : mSortedRules) {
-            ZenRulePreference currPref = (ZenRulePreference)
-                    mPreferenceCategory.findPreference(sortedRule.getKey());
-            if (currPref != null && currPref.appExists) {
-                // rule already exists in preferences, update it
-                currPref.setAttributes(sortedRule.getValue());
-            } else {
-                // rule doesn't exist in preferences, add it
-                ZenRulePreference pref = new ZenRulePreference(mPreferenceCategory.getContext(),
-                        sortedRule, mPreferenceCategory);
-                if (pref.appExists) {
-                    mPreferenceCategory.addPreference(pref);
-                }
-            }
-        }
-
-    }
 }
 
 
diff --git a/src/com/android/settings/notification/ZenModeAutomationSettings.java b/src/com/android/settings/notification/ZenModeAutomationSettings.java
index 582fb03..55d0fca 100644
--- a/src/com/android/settings/notification/ZenModeAutomationSettings.java
+++ b/src/com/android/settings/notification/ZenModeAutomationSettings.java
@@ -28,29 +28,27 @@
 import com.android.settings.utils.ManagedServiceSettings;
 import com.android.settings.utils.ZenServiceListing;
 import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class ZenModeAutomationSettings extends ZenModeSettingsBase {
-    private static final String KEY_ADD_RULE = "zen_mode_add_automatic_rule";
-    private static final String KEY_AUTOMATIC_RULES = "zen_mode_automatic_rules";
-    protected static final ManagedServiceSettings.Config CONFIG = getConditionProviderConfig();
+    protected final ManagedServiceSettings.Config CONFIG = getConditionProviderConfig();
 
     @Override
     protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
         ZenServiceListing serviceListing = new ZenServiceListing(getContext(), CONFIG);
         serviceListing.reloadApprovedServices();
-        return buildPreferenceControllers(context, this, serviceListing);
+        return buildPreferenceControllers(context, this, serviceListing, getLifecycle());
     }
 
     private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
-            Fragment parent, ZenServiceListing serviceListing) {
+            Fragment parent, ZenServiceListing serviceListing, Lifecycle lifecycle) {
         List<AbstractPreferenceController> controllers = new ArrayList<>();
-        controllers.add(new ZenModeAddAutomaticRulePreferenceController(context, KEY_ADD_RULE,
-                parent, serviceListing));
-        controllers.add(new ZenModeAutomaticRulesPreferenceController(context,
-                KEY_AUTOMATIC_RULES, parent));
+        controllers.add(new ZenModeAddAutomaticRulePreferenceController(context, parent,
+                serviceListing, lifecycle));
+        controllers.add(new ZenModeAutomaticRulesPreferenceController(context, parent, lifecycle));
 
         return controllers;
     }
@@ -94,15 +92,15 @@
                 @Override
                 public List<String> getNonIndexableKeys(Context context) {
                     final List<String> keys = super.getNonIndexableKeys(context);
-                    keys.add(KEY_ADD_RULE);
-                    keys.add(KEY_AUTOMATIC_RULES);
+                    keys.add(ZenModeAddAutomaticRulePreferenceController.KEY);
+                    keys.add(ZenModeAutomaticRulesPreferenceController.KEY);
                     return keys;
                 }
 
                 @Override
                 public List<AbstractPreferenceController> getPreferenceControllers(
                         Context context) {
-                    return buildPreferenceControllers(context, null, null);
+                    return buildPreferenceControllers(context, null, null, null);
                 }
             };
 }
diff --git a/src/com/android/settings/notification/ZenModeButtonPreferenceController.java b/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
index 79115f2..1886dab 100644
--- a/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
@@ -22,6 +22,7 @@
 import android.view.View;
 import android.widget.Button;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.applications.LayoutPreference;
 import com.android.settings.core.PreferenceControllerMixin;
@@ -57,15 +58,21 @@
         if (null == mZenButtonOn) {
             mZenButtonOn = (Button) ((LayoutPreference) preference)
                     .findViewById(R.id.zen_mode_settings_turn_on_button);
-            mZenButtonOn.setOnClickListener(v ->
-                    mBackend.setZenMode(Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS));
+            mZenButtonOn.setOnClickListener(v -> {
+                mMetricsFeatureProvider.action(mContext,
+                        MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, true);
+                mBackend.setZenMode(Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
+            });
         }
 
         if (null == mZenButtonOff) {
             mZenButtonOff = (Button) ((LayoutPreference) preference)
                     .findViewById(R.id.zen_mode_settings_turn_off_button);
-            mZenButtonOff.setOnClickListener(v ->
-                    mBackend.setZenMode(Settings.Global.ZEN_MODE_OFF));
+            mZenButtonOff.setOnClickListener(v -> {
+                mMetricsFeatureProvider.action(mContext,
+                        MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
+                mBackend.setZenMode(Settings.Global.ZEN_MODE_OFF);
+            });
         }
 
         updateButtons();
diff --git a/src/com/android/settings/notification/ZenModeEventRuleSettings.java b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
index aa2cc3f..bb66768 100644
--- a/src/com/android/settings/notification/ZenModeEventRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
@@ -61,16 +61,6 @@
     }
 
     @Override
-    protected String getZenModeDependency() {
-        return null;
-    }
-
-    @Override
-    protected int getEnabledToastText() {
-        return R.string.zen_event_rule_enabled_toast;
-    }
-
-    @Override
     public void onResume() {
         super.onResume();
         if (isUiRestricted()) {
@@ -89,7 +79,14 @@
 
     @Override
     protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
-        return null;
+        List<AbstractPreferenceController> controllers = new ArrayList<>();
+        mHeader = new ZenAutomaticRuleHeaderPreferenceController(context, this,
+                getLifecycle());
+        mSwitch = new ZenAutomaticRuleSwitchPreferenceController(context, this,
+                R.string.zen_event_rule_enabled_toast, getLifecycle());
+        controllers.add(mHeader);
+        controllers.add(mSwitch);
+        return controllers;
     }
 
     private void reloadCalendar() {
diff --git a/src/com/android/settings/notification/ZenModeEventsPreferenceController.java b/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
index 3763fed..be5e6d6 100644
--- a/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
@@ -24,6 +24,7 @@
 import android.util.Log;
 
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeEventsPreferenceController extends AbstractZenModePreferenceController
@@ -71,6 +72,8 @@
         if (ZenModeSettingsBase.DEBUG) {
             Log.d(TAG, "onPrefChange allowEvents=" + allowEvents);
         }
+        mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_EVENTS,
+                allowEvents);
         mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_EVENTS, allowEvents);
         return true;
     }
diff --git a/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java b/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
index edc7cf9..99a4f0d7 100644
--- a/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
@@ -23,6 +23,7 @@
 import android.support.v7.preference.Preference;
 import android.util.Log;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeRemindersPreferenceController extends AbstractZenModePreferenceController
@@ -67,7 +68,11 @@
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         final boolean allowReminders = (Boolean) newValue;
-        if (ZenModeSettingsBase.DEBUG) Log.d(TAG, "onPrefChange allowReminders=" + allowReminders);
+        if (ZenModeSettingsBase.DEBUG) {
+            Log.d(TAG, "onPrefChange allowReminders=" + allowReminders);
+        }
+        mMetricsFeatureProvider.action(mContext,
+                MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_REMINDERS, allowReminders);
         mBackend.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS,
                 allowReminders);
         return true;
diff --git a/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java b/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
index 1d18409..82fe865 100644
--- a/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
@@ -23,6 +23,7 @@
 import android.support.v7.preference.Preference;
 import android.util.Log;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeRepeatCallersPreferenceController extends AbstractZenModePreferenceController
@@ -77,8 +78,11 @@
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         final boolean allowRepeatCallers = (Boolean) newValue;
-        if (ZenModeSettingsBase.DEBUG) Log.d(TAG, "onPrefChange allowRepeatCallers="
-                + allowRepeatCallers);
+        if (ZenModeSettingsBase.DEBUG) {
+            Log.d(TAG, "onPrefChange allowRepeatCallers=" + allowRepeatCallers);
+        }
+        mMetricsFeatureProvider.action(mContext,
+                MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_REPEAT_CALLS, allowRepeatCallers);
         mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_REPEAT_CALLERS, allowRepeatCallers);
         return true;
     }
diff --git a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
index 069d38b..0234c8e 100644
--- a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
+++ b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
@@ -16,62 +16,43 @@
 
 package com.android.settings.notification;
 
-import android.app.Activity;
-import android.app.AlertDialog;
 import android.app.AutomaticZenRule;
+import android.app.Fragment;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
 import android.service.notification.ConditionProviderService;
-import android.support.v7.preference.DropDownPreference;
 import android.support.v7.preference.Preference;
-import android.support.v7.preference.Preference.OnPreferenceChangeListener;
 import android.support.v7.preference.Preference.OnPreferenceClickListener;
 import android.support.v7.preference.PreferenceScreen;
 import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.Switch;
 import android.widget.Toast;
 
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
-import com.android.settings.SettingsActivity;
-import com.android.settings.widget.SwitchBar;
 import com.android.settingslib.core.AbstractPreferenceController;
 
-import java.util.List;
+public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase {
 
-public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase
-        implements SwitchBar.OnSwitchChangeListener {
     protected static final String TAG = ZenModeSettingsBase.TAG;
     protected static final boolean DEBUG = ZenModeSettingsBase.DEBUG;
 
     private static final String KEY_RULE_NAME = "rule_name";
-    private static final String KEY_ZEN_MODE = "zen_mode";
 
     protected Context mContext;
     protected boolean mDisableListeners;
     protected AutomaticZenRule mRule;
     protected String mId;
 
-    private boolean mDeleting;
     private Preference mRuleName;
-    private SwitchBar mSwitchBar;
-    private DropDownPreference mZenMode;
-    private Toast mEnabledToast;
+    protected ZenAutomaticRuleHeaderPreferenceController mHeader;
+    protected ZenAutomaticRuleSwitchPreferenceController mSwitch;
 
     abstract protected void onCreateInternal();
     abstract protected boolean setRule(AutomaticZenRule rule);
-    abstract protected String getZenModeDependency();
     abstract protected void updateControlsInternal();
-    abstract protected int getEnabledToastText();
 
     @Override
     public void onCreate(Bundle icicle) {
@@ -99,8 +80,6 @@
 
         super.onCreate(icicle);
 
-        setHasOptionsMenu(true);
-
         onCreateInternal();
 
         final PreferenceScreen root = getPreferenceScreen();
@@ -112,37 +91,6 @@
                 return true;
             }
         });
-
-        mZenMode = (DropDownPreference) root.findPreference(KEY_ZEN_MODE);
-        mZenMode.setEntries(new CharSequence[] {
-                getString(R.string.zen_mode_option_important_interruptions),
-                getString(R.string.zen_mode_option_alarms),
-                getString(R.string.zen_mode_option_no_interruptions),
-        });
-        mZenMode.setEntryValues(new CharSequence[] {
-                Integer.toString(NotificationManager.INTERRUPTION_FILTER_PRIORITY),
-                Integer.toString(NotificationManager.INTERRUPTION_FILTER_ALARMS),
-                Integer.toString(NotificationManager.INTERRUPTION_FILTER_NONE),
-        });
-        mZenMode.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-            @Override
-            public boolean onPreferenceChange(Preference preference, Object newValue) {
-                if (mDisableListeners) return false;
-                final int zenMode = Integer.parseInt((String) newValue);
-                if (zenMode == mRule.getInterruptionFilter()) return false;
-                if (DEBUG) Log.d(TAG, "onPrefChange zenMode=" + zenMode);
-                mRule.setInterruptionFilter(zenMode);
-                mBackend.setZenRule(mId, mRule);
-                return true;
-            }
-        });
-        mZenMode.setOrder(10);  // sort at the bottom of the category
-        mZenMode.setDependency(getZenModeDependency());
-    }
-
-    @Override
-    protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
-        return null;
     }
 
     @Override
@@ -155,43 +103,39 @@
     }
 
     @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-
-        final SettingsActivity activity = (SettingsActivity) getActivity();
-        mSwitchBar = activity.getSwitchBar();
-        mSwitchBar.addOnSwitchChangeListener(this);
-        mSwitchBar.show();
+    public int getHelpResource() {
+        return R.string.help_uri_interruptions;
     }
 
-    @Override
-    public void onDestroyView() {
-        super.onDestroyView();
-        mSwitchBar.removeOnSwitchChangeListener(this);
-        mSwitchBar.hide();
+    /**
+     * Update state of header preference managed by PreferenceController.
+     */
+    protected void updateHeader() {
+        final PreferenceScreen screen = getPreferenceScreen();
+
+        mSwitch.onResume(mRule,mId);
+        mSwitch.displayPreference(screen);
+        updatePreference(mSwitch);
+
+        mHeader.onResume(mRule);
+        mHeader.displayPreference(screen);
+        updatePreference(mHeader);
     }
 
-    @Override
-    public void onSwitchChanged(Switch switchView, boolean isChecked) {
-        if (DEBUG) Log.d(TAG, "onSwitchChanged " + isChecked);
-        if (mDisableListeners) return;
-        final boolean enabled = isChecked;
-        if (enabled == mRule.isEnabled()) return;
-        mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_ENABLE_RULE, enabled);
-        if (DEBUG) Log.d(TAG, "onSwitchChanged enabled=" + enabled);
-        mRule.setEnabled(enabled);
-        mBackend.setZenRule(mId, mRule);
-        if (enabled) {
-            final int toastText = getEnabledToastText();
-            if (toastText != 0) {
-                mEnabledToast = Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT);
-                mEnabledToast.show();
-            }
-        } else {
-            if (mEnabledToast != null) {
-                mEnabledToast.cancel();
-            }
+    private void updatePreference(AbstractPreferenceController controller) {
+        final PreferenceScreen screen = getPreferenceScreen();
+        if (!controller.isAvailable()) {
+            return;
         }
+        final String key = controller.getPreferenceKey();
+
+        final Preference preference = screen.findPreference(key);
+        if (preference == null) {
+            Log.d(TAG, String.format("Cannot find preference with key %s in Controller %s",
+                    key, controller.getClass().getSimpleName()));
+            return;
+        }
+        controller.updateState(preference);
     }
 
     protected void updateRule(Uri newConditionId) {
@@ -207,33 +151,6 @@
         }
     }
 
-    @Override
-    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-        if (DEBUG) Log.d(TAG, "onCreateOptionsMenu");
-        inflater.inflate(R.menu.zen_mode_rule, menu);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        if (DEBUG) Log.d(TAG, "onOptionsItemSelected " + item.getItemId());
-        if (item.getItemId() == R.id.delete) {
-            mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_DELETE_RULE);
-            showDeleteRuleDialog();
-            return true;
-        }
-        return super.onOptionsItemSelected(item);
-    }
-
-    private void showRuleNameDialog() {
-        new ZenRuleNameDialog(mContext, mRule.getName(), null) {
-            @Override
-            public void onOk(String ruleName) {
-                mRule.setName(ruleName);
-                mBackend.setZenRule(mId, mRule);
-            }
-        }.show();
-    }
-
     private boolean refreshRuleOrFinish() {
         mRule = getZenRule();
         if (DEBUG) Log.d(TAG, "mRule=" + mRule);
@@ -244,42 +161,22 @@
         return false;
     }
 
-    private void showDeleteRuleDialog() {
-        final AlertDialog dialog = new AlertDialog.Builder(mContext)
-                .setMessage(getString(R.string.zen_mode_delete_rule_confirmation, mRule.getName()))
-                .setNegativeButton(R.string.cancel, null)
-                .setPositiveButton(R.string.zen_mode_delete_rule_button, new OnClickListener() {
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        mMetricsFeatureProvider.action(mContext,
-                                MetricsEvent.ACTION_ZEN_DELETE_RULE_OK);
-                        mDeleting = true;
-                        mBackend.removeZenRule(mId);
-                    }
-                })
-                .show();
-        final View messageView = dialog.findViewById(android.R.id.message);
-        if (messageView != null) {
-            messageView.setTextDirection(View.TEXT_DIRECTION_LOCALE);
-        }
+    private void showRuleNameDialog() {
+        ZenRuleNameDialog.show(this, mRule.getName(), null, new RuleNameChangeListener());
     }
 
     private void toastAndFinish() {
-        if (!mDeleting) {
-            Toast.makeText(mContext, R.string.zen_mode_rule_not_found_text, Toast.LENGTH_SHORT)
+        Toast.makeText(mContext, R.string.zen_mode_rule_not_found_text, Toast.LENGTH_SHORT)
                     .show();
-        }
         getActivity().finish();
     }
 
     private void updateRuleName() {
-        Activity activity = getActivity();
-        if (activity != null) {
-            activity.setTitle(mRule.getName());
+        if (mRule != null) {
             mRuleName.setSummary(mRule.getName());
         } else {
-            if (DEBUG) Log.d(TAG, "updateRuleName - activity title and mRuleName "
-                    + "not updated; getActivity() returned null");
+            if (DEBUG) Log.d(TAG, "updateRuleName - mRuleName "
+                    + "not updated; mRuleName returned null");
         }
     }
 
@@ -291,10 +188,19 @@
         mDisableListeners = true;
         updateRuleName();
         updateControlsInternal();
-        mZenMode.setValue(Integer.toString(mRule.getInterruptionFilter()));
-        if (mSwitchBar != null) {
-            mSwitchBar.setChecked(mRule.isEnabled());
-        }
+        updateHeader();
         mDisableListeners = false;
     }
+
+    public class RuleNameChangeListener implements ZenRuleNameDialog.PositiveClickListener {
+        public RuleNameChangeListener() {}
+
+        @Override
+        public void onOk(String ruleName, Fragment parent) {
+            mMetricsFeatureProvider.action(mContext,
+                    MetricsProto.MetricsEvent.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
+            mRule.setName(ruleName);
+            mBackend.setZenRule(mId, mRule);
+        }
+    }
 }
diff --git a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
index ab0349e..ecfe91b 100644
--- a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
@@ -42,6 +42,7 @@
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
@@ -77,21 +78,6 @@
     }
 
     @Override
-    protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
-        return null;
-    }
-
-    @Override
-    protected String getZenModeDependency() {
-        return mDays.getKey();
-    }
-
-    @Override
-    protected int getEnabledToastText() {
-        return R.string.zen_schedule_rule_enabled_toast;
-    }
-
-    @Override
     protected void onCreateInternal() {
         final PreferenceScreen root = getPreferenceScreen();
 
@@ -208,6 +194,20 @@
         updateEndSummary();
     }
 
+
+    @Override
+    protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+        List<AbstractPreferenceController> controllers = new ArrayList<>();
+        mHeader = new ZenAutomaticRuleHeaderPreferenceController(context, this,
+                getLifecycle());
+        mSwitch = new ZenAutomaticRuleSwitchPreferenceController(context, this,
+                R.string.zen_schedule_rule_enabled_toast, getLifecycle());
+
+        controllers.add(mHeader);
+        controllers.add(mSwitch);
+        return controllers;
+    }
+
     @Override
     public int getMetricsCategory() {
         return MetricsEvent.NOTIFICATION_ZEN_MODE_SCHEDULE_RULE;
diff --git a/src/com/android/settings/notification/ZenModeScreenOffPreferenceController.java b/src/com/android/settings/notification/ZenModeScreenOffPreferenceController.java
index 2b70706..0ba24c0 100644
--- a/src/com/android/settings/notification/ZenModeScreenOffPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeScreenOffPreferenceController.java
@@ -22,6 +22,7 @@
 import android.support.v7.preference.Preference;
 import android.util.Log;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeScreenOffPreferenceController extends
@@ -56,8 +57,11 @@
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         final boolean bypass = (Boolean) newValue;
-        if (ZenModeSettingsBase.DEBUG) Log.d(TAG, "onPrefChange allowWhenScreenOff="
-                + !bypass);
+        if (ZenModeSettingsBase.DEBUG) {
+            Log.d(TAG, "onPrefChange allowWhenScreenOff=" + bypass);
+        }
+        mMetricsFeatureProvider.action(mContext,
+                MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_WHEN_SCREEN_OFF, bypass);
         mBackend.saveVisualEffectsPolicy(Policy.SUPPRESSED_EFFECT_SCREEN_OFF, bypass);
         return true;
     }
diff --git a/src/com/android/settings/notification/ZenModeScreenOnPreferenceController.java b/src/com/android/settings/notification/ZenModeScreenOnPreferenceController.java
index 8e0b348..bcb1af8 100644
--- a/src/com/android/settings/notification/ZenModeScreenOnPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeScreenOnPreferenceController.java
@@ -22,6 +22,7 @@
 import android.support.v7.preference.Preference;
 import android.util.Log;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 public class ZenModeScreenOnPreferenceController extends
@@ -57,8 +58,9 @@
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         final boolean bypass = (Boolean) newValue;
         if (ZenModeSettingsBase.DEBUG) Log.d(TAG, "onPrefChange allowWhenScreenOn="
-                + !bypass);
-
+                + bypass);
+        mMetricsFeatureProvider.action(mContext,
+                MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_WHEN_SCREEN_ON, bypass);
         mBackend.saveVisualEffectsPolicy(Policy.SUPPRESSED_EFFECT_SCREEN_ON, bypass);
         return true;
     }
diff --git a/src/com/android/settings/notification/ZenRuleNameDialog.java b/src/com/android/settings/notification/ZenRuleNameDialog.java
index eb85431..819ba5b 100644
--- a/src/com/android/settings/notification/ZenRuleNameDialog.java
+++ b/src/com/android/settings/notification/ZenRuleNameDialog.java
@@ -17,73 +17,103 @@
 package com.android.settings.notification;
 
 import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Fragment;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.net.Uri;
+import android.os.Bundle;
 import android.service.notification.ZenModeConfig;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.EditText;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 
-public abstract class ZenRuleNameDialog {
-    private static final String TAG = "ZenRuleNameDialog";
-    private static final boolean DEBUG = ZenModeSettings.DEBUG;
+public class ZenRuleNameDialog extends InstrumentedDialogFragment {
+    protected static final String TAG = "ZenRuleNameDialog";
+    private static final String EXTRA_ZEN_RULE_NAME = "zen_rule_name";
+    private static final String EXTRA_CONDITION_ID = "extra_zen_condition_id";
+    protected static PositiveClickListener mPositiveClickListener;
 
-    private final AlertDialog mDialog;
-    private final EditText mEditText;
-    private final CharSequence mOriginalRuleName;
-    private final boolean mIsNew;
+    @Override
+    public int getMetricsCategory() {
+        return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_RULE_NAME_DIALOG;
+    }
 
-    public ZenRuleNameDialog(Context context, CharSequence ruleName, Uri conditionId) {
-        mIsNew = ruleName == null;
-        mOriginalRuleName = ruleName;
+    /**
+     * The interface we expect a listener to implement.
+     */
+    public interface PositiveClickListener {
+        void onOk(String newName, Fragment parent);
+    }
+
+    public static void show(Fragment parent, String ruleName, Uri conditionId, PositiveClickListener
+            listener) {
+        final Bundle args = new Bundle();
+        args.putString(EXTRA_ZEN_RULE_NAME, ruleName);
+        args.putParcelable(EXTRA_CONDITION_ID, conditionId);
+        mPositiveClickListener = listener;
+
+        ZenRuleNameDialog dialog = new ZenRuleNameDialog();
+        dialog.setArguments(args);
+        dialog.setTargetFragment(parent, 0);
+        dialog.show(parent.getFragmentManager(), TAG);
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        Bundle arguments = getArguments();
+        Uri conditionId = arguments.getParcelable(EXTRA_CONDITION_ID);
+        String ruleName = arguments.getString(EXTRA_ZEN_RULE_NAME);
+
+        boolean isNew = ruleName == null;
+        CharSequence originalRuleName = ruleName;
+        Context context = getContext();
         final View v = LayoutInflater.from(context).inflate(R.layout.zen_rule_name, null,
                 false);
-        mEditText = (EditText) v.findViewById(R.id.zen_mode_rule_name);
-        if (!mIsNew) {
-            mEditText.setText(ruleName);
+        EditText editText = (EditText) v.findViewById(R.id.zen_mode_rule_name);
+        if (!isNew) {
+            // set text to current rule name
+            editText.setText(ruleName);
+            // move cursor to end of text
+            editText.setSelection(editText.getText().length());
         }
-        mEditText.setSelectAllOnFocus(true);
-        mDialog = new AlertDialog.Builder(context)
-                .setTitle(getTitleResource(conditionId))
+        editText.setSelectAllOnFocus(true);
+        return new AlertDialog.Builder(context)
+                .setTitle(getTitleResource(conditionId, isNew))
                 .setView(v)
-                .setPositiveButton(mIsNew ? R.string.zen_mode_add : R.string.okay,
+                .setPositiveButton(isNew ? R.string.zen_mode_add : R.string.okay,
                         new DialogInterface.OnClickListener() {
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        final String newName = trimmedText();
-                        if (TextUtils.isEmpty(newName)) {
-                            return;
-                        }
-                        if (!mIsNew && mOriginalRuleName != null
-                                && mOriginalRuleName.equals(newName)) {
-                            return;  // no change to an existing rule, just dismiss
-                        }
-                        onOk(newName);
-                    }
-                })
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                final String newName = trimmedText(editText);
+                                if (TextUtils.isEmpty(newName)) {
+                                    return;
+                                }
+                                if (!isNew && originalRuleName != null
+                                        && originalRuleName.equals(newName)) {
+                                    return;  // no change to an existing rule, just dismiss
+                                }
+                               mPositiveClickListener.onOk(newName, getTargetFragment());
+                            }
+                        })
                 .setNegativeButton(R.string.cancel, null)
                 .create();
     }
 
-    abstract public void onOk(String ruleName);
-
-    public void show() {
-        mDialog.show();
+    private String trimmedText(EditText editText) {
+        return editText.getText() == null ? null : editText.getText().toString().trim();
     }
 
-    private String trimmedText() {
-        return mEditText.getText() == null ? null : mEditText.getText().toString().trim();
-    }
-
-    private int getTitleResource(Uri conditionId) {
+    private int getTitleResource(Uri conditionId, boolean isNew) {
         final boolean isEvent = ZenModeConfig.isValidEventConditionId(conditionId);
         final boolean isTime = ZenModeConfig.isValidScheduleConditionId(conditionId);
         int titleResource =  R.string.zen_mode_rule_name;
-        if (mIsNew) {
+        if (isNew) {
             if (isEvent) {
                 titleResource = R.string.zen_mode_add_event_rule;
             } else if (isTime) {
diff --git a/src/com/android/settings/notification/ZenRulePreference.java b/src/com/android/settings/notification/ZenRulePreference.java
index 4d7181a..90f6a94 100644
--- a/src/com/android/settings/notification/ZenRulePreference.java
+++ b/src/com/android/settings/notification/ZenRulePreference.java
@@ -16,23 +16,21 @@
 
 package com.android.settings.notification;
 
-import android.app.AlertDialog;
 import android.app.AutomaticZenRule;
-import android.app.NotificationManager;
+import android.app.Fragment;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
-import android.content.res.Resources;
 import android.service.notification.ZenModeConfig;
 import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceCategory;
 import android.support.v7.preference.PreferenceViewHolder;
 import android.view.View;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
 import com.android.settings.utils.ManagedServiceSettings;
 import com.android.settings.utils.ZenServiceListing;
 import com.android.settingslib.TwoTargetPreference;
@@ -45,16 +43,17 @@
     final CharSequence mName;
     final String mId;
     boolean appExists;
-    final PreferenceCategory mParent;
+    final Fragment mParent;
     final Preference mPref;
     final Context mContext;
     final ZenModeBackend mBackend;
     final ZenServiceListing mServiceListing;
     final PackageManager mPm;
+    final MetricsFeatureProvider mMetricsFeatureProvider;
 
     public ZenRulePreference(Context context,
             final Map.Entry<String, AutomaticZenRule> ruleEntry,
-            PreferenceCategory prefCategory) {
+            Fragment parent, MetricsFeatureProvider metricsProvider) {
         super(context);
 
         mBackend = ZenModeBackend.getInstance(context);
@@ -62,11 +61,12 @@
         final AutomaticZenRule rule = ruleEntry.getValue();
         mName = rule.getName();
         mId = ruleEntry.getKey();
-        mParent = prefCategory;
+        mParent = parent;
         mPm = mContext.getPackageManager();
         mServiceListing = new ZenServiceListing(mContext, CONFIG);
         mServiceListing.reloadApprovedServices();
         mPref = this;
+        mMetricsFeatureProvider = metricsProvider;
 
         setAttributes(rule);
     }
@@ -89,25 +89,21 @@
     private final View.OnClickListener mDeleteListener = new View.OnClickListener() {
         @Override
         public void onClick(View v) {
-            showDeleteRuleDialog(mId, mName, mParent, mPref);
+            showDeleteRuleDialog(mParent, mId, mName.toString());
         }
     };
 
-    private void showDeleteRuleDialog(final String ruleId, final CharSequence ruleName,
-            PreferenceCategory parent, Preference pref) {
-        new AlertDialog.Builder(mContext)
-                .setMessage(mContext.getResources().getString(
-                        R.string.zen_mode_delete_rule_confirmation, ruleName))
-                .setNegativeButton(R.string.cancel, null)
-                .setPositiveButton(R.string.zen_mode_delete_rule_button,
-                        new DialogInterface.OnClickListener() {
-                            @Override
-                            public void onClick(DialogInterface dialog, int which) {
-                                mBackend.removeZenRule(ruleId);
-                                parent.removePreference(pref);
-                            }
-                        })
-                .show();
+    private void showDeleteRuleDialog(final Fragment parent, final String ruleId,
+            final String ruleName) {
+        ZenDeleteRuleDialog.show(parent, ruleName, ruleId,
+                new ZenDeleteRuleDialog.PositiveClickListener() {
+                    @Override
+                    public void onOk(String id) {
+                        mMetricsFeatureProvider.action(mContext,
+                                MetricsProto.MetricsEvent.ACTION_ZEN_DELETE_RULE_OK);
+                        mBackend.removeZenRule(id);
+                    }
+                });
     }
 
     protected void setAttributes(AutomaticZenRule rule) {
@@ -141,26 +137,8 @@
 
     private String computeRuleSummary(AutomaticZenRule rule, boolean isSystemRule,
             CharSequence providerLabel) {
-        final String mode = computeZenModeCaption(mContext.getResources(),
-                rule.getInterruptionFilter());
-        final String ruleState = (rule == null || !rule.isEnabled())
+        return (rule == null || !rule.isEnabled())
                 ? mContext.getResources().getString(R.string.switch_off_text)
-                : mContext.getResources().getString(
-                        R.string.zen_mode_rule_summary_enabled_combination, mode);
-
-        return ruleState;
-    }
-
-    private static String computeZenModeCaption(Resources res, int zenMode) {
-        switch (zenMode) {
-            case NotificationManager.INTERRUPTION_FILTER_ALARMS:
-                return res.getString(R.string.zen_mode_option_alarms);
-            case NotificationManager.INTERRUPTION_FILTER_PRIORITY:
-                return res.getString(R.string.zen_mode_option_important_interruptions);
-            case NotificationManager.INTERRUPTION_FILTER_NONE:
-                return res.getString(R.string.zen_mode_option_no_interruptions);
-            default:
-                return null;
-        }
+                : mContext.getResources().getString(R.string.switch_on_text);
     }
 }
\ No newline at end of file
diff --git a/src/com/android/settings/notification/ZenRuleSelectionDialog.java b/src/com/android/settings/notification/ZenRuleSelectionDialog.java
index 0c725ed..0784d5a 100644
--- a/src/com/android/settings/notification/ZenRuleSelectionDialog.java
+++ b/src/com/android/settings/notification/ZenRuleSelectionDialog.java
@@ -16,16 +16,20 @@
 
 package com.android.settings.notification;
 
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+
 import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Fragment;
 import android.app.NotificationManager;
 import android.content.Context;
 import android.content.DialogInterface;
-import android.content.DialogInterface.OnDismissListener;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
 import android.graphics.drawable.Drawable;
 import android.os.AsyncTask;
+import android.os.Bundle;
 import android.service.notification.ZenModeConfig;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -35,6 +39,7 @@
 import android.widget.TextView;
 
 import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 import com.android.settings.utils.ZenServiceListing;
 
 import java.lang.ref.WeakReference;
@@ -43,24 +48,48 @@
 import java.util.Set;
 import java.util.TreeSet;
 
-public abstract class ZenRuleSelectionDialog {
+public class ZenRuleSelectionDialog extends InstrumentedDialogFragment {
     private static final String TAG = "ZenRuleSelectionDialog";
     private static final boolean DEBUG = ZenModeSettings.DEBUG;
 
-    private final Context mContext;
-    private final PackageManager mPm;
-    private NotificationManager mNm;
-    private final AlertDialog mDialog;
-    private final LinearLayout mRuleContainer;
-    private final ZenServiceListing mServiceListing;
+    private static ZenServiceListing mServiceListing;
+    protected static PositiveClickListener mPositiveClickListener;
 
-    public ZenRuleSelectionDialog(Context context, ZenServiceListing serviceListing) {
+    private static Context mContext;
+    private static PackageManager mPm;
+    private static NotificationManager mNm;
+    private LinearLayout mRuleContainer;
+
+    /**
+     * The interface we expect a listener to implement.
+     */
+    public interface PositiveClickListener {
+        void onSystemRuleSelected(ZenRuleInfo ruleInfo, Fragment parent);
+        void onExternalRuleSelected(ZenRuleInfo ruleInfo, Fragment parent);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsEvent.NOTIFICATION_ZEN_MODE_RULE_SELECTION_DIALOG;
+    }
+
+    public static void show(Context context, Fragment parent, PositiveClickListener
+            listener, ZenServiceListing serviceListing) {
+        mPositiveClickListener = listener;
         mContext = context;
-        mPm = context.getPackageManager();
-        mNm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
+        mPm = mContext.getPackageManager();
+        mNm = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
         mServiceListing = serviceListing;
-        final View v =
-                LayoutInflater.from(context).inflate(R.layout.zen_rule_type_selection, null, false);
+
+        ZenRuleSelectionDialog dialog = new ZenRuleSelectionDialog();
+        dialog.setTargetFragment(parent, 0);
+        dialog.show(parent.getFragmentManager(), TAG);
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        final View v = LayoutInflater.from(getContext()).inflate(R.layout.zen_rule_type_selection,
+                null, false);
 
         mRuleContainer = (LinearLayout) v.findViewById(R.id.rule_container);
         if (mServiceListing != null) {
@@ -69,28 +98,21 @@
             mServiceListing.addZenCallback(mServiceListingCallback);
             mServiceListing.reloadApprovedServices();
         }
-        mDialog = new AlertDialog.Builder(context)
+        return new AlertDialog.Builder(getContext())
                 .setTitle(R.string.zen_mode_choose_rule_type)
                 .setView(v)
-                .setOnDismissListener(new OnDismissListener() {
-                    @Override
-                    public void onDismiss(DialogInterface dialog) {
-                        if (mServiceListing != null) {
-                            mServiceListing.removeZenCallback(mServiceListingCallback);
-                        }
-                    }
-                })
                 .setNegativeButton(R.string.cancel, null)
                 .create();
     }
 
-    public void show() {
-        mDialog.show();
+    @Override
+    public void onDismiss(DialogInterface dialog) {
+        super.onDismiss(dialog);
+        if (mServiceListing != null) {
+            mServiceListing.removeZenCallback(mServiceListingCallback);
+        }
     }
 
-    abstract public void onSystemRuleSelected(ZenRuleInfo ruleInfo);
-    abstract public void onExternalRuleSelected(ZenRuleInfo ruleInfo);
-
     private void bindType(final ZenRuleInfo ri) {
         try {
             ApplicationInfo info = mPm.getApplicationInfo(ri.packageName, 0);
@@ -108,11 +130,11 @@
             v.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-                    mDialog.dismiss();
+                    dismiss();
                     if (ri.isSystem) {
-                        onSystemRuleSelected(ri);
+                        mPositiveClickListener.onSystemRuleSelected(ri, getTargetFragment());
                     } else {
-                        onExternalRuleSelected(ri);
+                        mPositiveClickListener.onExternalRuleSelected(ri, getTargetFragment());
                     }
                 }
             });
diff --git a/tests/robotests/assets/grandfather_not_implementing_index_provider b/tests/robotests/assets/grandfather_not_implementing_index_provider
index 4d5b256..6d3ec9a 100644
--- a/tests/robotests/assets/grandfather_not_implementing_index_provider
+++ b/tests/robotests/assets/grandfather_not_implementing_index_provider
@@ -4,6 +4,7 @@
 com.android.settings.bluetooth.BluetoothPairingDetail
 com.android.settings.accounts.AccountDetailDashboardFragment
 com.android.settings.fuelgauge.PowerUsageAnomalyDetails
+com.android.settings.fuelgauge.PowerUsageSummaryLegacy
 com.android.settings.fuelgauge.AdvancedPowerUsageDetail
 com.android.settings.development.featureflags.FeatureFlagsDashboard
 com.android.settings.development.qstile.DevelopmentTileConfigFragment
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 4113c90..e25fa18 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -20,4 +20,5 @@
     <bool name="config_show_camera_laser_sensor">false</bool>
     <bool name="config_show_connectivity_monitor">false</bool>
     <bool name="config_display_recent_apps">false</bool>
+    <bool name="config_location_mode_available">false</bool>
 </resources>
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/ims/ImsManager.java b/tests/robotests/src/com/android/ims/ImsManager.java
deleted file mode 100644
index a4d97b5..0000000
--- a/tests/robotests/src/com/android/ims/ImsManager.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.ims;
-
-import android.content.Context;
-
-/**
- * Fake test class to com.android.ims.ImsManager
- */
-public class ImsManager {
-
-    public static boolean wfcEnabledByPlatform;
-    public static boolean wfcProvisioned;
-
-    public static boolean isWfcEnabledByPlatform(Context context) {
-        return wfcEnabledByPlatform;
-    }
-
-    public static boolean isWfcProvisionedOnDevice(Context context) {
-        return wfcProvisioned;
-    }
-
-    public static int getWfcMode(Context context, boolean roaming) {
-        return 0;
-    }
-
-    public static boolean isWfcEnabledByUser(Context context) {
-        return false;
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/DeviceAdminAddTest.java b/tests/robotests/src/com/android/settings/DeviceAdminAddTest.java
index ccd0485..30d8151 100644
--- a/tests/robotests/src/com/android/settings/DeviceAdminAddTest.java
+++ b/tests/robotests/src/com/android/settings/DeviceAdminAddTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DeviceAdminAddTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java b/tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java
index 7e69172..78f5bdf 100644
--- a/tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java
@@ -60,7 +60,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowUtils.class, ShadowConnectivityManager.class, ShadowUserManager.class}
 )
 public class DeviceInfoSettingsTest {
diff --git a/tests/robotests/src/com/android/settings/DisplaySettingsTest.java b/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
index a956aa7..6f34a2e 100644
--- a/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
@@ -15,13 +15,12 @@
 import org.junit.runner.RunWith;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
-import org.robolectric.util.ReflectionHelpers;
 
 import java.util.ArrayList;
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DisplaySettingsTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/HelpTrampolineTest.java b/tests/robotests/src/com/android/settings/HelpTrampolineTest.java
index 11f5c7b..e10b878 100644
--- a/tests/robotests/src/com/android/settings/HelpTrampolineTest.java
+++ b/tests/robotests/src/com/android/settings/HelpTrampolineTest.java
@@ -34,7 +34,7 @@
 import static org.robolectric.Shadows.shadowOf;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowHelpUtils.class
         })
diff --git a/tests/robotests/src/com/android/settings/LegalSettingsTest.java b/tests/robotests/src/com/android/settings/LegalSettingsTest.java
index f457c08..3d50c63 100644
--- a/tests/robotests/src/com/android/settings/LegalSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/LegalSettingsTest.java
@@ -29,7 +29,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LegalSettingsTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/LicenseHtmlGeneratorFromXmlTest.java b/tests/robotests/src/com/android/settings/LicenseHtmlGeneratorFromXmlTest.java
index 7d82b27..ea4b272 100644
--- a/tests/robotests/src/com/android/settings/LicenseHtmlGeneratorFromXmlTest.java
+++ b/tests/robotests/src/com/android/settings/LicenseHtmlGeneratorFromXmlTest.java
@@ -34,7 +34,7 @@
 import org.xmlpull.v1.XmlPullParserException;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LicenseHtmlGeneratorFromXmlTest {
     private static final String VAILD_XML_STRING =
             "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
diff --git a/tests/robotests/src/com/android/settings/LicenseHtmlLoaderTest.java b/tests/robotests/src/com/android/settings/LicenseHtmlLoaderTest.java
index 2fd655f..b16d315 100644
--- a/tests/robotests/src/com/android/settings/LicenseHtmlLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/LicenseHtmlLoaderTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LicenseHtmlLoaderTest {
     @Mock
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/MasterClearTest.java b/tests/robotests/src/com/android/settings/MasterClearTest.java
index bfdf25e..838b1e8 100644
--- a/tests/robotests/src/com/android/settings/MasterClearTest.java
+++ b/tests/robotests/src/com/android/settings/MasterClearTest.java
@@ -51,7 +51,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = {ShadowUtils.class}
 )
 public class MasterClearTest {
diff --git a/tests/robotests/src/com/android/settings/PrivacySettingsTest.java b/tests/robotests/src/com/android/settings/PrivacySettingsTest.java
index 4eaa781..c52204d 100644
--- a/tests/robotests/src/com/android/settings/PrivacySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/PrivacySettingsTest.java
@@ -33,7 +33,7 @@
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PrivacySettingsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/SettingsActivityTest.java b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
index 8d595bc..509ecda 100644
--- a/tests/robotests/src/com/android/settings/SettingsActivityTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsActivityTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/SettingsDialogFragmentTest.java b/tests/robotests/src/com/android/settings/SettingsDialogFragmentTest.java
index a5a7280..942634a 100644
--- a/tests/robotests/src/com/android/settings/SettingsDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsDialogFragmentTest.java
@@ -33,7 +33,7 @@
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsDialogFragmentTest {
 
     private static final int DIALOG_ID = 15;
diff --git a/tests/robotests/src/com/android/settings/SettingsDumpServiceTest.java b/tests/robotests/src/com/android/settings/SettingsDumpServiceTest.java
index 38e78e4..0d0f22c 100644
--- a/tests/robotests/src/com/android/settings/SettingsDumpServiceTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsDumpServiceTest.java
@@ -37,7 +37,7 @@
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsDumpServiceTest {
     private static final String PACKAGE_BROWSER = "com.android.test.browser";
     private static final String PACKAGE_NULL = "android";
diff --git a/tests/robotests/src/com/android/settings/SettingsLicenseActivityTest.java b/tests/robotests/src/com/android/settings/SettingsLicenseActivityTest.java
index 6d28bd5..ecda97e 100644
--- a/tests/robotests/src/com/android/settings/SettingsLicenseActivityTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsLicenseActivityTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsLicenseActivityTest {
     private ActivityController<SettingsLicenseActivity> mActivityController;
     private SettingsLicenseActivity mActivity;
diff --git a/tests/robotests/src/com/android/settings/SettingsPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/SettingsPreferenceFragmentTest.java
index 788d185..5fc9767 100644
--- a/tests/robotests/src/com/android/settings/SettingsPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsPreferenceFragmentTest.java
@@ -47,7 +47,7 @@
 import com.android.settings.testutils.shadow.SettingsShadowResources;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsPreferenceFragmentTest {
 
     private static final int ITEM_COUNT = 5;
diff --git a/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java b/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
index 17d1021..60972ee 100644
--- a/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
@@ -45,7 +45,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResourcesImpl.class,
diff --git a/tests/robotests/src/com/android/settings/SetupWizardUtilsTest.java b/tests/robotests/src/com/android/settings/SetupWizardUtilsTest.java
index 4238a4c..21061c1 100644
--- a/tests/robotests/src/com/android/settings/SetupWizardUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/SetupWizardUtilsTest.java
@@ -34,7 +34,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowSystemProperties.class
         })
diff --git a/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java b/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
index 94e4785..59a5867 100644
--- a/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
@@ -35,7 +35,7 @@
 import com.android.settings.testutils.shadow.SettingsShadowResources;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class
diff --git a/tests/robotests/src/com/android/settings/TestConfig.java b/tests/robotests/src/com/android/settings/TestConfig.java
index d2d65a9..4a319bb 100644
--- a/tests/robotests/src/com/android/settings/TestConfig.java
+++ b/tests/robotests/src/com/android/settings/TestConfig.java
@@ -23,11 +23,6 @@
  */
 public class TestConfig {
 
-    /**
-     * @deprecated New tests should use {@link #SDK_VERSION_O}
-     */
-    @Deprecated
-    public static final int SDK_VERSION = 23;
-    public static final int SDK_VERSION_O = Build.VERSION_CODES.O;
+    public static final int SDK_VERSION = Build.VERSION_CODES.O;
     public static final String MANIFEST_PATH = "packages/apps/Settings/AndroidManifest.xml";
 }
diff --git a/tests/robotests/src/com/android/settings/TetherServiceTest.java b/tests/robotests/src/com/android/settings/TetherServiceTest.java
index a888c30..0275c15 100644
--- a/tests/robotests/src/com/android/settings/TetherServiceTest.java
+++ b/tests/robotests/src/com/android/settings/TetherServiceTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TetherServiceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/UtilsTest.java b/tests/robotests/src/com/android/settings/UtilsTest.java
index 3d66dea..f813457 100644
--- a/tests/robotests/src/com/android/settings/UtilsTest.java
+++ b/tests/robotests/src/com/android/settings/UtilsTest.java
@@ -44,7 +44,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UtilsTest {
 
     private static final String PACKAGE_NAME = "com.android.app";
diff --git a/tests/robotests/src/com/android/settings/ZonePickerTest.java b/tests/robotests/src/com/android/settings/ZonePickerTest.java
index 6f9ce4e..5b1b007 100644
--- a/tests/robotests/src/com/android/settings/ZonePickerTest.java
+++ b/tests/robotests/src/com/android/settings/ZonePickerTest.java
@@ -39,7 +39,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowLibcoreTimeZoneNames.class,
                 ShadowLibcoreTimeZoneNames.ShadowZoneStringsCache.class,
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
index 6616537..fb32da1 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
@@ -33,7 +33,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AccessibilitySettingsTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/accessibility/ShortcutServicePickerFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/ShortcutServicePickerFragmentTest.java
index b2eb5b4..cfc62cb 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ShortcutServicePickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ShortcutServicePickerFragmentTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ShortcutServicePickerFragmentTest {
 
     private static final String TEST_SERVICE_KEY_1 = "abc/123";
diff --git a/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
index 8d1d174..5ef5a12 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
index 323a624..afa2229 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
@@ -54,7 +54,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AccountDetailDashboardFragmentTest {
 
     private static final String METADATA_CATEGORY = "com.android.settings.category";
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java
index 0c15339..f409095 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java
@@ -56,7 +56,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = AccountHeaderPreferenceControllerTest.ShadowAuthenticatorHelper.class
 )
 public class AccountHeaderPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
index 6daaeca..139bee7 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
@@ -68,7 +68,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
 public class AccountPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceTest.java b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceTest.java
index 4399580..0778043 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AccountPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountSyncPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AccountSyncPreferenceControllerTest.java
index dde68f5..5fbd3a7 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountSyncPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountSyncPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
 public class AccountSyncPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountTypePreferenceLoaderTest.java b/tests/robotests/src/com/android/settings/accounts/AccountTypePreferenceLoaderTest.java
index 2e7f0fa..fff73b7 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountTypePreferenceLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountTypePreferenceLoaderTest.java
@@ -50,7 +50,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AccountTypePreferenceLoaderTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java
index e00a0ae..faaf7db 100644
--- a/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AddUserWhenLockedPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
index 336de21..7aa339f 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoSyncDataPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
index 50d4df8..597fbd4 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoSyncPersonalDataPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java
index 35a8bb6..a25aa28 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoSyncWorkDataPreferenceControllerTest {
 
     private static int MANAGED_PROFILE_ID = 10;
diff --git a/tests/robotests/src/com/android/settings/accounts/EmergencyInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/EmergencyInfoPreferenceControllerTest.java
index 29a011e..ff8ca01 100644
--- a/tests/robotests/src/com/android/settings/accounts/EmergencyInfoPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/EmergencyInfoPreferenceControllerTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EmergencyInfoPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java b/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java
index 4d1667f..4e4bb4f 100644
--- a/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ProviderPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java
index 8250340..a1f40fc 100644
--- a/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java
@@ -61,7 +61,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RemoveAccountPreferenceControllerTest {
 
     private static final String KEY_REMOVE_ACCOUNT = "remove_account";
diff --git a/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java
index ef23d22..cd73068 100644
--- a/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java
@@ -28,7 +28,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RemoveUserFragmentTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
index 2383ed1..8dba2f2 100644
--- a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserAndAccountDashboardFragmentTest {
 
     private static final String METADATA_CATEGORY = "com.android.settings.category";
diff --git a/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java
index 55141f7..3b61280 100644
--- a/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java
@@ -40,7 +40,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppAndNotificationDashboardFragmentTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/AppInfoDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/applications/AppInfoDashboardFragmentTest.java
index 3314a21..d710d7c 100644
--- a/tests/robotests/src/com/android/settings/applications/AppInfoDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppInfoDashboardFragmentTest.java
@@ -73,7 +73,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O
+    sdk = TestConfig.SDK_VERSION
 )
 public final class AppInfoDashboardFragmentTest {
 
diff --git a/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java b/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
index 7c9e81c..50cd979 100644
--- a/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
@@ -56,7 +56,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowEntityHeaderController.class)
 public class AppInfoWithHeaderTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java
index b0f0d0c..2e52214 100644
--- a/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppPermissionsPreferenceControllerTest {
 
     private static final String PERM_LOCATION = "android.permission-group.LOCATION";
diff --git a/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java b/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
index 6fadb43..d63697e 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AppStateAppOpsBridgeTest {
 
     @Mock private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/applications/AppStateInstallAppsBridgeTest.java b/tests/robotests/src/com/android/settings/applications/AppStateInstallAppsBridgeTest.java
index c88f878..62623e5 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStateInstallAppsBridgeTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStateInstallAppsBridgeTest.java
@@ -28,7 +28,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppStateInstallAppsBridgeTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/AppStorageSettingsTest.java b/tests/robotests/src/com/android/settings/applications/AppStorageSettingsTest.java
index d254074..1f6aea4 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStorageSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStorageSettingsTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppStorageSettingsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
index 62cb26c..e55c8f1 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
@@ -21,7 +21,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppStorageSizesControllerTest {
     private static final String COMPUTING = "Computing…";
     private static final String INVALID_SIZE = "Couldn’t compute package size.";
diff --git a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
index eb3d94f..33d261f 100644
--- a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
@@ -56,7 +56,7 @@
  * Tests for {@link InstalledAppCounter}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AppWithAdminGrantedPermissionsCounterTest {
 
     private final String APP_1 = "app1";
diff --git a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
index d7c8059..2e9328a 100644
--- a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
@@ -55,7 +55,7 @@
  * Tests for {@link AppWithAdminGrantedPermissionsLister}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AppWithAdminGrantedPermissionsListerTest {
 
     private final String APP_1 = "app1";
diff --git a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
index dad02ef..e5b7a66 100644
--- a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
@@ -55,7 +55,7 @@
  * Tests for {@link ApplicationFeatureProviderImpl}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowUserManager.class})
 public final class ApplicationFeatureProviderImplTest {
 
diff --git a/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java b/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java
index 78ec265..9441707 100644
--- a/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppSettingsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/applications/DrawOverlayDetailsTest.java b/tests/robotests/src/com/android/settings/applications/DrawOverlayDetailsTest.java
index bc7738c..94dc137 100644
--- a/tests/robotests/src/com/android/settings/applications/DrawOverlayDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/DrawOverlayDetailsTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DrawOverlayDetailsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/EnterpriseDefaultAppsTest.java b/tests/robotests/src/com/android/settings/applications/EnterpriseDefaultAppsTest.java
index 8014dbb..10caf13 100644
--- a/tests/robotests/src/com/android/settings/applications/EnterpriseDefaultAppsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/EnterpriseDefaultAppsTest.java
@@ -27,7 +27,7 @@
 import static junit.framework.Assert.assertTrue;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EnterpriseDefaultAppsTest {
     @Test
     public void testNumberOfIntentsCorrelateWithUI() throws Exception {
diff --git a/tests/robotests/src/com/android/settings/applications/FetchPackageStorageAsyncLoaderTest.java b/tests/robotests/src/com/android/settings/applications/FetchPackageStorageAsyncLoaderTest.java
index d34b2eb..3269acb 100644
--- a/tests/robotests/src/com/android/settings/applications/FetchPackageStorageAsyncLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/applications/FetchPackageStorageAsyncLoaderTest.java
@@ -44,7 +44,7 @@
 import java.io.IOException;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FetchPackageStorageAsyncLoaderTest {
     private static final String PACKAGE_NAME = "com.test.package";
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/InstalledAppCounterTest.java b/tests/robotests/src/com/android/settings/applications/InstalledAppCounterTest.java
index def8758..58c4386 100644
--- a/tests/robotests/src/com/android/settings/applications/InstalledAppCounterTest.java
+++ b/tests/robotests/src/com/android/settings/applications/InstalledAppCounterTest.java
@@ -61,7 +61,7 @@
  * Tests for {@link InstalledAppCounter}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowUserManager.class})
 public final class InstalledAppCounterTest {
 
diff --git a/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java b/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java
index b6f75d4..21e7848 100644
--- a/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java
@@ -85,7 +85,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = InstalledAppDetailsTest.ShadowUtils.class
 )
 public final class InstalledAppDetailsTest {
diff --git a/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java b/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java
index 6a5cfeb..c74deae 100644
--- a/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java
@@ -57,7 +57,7 @@
  * Tests for {@link InstalledAppLister}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class InstalledAppListerTest {
 
     private final String APP_1 = "app1";
diff --git a/tests/robotests/src/com/android/settings/applications/LayoutPreferenceTest.java b/tests/robotests/src/com/android/settings/applications/LayoutPreferenceTest.java
index 35d1194..ffb1d40 100644
--- a/tests/robotests/src/com/android/settings/applications/LayoutPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/applications/LayoutPreferenceTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LayoutPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/applications/ManageDomainUrlsTest.java b/tests/robotests/src/com/android/settings/applications/ManageDomainUrlsTest.java
index 3e89647..c480a49 100644
--- a/tests/robotests/src/com/android/settings/applications/ManageDomainUrlsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/ManageDomainUrlsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ManageDomainUrlsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java b/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java
index 735a811..11d757f 100644
--- a/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java
@@ -49,7 +49,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationAppsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java b/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java
index 0291392..0369130 100644
--- a/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PictureInPictureDetailsTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java b/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
index 81df422..dd3ec85 100644
--- a/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.applications;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.when;
@@ -44,7 +45,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PictureInPictureSettingsTest {
 
     private static final int PRIMARY_USER_ID = 0;
diff --git a/tests/robotests/src/com/android/settings/applications/PremiumSmsAccessTest.java b/tests/robotests/src/com/android/settings/applications/PremiumSmsAccessTest.java
index 32a11f4..1aea60b 100644
--- a/tests/robotests/src/com/android/settings/applications/PremiumSmsAccessTest.java
+++ b/tests/robotests/src/com/android/settings/applications/PremiumSmsAccessTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PremiumSmsAccessTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
index d0d8a3b..84a121f 100644
--- a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
@@ -65,7 +65,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RecentAppsPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java
index 09bfc29..f17addd 100644
--- a/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SpecialAppAccessPreferenceControllerTest {
     private Context mContext;
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java b/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java
index 44b54a8..2d821f3 100644
--- a/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsageAccessDetailsTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java b/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
index ed14879..1a79869 100644
--- a/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VrListenerSettingsTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java b/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
index 746bcf5..c2abefa 100644
--- a/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WriteSettingsDetailsTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
index 065fe2b..3516445 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
@@ -57,7 +57,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppBatteryPreferenceControllerTest {
 
     private static final int TARGET_UID = 111;
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
index 40f095c..b02e01e 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
@@ -36,7 +36,6 @@
 import android.os.Bundle;
 import android.support.v7.preference.Preference;
 
-import com.android.settings.R;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.AppInfoDashboardFragment;
 import com.android.settings.datausage.AppDataUsage;
@@ -53,7 +52,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppDataUsagePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBaseTest.java
index 0803c93..25dcab3 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBaseTest.java
@@ -29,7 +29,6 @@
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
 
-import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.TestConfig;
@@ -47,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppInfoPreferenceControllerBaseTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppMemoryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppMemoryPreferenceControllerTest.java
index 39bb875..d74e301 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppMemoryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppMemoryPreferenceControllerTest.java
@@ -49,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppMemoryPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppNotificationPreferenceControllerTest.java
index 0d42fc2..482f33c 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppNotificationPreferenceControllerTest.java
@@ -29,7 +29,6 @@
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
 
-import com.android.settings.R;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.AppInfoDashboardFragment;
 import com.android.settings.notification.AppNotificationSettings;
@@ -47,7 +46,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppNotificationPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppOpenByDefaultPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppOpenByDefaultPreferenceControllerTest.java
index d4f0179..b708232 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppOpenByDefaultPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppOpenByDefaultPreferenceControllerTest.java
@@ -31,7 +31,6 @@
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
 
-import com.android.settings.R;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.AppInfoDashboardFragment;
 import com.android.settings.applications.AppLaunchSettings;
@@ -50,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppOpenByDefaultPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppPermissionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppPermissionPreferenceControllerTest.java
index 3ddfaf0..f9f8d98 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppPermissionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppPermissionPreferenceControllerTest.java
@@ -49,7 +49,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppPermissionPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
index 1b6b3c0..729914a 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
@@ -31,7 +31,6 @@
 import android.os.Bundle;
 import android.support.v7.preference.Preference;
 
-import com.android.settings.R;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.AppInfoDashboardFragment;
 import com.android.settings.applications.AppStorageSettings;
@@ -48,7 +47,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppStoragePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppVersionPreferenceControllerTest.java
index 838b442..7418489 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppVersionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppVersionPreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppVersionPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBaseTest.java
index 1a06f3b..358e50d 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBaseTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppShortcutPreferenceControllerBaseTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultBrowserShortcutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultBrowserShortcutPreferenceControllerTest.java
index 0a18722..c7c63f1 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultBrowserShortcutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultBrowserShortcutPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultBrowserShortcutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultEmergencyShortcutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultEmergencyShortcutPreferenceControllerTest.java
index 414ef70..740847d 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultEmergencyShortcutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultEmergencyShortcutPreferenceControllerTest.java
@@ -24,7 +24,6 @@
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
-import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.provider.Settings;
@@ -45,7 +44,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultEmergencyShortcutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultHomeShortcutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultHomeShortcutPreferenceControllerTest.java
index a0a57f6..1164b38 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultHomeShortcutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultHomeShortcutPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Implements;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultHomeShortcutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultPhoneShortcutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultPhoneShortcutPreferenceControllerTest.java
index d04b114..c7993bc 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultPhoneShortcutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultPhoneShortcutPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Implements;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultPhoneShortcutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultSmsShortcutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultSmsShortcutPreferenceControllerTest.java
index 4abaa6a..2c9b6c7 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DefaultSmsShortcutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DefaultSmsShortcutPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Implements;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultSmsShortcutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/assist/AssistContextPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/assist/AssistContextPreferenceControllerTest.java
index 253d6ea..c59ac18 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/AssistContextPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/AssistContextPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AssistContextPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/assist/AssistFlashScreenPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/assist/AssistFlashScreenPreferenceControllerTest.java
index e062291..1dec8d0 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/AssistFlashScreenPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/AssistFlashScreenPreferenceControllerTest.java
@@ -51,7 +51,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AssistFlashScreenPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java b/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java
index 431cfba..f0956c7 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java
@@ -29,7 +29,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AssistSettingObserverTest {
 
     private AssistSettingObserver mObserver;
diff --git a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPickerTest.java b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPickerTest.java
index 1018872..65f0b46 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPickerTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.spy;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAssistPickerTest {
 
     private static ComponentName sTestAssist;
diff --git a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
index 199862f..180abbb 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
@@ -56,7 +56,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAssistPreferenceControllerTest {
 
     private static final String TEST_KEY = "test_pref_key";
diff --git a/tests/robotests/src/com/android/settings/applications/assist/ManageAssistTest.java b/tests/robotests/src/com/android/settings/applications/assist/ManageAssistTest.java
index 6abf09d..1b4fb09 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/ManageAssistTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/ManageAssistTest.java
@@ -29,7 +29,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ManageAssistTest {
 
     private ManageAssist mSettings;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
index 0b933c6..8d28e05 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppInfoTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
index 1afc12a..2cbe19f 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
@@ -51,7 +51,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppPickerFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
index f16c05e..a02a2de 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppPreferenceControllerTest {
 
     private static final String TEST_APP_NAME = "test";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
index 448da81..11323c4 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAutofillPickerTest {
 
     private static final String TEST_APP_KEY = "foo.bar/foo.bar.Baz";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
index 8a181d8..bc72ee4 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAutofillPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java
index 934c4c6..e8a6c1e 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultBrowserPickerTest {
 
     private static final String TEST_APP_KEY = "";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java
index b3406a1..8d527ff 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultBrowserPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java
index d499ac2..124817a 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultEmergencyPickerTest {
 
     private static final String TEST_APP_KEY = "test_app";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
index 4680a08..4b82f1a 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
@@ -59,7 +59,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultHomePickerTest {
 
     private static final String TEST_APP_KEY = "com.android.settings/DefaultEmergencyPickerTest";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java
index cf19655..8a8cc29 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java
@@ -51,7 +51,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultHomePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java
index 025d50a..6a73269 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultPaymentSettingsPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java
index b1bea25..f2b7db8 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultPhonePickerTest {
 
     private static final String TEST_APP_KEY = "com.android.settings/PickerTest";
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java
index e9bdfe3..91e68ea 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java
@@ -42,7 +42,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultSmsPickerTest {
 
     private static final String TEST_APP_KEY = "com.android.settings/PickerTest";
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
index 2dde6f4..982fb56 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppFilterItemTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterRegistryTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterRegistryTest.java
index ccd8470..3fe5e67 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterRegistryTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterRegistryTest.java
@@ -60,7 +60,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppFilterRegistryTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/ApplicationViewHolderTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ApplicationViewHolderTest.java
index ebc0ddc..c32b262 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/ApplicationViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ApplicationViewHolderTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ApplicationViewHolderTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
index d208194..dfe8e4c 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
@@ -73,7 +73,7 @@
 @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_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
index c7f2f53..47a08e9 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
@@ -48,7 +48,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MusicViewHolderControllerTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Fragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
index fd25921..e87e3f0 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PhotosViewHolderControllerTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Fragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
index 39cc9a2..5fc3ebc 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Implements;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {BackupSettingsActivityPreferenceControllerTest.ShadowBackupManager.class})
 public class BackupSettingsActivityPreferenceControllerTest {
     private static final String KEY_BACKUP_SETTINGS = "backup_settings";
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityTest.java
index cf3cb53..44c7e10 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityTest.java
@@ -58,7 +58,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {BackupSettingsActivityTest.ShadowBackupSettingsHelper.class,
                 BackupSettingsActivityTest.ShadowUserHandle.class})
 public class BackupSettingsActivityTest {
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
index eb33cd6..9de0c6a 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
@@ -50,7 +50,7 @@
 import com.android.settingslib.drawer.SettingsDrawerActivity;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {BackupSettingsHelperTest.ShadowBackupManagerStub.class})
 public class BackupSettingsHelperTest {
 
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsPreferenceControllerTest.java
index 83d9709..3ad49e7 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import android.support.v7.preference.PreferenceScreen;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {BackupSettingsPreferenceControllerTest.ShadowBackupSettingsHelper.class})
 public class BackupSettingsPreferenceControllerTest {
     private static final String BACKUP_SETTINGS = "backup_settings";
diff --git a/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java b/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java
index 3cc90bd..fd46b4b 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/AlwaysDiscoverableTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AlwaysDiscoverableTest {
     @Mock
     private LocalBluetoothAdapter mLocalAdapter;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java
index e7ce7e0..7b0a3f23 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsButtonsControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = SettingsShadowBluetoothDevice.class)
 public class BluetoothDetailsButtonsControllerTest extends BluetoothDetailsControllerTestBase {
     private BluetoothDetailsButtonsController mController;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerEventsTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerEventsTest.java
index 62e4986..240ece1 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerEventsTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerEventsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows=SettingsShadowBluetoothDevice.class)
 public class BluetoothDetailsControllerEventsTest extends BluetoothDetailsControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
index b03ecc1..8f3d3c2 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothDetailsControllerTestBase {
     protected Context mContext;
     protected Lifecycle mLifecycle;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsHeaderControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsHeaderControllerTest.java
index b45a743..ab338a1 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsHeaderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsHeaderControllerTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.bluetooth;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.verify;
@@ -43,7 +44,9 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+
+@Config(manifest = TestConfig.MANIFEST_PATH,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowBluetoothDevice.class, ShadowEntityHeaderController.class,
                 SettingsShadowResources.class})
 public class BluetoothDetailsHeaderControllerTest extends BluetoothDetailsControllerTestBase {
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressControllerTest.java
index 4edcc74..5ea20bd 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressControllerTest.java
@@ -27,7 +27,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = SettingsShadowBluetoothDevice.class)
 public class BluetoothDetailsMacAddressControllerTest extends BluetoothDetailsControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
index eca5df9..445e4e3 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
@@ -54,7 +54,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows=SettingsShadowBluetoothDevice.class)
 public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsControllerTestBase {
     private BluetoothDetailsProfilesController mController;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
index 5d18c85..6d996c0 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
@@ -53,7 +53,7 @@
 import org.robolectric.fakes.RoboMenu;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothDeviceDetailsFragmentTest {
     private BluetoothDeviceDetailsFragment mFragment;
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
index 93de52d..2e094e2 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothDeviceNamePreferenceControllerTest {
     private static final String DEVICE_NAME = "Nightshade";
     private static final int ORDER = 1;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java
index dcf0296..e9d37f6 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java
@@ -16,6 +16,7 @@
 package com.android.settings.bluetooth;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
@@ -47,7 +48,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = SettingsShadowResources.class)
 public class BluetoothDevicePreferenceTest {
     private static final boolean SHOW_DEVICES_WITHOUT_NAMES = true;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java
index 186e274..cde95cd 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothDeviceRenamePreferenceControllerTest {
 
     private static final String DEVICE_NAME = "Nightshade";
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java
index d5abd93..62039d7 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothDeviceUpdaterTest {
     @Mock
     private DashboardFragment mDashboardFragment;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java
index 102f0a7..b973edb 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java
@@ -58,7 +58,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowResources.class, SettingsShadowResources.SettingsShadowTheme.class
 })
 public class BluetoothEnablerTest {
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java
index ed63fc4..cdaf876 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothFilesPreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothFilesPreferenceControllerTest {
     private Context mContext;
     private BluetoothFilesPreferenceController mController;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java
index 27cf3ca..70d4298 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothMasterSwitchPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java
index f434186..9bc8017 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java
@@ -51,7 +51,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothPairingDetailTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
index e598ec1..80b4810 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
@@ -53,7 +53,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows=ShadowEventLogWriter.class)
 public class BluetoothPairingDialogTest {
 
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java
index 192e447..4459f61 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingPreferenceControllerTest.java
@@ -49,7 +49,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothPairingPreferenceControllerTest {
     private static final int ORDER = 1;
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java
index e7a66fa..0061ee5 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsSummaryProviderTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothSettingsSummaryProviderTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java
index dc318c2..5f3ac32 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSettingsTest.java
@@ -50,7 +50,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothSettingsTest {
 
     private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx";
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java
index cb04347..df3ef63 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java
@@ -29,7 +29,6 @@
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
 import android.content.Context;
-import android.util.Log;
 
 import com.android.settings.R;
 import com.android.settings.TestConfig;
@@ -51,7 +50,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothSummaryUpdaterTest {
     private static final String DEVICE_NAME = "Nightshade";
     private static final String DEVICE_KEYBOARD_NAME = "Bluetooth Keyboard";
diff --git a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java
index c86664c..1cd6a27 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConnectedBluetoothDeviceUpdaterTest {
     @Mock
     private DashboardFragment mDashboardFragment;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
index 169db24..49efecb 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
@@ -49,7 +49,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DeviceListPreferenceFragmentTest {
     private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx";
 
diff --git a/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java
index f9b392e..3294ffd 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/DevicePickerFragmentTest.java
@@ -30,7 +30,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DevicePickerFragmentTest {
     @Mock
     private LocalBluetoothAdapter mLocalAdapter;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java
index 56454b8..a6793bb 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/DeviceProfilesSettingsTest.java
@@ -56,7 +56,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         ShadowEventLogWriter.class
 })
 public class DeviceProfilesSettingsTest {
diff --git a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java
index 6e1e1bc..cacba0c 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.shadows.ShadowDialog;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ForgetDeviceDialogFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
index 254de63..ca11ba1 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RemoteDeviceNameDialogFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java
index d0f367e..54b946b 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedBluetoothDeviceUpdaterTest {
     @Mock
     private DashboardFragment mDashboardFragment;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java b/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java
index 2008c81..8666ce3 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = SettingsShadowResources.class)
 public class UtilsTest {
 
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
index 31d0ec5..2767570 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
@@ -43,7 +43,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AdvancedConnectedDeviceDashboardFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
index ada8944..1bc8a1b 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
@@ -50,7 +50,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConnectedDeviceDashboardFragment2Test {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
index e18115a..f9efc0b 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
@@ -19,7 +19,6 @@
 
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 
@@ -44,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConnectedDeviceGroupControllerTest {
     @Mock
     private DashboardFragment mDashboardFragment;
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java
index 59a5172..7edde6e 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java
@@ -26,7 +26,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsbModePreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
index d153e9a..54b58d1 100644
--- a/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BasePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
index 8814ecb..e8724a7 100644
--- a/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowSystemProperties.class
 })
 public class InstrumentedPreferenceFragmentTest {
diff --git a/tests/robotests/src/com/android/settings/core/TogglePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/core/TogglePreferenceControllerTest.java
index b3df90a..099c9ba 100644
--- a/tests/robotests/src/com/android/settings/core/TogglePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/core/TogglePreferenceControllerTest.java
@@ -24,7 +24,6 @@
 import android.support.v14.preference.SwitchPreference;
 
 import com.android.settings.TestConfig;
-import com.android.settings.core.TogglePreferenceController;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 import org.junit.Before;
@@ -36,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TogglePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/core/codeinspection/CodeInspectionTest.java b/tests/robotests/src/com/android/settings/core/codeinspection/CodeInspectionTest.java
index 16b1f61..126a346 100644
--- a/tests/robotests/src/com/android/settings/core/codeinspection/CodeInspectionTest.java
+++ b/tests/robotests/src/com/android/settings/core/codeinspection/CodeInspectionTest.java
@@ -35,7 +35,7 @@
  * for conformance.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         assetDir = "/tests/robotests/assets")
 public class CodeInspectionTest {
 
diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentedDialogFragmentTest.java b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentedDialogFragmentTest.java
index 88c184c..9e37896 100644
--- a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentedDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentedDialogFragmentTest.java
@@ -28,7 +28,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InstrumentedDialogFragmentTest {
 
     public static class TestDialogFragment extends InstrumentedDialogFragment {
diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java b/tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java
index a7c95b6..da48f15 100644
--- a/tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java
+++ b/tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java
@@ -47,7 +47,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MetricsFeatureProviderTest {
     private static int CATEGORY = 10;
     private static boolean SUBTYPE_BOOLEAN = true;
diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/SharedPreferenceLoggerTest.java b/tests/robotests/src/com/android/settings/core/instrumentation/SharedPreferenceLoggerTest.java
index 49556f2..c80e3a8 100644
--- a/tests/robotests/src/com/android/settings/core/instrumentation/SharedPreferenceLoggerTest.java
+++ b/tests/robotests/src/com/android/settings/core/instrumentation/SharedPreferenceLoggerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SharedPreferenceLoggerTest {
 
     private static final String TEST_TAG = "tag";
diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/VisibilityLoggerMixinTest.java b/tests/robotests/src/com/android/settings/core/instrumentation/VisibilityLoggerMixinTest.java
index b12d9d6..1a47a66 100644
--- a/tests/robotests/src/com/android/settings/core/instrumentation/VisibilityLoggerMixinTest.java
+++ b/tests/robotests/src/com/android/settings/core/instrumentation/VisibilityLoggerMixinTest.java
@@ -44,7 +44,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VisibilityLoggerMixinTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
index 1c72863..e2359e3 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
@@ -68,7 +68,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
index 33f379e..2e4ef71 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
@@ -49,7 +49,7 @@
 import java.util.Objects;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DashboardDataTest {
     private static final String TEST_SUGGESTION_TITLE = "Use fingerprint";
     private static final String TEST_CATEGORY_TILE_TITLE = "Display";
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
index 45038aa..741f2bc 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
@@ -74,7 +74,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = ShadowUserManager.class)
 public class DashboardFeatureProviderImplTest {
 
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
index 372d3c5..c330340 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
@@ -55,7 +55,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DashboardFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardItemAnimatorTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardItemAnimatorTest.java
index bb24435..cda9a22 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardItemAnimatorTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardItemAnimatorTest.java
@@ -31,7 +31,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DashboardItemAnimatorTest {
 
     private DashboardItemAnimator mDashboardItemAnimator;
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardSummaryTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardSummaryTest.java
index 2437565..f3ed57c 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardSummaryTest.java
@@ -47,7 +47,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DashboardSummaryTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardTilePlaceholderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardTilePlaceholderPreferenceControllerTest.java
index 6ea3222..c48f30c 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardTilePlaceholderPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardTilePlaceholderPreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DashboardTilePlaceholderPreferenceControllerTest {
 
 
diff --git a/tests/robotests/src/com/android/settings/dashboard/SummaryLoaderTest.java b/tests/robotests/src/com/android/settings/dashboard/SummaryLoaderTest.java
index f6a32dc..574443d 100644
--- a/tests/robotests/src/com/android/settings/dashboard/SummaryLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/SummaryLoaderTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SummaryLoaderTest {
 
     private static final String SUMMARY_1 = "summary1";
diff --git a/tests/robotests/src/com/android/settings/dashboard/SupportItemAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/SupportItemAdapterTest.java
index 52c8fbb..3dd5266 100644
--- a/tests/robotests/src/com/android/settings/dashboard/SupportItemAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/SupportItemAdapterTest.java
@@ -49,7 +49,7 @@
 import static org.robolectric.Shadows.shadowOf;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SupportItemAdapterTest {
     private static final String ACCOUNT_TYPE = "com.google";
     private final Account USER_1 = new Account("user1", ACCOUNT_TYPE);
diff --git a/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionAdapterTest.java
index 03165c6..d943fe3 100644
--- a/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionAdapterTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConditionAdapterTest {
     @Mock
     private Condition mCondition1;
diff --git a/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionTest.java b/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionTest.java
index 623f762..d077e6f 100644
--- a/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/conditional/ConditionTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConditionTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/dashboard/conditional/DndConditionTest.java b/tests/robotests/src/com/android/settings/dashboard/conditional/DndConditionTest.java
index aa81a1c..e46ae9e 100644
--- a/tests/robotests/src/com/android/settings/dashboard/conditional/DndConditionTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/conditional/DndConditionTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DndConditionTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/EventStoreTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/EventStoreTest.java
index 9598c1e..114ee2b 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/EventStoreTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/EventStoreTest.java
@@ -29,7 +29,7 @@
 import org.robolectric.RuntimeEnvironment;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EventStoreTest {
 
     private EventStore mEventStore;
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
index b77f8a4..030fb6d 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
@@ -62,7 +62,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuggestionAdapterTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionControllerMixinTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionControllerMixinTest.java
index 790f166..bceb865 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionControllerMixinTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionControllerMixinTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowSuggestionController.class
         })
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionDismissControllerTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionDismissControllerTest.java
index 7a4ff15..329518a 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionDismissControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionDismissControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuggestionDismissControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
index fa53e06..49fbf88 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
@@ -68,7 +68,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         ShadowSecureSettings.class,
         SettingsShadowResources.class,
         SettingsShadowSystemProperties.class
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeaturizerTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeaturizerTest.java
index f5e342b..4d6a743 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeaturizerTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeaturizerTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.RuntimeEnvironment;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuggestionFeaturizerTest {
 
     private EventStore mEventStore;
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java
index 3698e4e..1f32531 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.spy;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuggestionRankerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionStateProviderTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionStateProviderTest.java
index 2ce3769..bfd7b4f 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionStateProviderTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionStateProviderTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuggestionStateProviderTest {
 
     private SuggestionStateProvider mProvider;
diff --git a/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java
index 4f7e216..15ca6e4 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowThreadUtils.class)
 public class AppDataUsagePreferenceTest {
 
diff --git a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
index 509e7cc..7cd09de 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
@@ -56,7 +56,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowEntityHeaderController.class)
 public class AppDataUsageTest {
 
diff --git a/tests/robotests/src/com/android/settings/datausage/AppPrefLoaderTest.java b/tests/robotests/src/com/android/settings/datausage/AppPrefLoaderTest.java
index b6547ab..ac28e1d 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppPrefLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppPrefLoaderTest.java
@@ -44,7 +44,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppPrefLoaderTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/datausage/BillingCycleSettingsTest.java b/tests/robotests/src/com/android/settings/datausage/BillingCycleSettingsTest.java
index d735342..8b635d2 100644
--- a/tests/robotests/src/com/android/settings/datausage/BillingCycleSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/BillingCycleSettingsTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BillingCycleSettingsTest {
 
     private static final int LIMIT_BYTES = 123;
diff --git a/tests/robotests/src/com/android/settings/datausage/DataPlanSummaryPreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/DataPlanSummaryPreferenceTest.java
index a5dea97..9ddce53 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataPlanSummaryPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataPlanSummaryPreferenceTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class
diff --git a/tests/robotests/src/com/android/settings/datausage/DataPlanUsageSummaryTest.java b/tests/robotests/src/com/android/settings/datausage/DataPlanUsageSummaryTest.java
index cf790e9..748c317 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataPlanUsageSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataPlanUsageSummaryTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DataPlanUsageSummaryTest {
     @Mock
     private ConnectivityManager mManager;
diff --git a/tests/robotests/src/com/android/settings/datausage/DataPlansSyncTimePreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/DataPlansSyncTimePreferenceTest.java
index 1e2565e..ba2d5f1 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataPlansSyncTimePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataPlansSyncTimePreferenceTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class DataPlansSyncTimePreferenceTest {
     private static final String SYNC_TIME = "Today 12:24pm";
 
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageInfoControllerTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageInfoControllerTest.java
index 57041fd..e60243b 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageInfoControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageInfoControllerTest.java
@@ -13,7 +13,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DataUsageInfoControllerTest {
     private DataUsageInfoController mInfoController;
     private DataUsageInfo info;
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
index 59c99f4..9ab88d3 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
@@ -36,7 +36,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DataUsageListTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryTest.java
index 179f743..dc53ca1 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryTest.java
@@ -48,7 +48,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DataUsageSummaryTest {
     @Mock
     private ConnectivityManager mManager;
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageUtilsTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageUtilsTest.java
index 1dacc68..cdcd3a9 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageUtilsTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class DataUsageUtilsTest {
     @Mock private ConnectivityManager mManager;
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/datausage/ManageDataPlansPreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/ManageDataPlansPreferenceTest.java
index e96b4e8..6eff393 100644
--- a/tests/robotests/src/com/android/settings/datausage/ManageDataPlansPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/ManageDataPlansPreferenceTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class ManageDataPlansPreferenceTest {
     private Preference mPreference;
     private PreferenceViewHolder mHolder;
diff --git a/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java b/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java
index 5ff273e..53cb7ed 100644
--- a/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UnrestrictedDataAccessTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java
index f9784ef..06969bb 100644
--- a/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoTimeFormatPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/datetime/AutoTimePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/AutoTimePreferenceControllerTest.java
index f4c1596..d28cad1 100644
--- a/tests/robotests/src/com/android/settings/datetime/AutoTimePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/AutoTimePreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoTimePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/AutoTimeZonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/AutoTimeZonePreferenceControllerTest.java
index 950fd0d..5cbef72 100644
--- a/tests/robotests/src/com/android/settings/datetime/AutoTimeZonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/AutoTimeZonePreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowConnectivityManager.class)
 public class AutoTimeZonePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java
index 000dd2c..7317300 100644
--- a/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java
@@ -18,7 +18,6 @@
 
 import android.app.AlarmManager;
 import android.content.Context;
-import android.support.v7.preference.Preference;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
@@ -37,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DatePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/TimeChangeListenerMixinTest.java b/tests/robotests/src/com/android/settings/datetime/TimeChangeListenerMixinTest.java
index 524a88e..ada59f4 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimeChangeListenerMixinTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimeChangeListenerMixinTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TimeChangeListenerMixinTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/TimeFormatPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/TimeFormatPreferenceControllerTest.java
index 2e975c3..cd13513 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimeFormatPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimeFormatPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TimeFormatPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
index afec523..bc53b32 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
@@ -17,7 +17,6 @@
 package com.android.settings.datetime;
 
 import android.content.Context;
-import android.os.UserManager;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
@@ -37,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TimePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java
index aa10a70..07bc333 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java
@@ -17,7 +17,6 @@
 package com.android.settings.datetime;
 
 import android.content.Context;
-import android.support.v7.preference.Preference;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
@@ -37,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TimeZonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java b/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java
index 10e5e5c..0ab685a 100644
--- a/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java
@@ -1,6 +1,5 @@
 package com.android.settings.datetime;
 
-import com.android.settings.datetime.ZonePicker;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settingslib.datetime.ZoneGetter;
@@ -23,7 +22,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZonePickerComparatorTest {
 
     // Strings in Chinese are sorted by alphabet order of their Pinyin.
diff --git a/tests/robotests/src/com/android/settings/datetime/ZonePickerTest.java b/tests/robotests/src/com/android/settings/datetime/ZonePickerTest.java
index 09ff1cd..92807e9 100644
--- a/tests/robotests/src/com/android/settings/datetime/ZonePickerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/ZonePickerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZonePickerTest {
 
     private Activity mActivity;
diff --git a/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerDescriptionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerDescriptionPreferenceControllerTest.java
index d0f895a..dd438ff 100644
--- a/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerDescriptionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerDescriptionPreferenceControllerTest.java
@@ -23,7 +23,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutomaticStorageManagerDescriptionPreferenceControllerTest {
     @Mock private PreferenceScreen mScreen;
     @Mock private Preference mPreference;
diff --git a/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarControllerTest.java b/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarControllerTest.java
index c9c3e24..66ccc6e 100644
--- a/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutomaticStorageManagerSwitchBarControllerTest {
     private Context mContext;
     private SwitchBar mSwitchBar;
diff --git a/tests/robotests/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceControllerTest.java
index 29f19df..582400d 100644
--- a/tests/robotests/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AbstractBluetoothA2dpPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/AdbPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AdbPreferenceControllerTest.java
index 6dac819..ddcd850 100644
--- a/tests/robotests/src/com/android/settings/development/AdbPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AdbPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AdbPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/AllowAppsOnExternalPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AllowAppsOnExternalPreferenceControllerTest.java
index 2703617..e23c4cc 100644
--- a/tests/robotests/src/com/android/settings/development/AllowAppsOnExternalPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AllowAppsOnExternalPreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AllowAppsOnExternalPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/AnimatorDurationScalePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AnimatorDurationScalePreferenceControllerTest.java
index 6c83e47..5acaf0a 100644
--- a/tests/robotests/src/com/android/settings/development/AnimatorDurationScalePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AnimatorDurationScalePreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnimatorDurationScalePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/AppsNotRespondingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AppsNotRespondingPreferenceControllerTest.java
index 8850df0..15c84b5 100644
--- a/tests/robotests/src/com/android/settings/development/AppsNotRespondingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AppsNotRespondingPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppsNotRespondingPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BackgroundProcessLimitPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BackgroundProcessLimitPreferenceControllerTest.java
index 67b2abe..b384cd0 100644
--- a/tests/robotests/src/com/android/settings/development/BackgroundProcessLimitPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BackgroundProcessLimitPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BackgroundProcessLimitPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAbsoluteVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAbsoluteVolumePreferenceControllerTest.java
index 652832f..09e6e9c 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAbsoluteVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAbsoluteVolumePreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class BluetoothAbsoluteVolumePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAudioBitsPerSamplePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAudioBitsPerSamplePreferenceControllerTest.java
index 586d626..fe0a41a 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAudioBitsPerSamplePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAudioBitsPerSamplePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothAudioBitsPerSamplePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAudioChannelModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAudioChannelModePreferenceControllerTest.java
index 2f51f1c..c4dcc19 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAudioChannelModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAudioChannelModePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothAudioChannelModePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAudioCodecPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAudioCodecPreferenceControllerTest.java
index 33cd3a1..29d8047 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAudioCodecPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAudioCodecPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothAudioCodecPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAudioQualityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAudioQualityPreferenceControllerTest.java
index 20593dc..e76f1d0 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAudioQualityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAudioQualityPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothAudioQualityPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAudioSampleRatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAudioSampleRatePreferenceControllerTest.java
index 95f07c2..4c113b1 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAudioSampleRatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAudioSampleRatePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothAudioSampleRatePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceControllerTest.java
index 3f993e5..07d0e50 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class BluetoothAvrcpVersionPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothDeviceNoNamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothDeviceNoNamePreferenceControllerTest.java
index 0bc527a..4e4d8fa 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothDeviceNoNamePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothDeviceNoNamePreferenceControllerTest.java
@@ -42,7 +42,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class BluetoothDeviceNoNamePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothInbandRingingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothInbandRingingPreferenceControllerTest.java
index d132224..4074e25 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothInbandRingingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothInbandRingingPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class BluetoothInbandRingingPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothSnoopLogPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothSnoopLogPreferenceControllerTest.java
index 7d29637..4fa991b 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothSnoopLogPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothSnoopLogPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class BluetoothSnoopLogPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
index bce9b0d..82086dd 100644
--- a/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
@@ -51,7 +51,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BugReportInPowerPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
index 77a109a..908c519 100644
--- a/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BugReportPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
index 21a01aa..1443d16 100644
--- a/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class CameraLaserSensorPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ClearAdbKeysPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ClearAdbKeysPreferenceControllerTest.java
index 471bf27..c4be569 100644
--- a/tests/robotests/src/com/android/settings/development/ClearAdbKeysPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ClearAdbKeysPreferenceControllerTest.java
@@ -54,7 +54,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class, ShadowUtils.class})
 public class ClearAdbKeysPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
index bb974f4..5e99ec9 100644
--- a/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows =
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows =
         SettingsShadowSystemProperties.class)
 public class ConnectivityMonitorPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/CoolColorTemperaturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/CoolColorTemperaturePreferenceControllerTest.java
index 6e85ca6..1362212 100644
--- a/tests/robotests/src/com/android/settings/development/CoolColorTemperaturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/CoolColorTemperaturePreferenceControllerTest.java
@@ -21,7 +21,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -45,7 +44,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class CoolColorTemperaturePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/DebugGpuOverdrawPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/DebugGpuOverdrawPreferenceControllerTest.java
index 7aa34ca..2a35993 100644
--- a/tests/robotests/src/com/android/settings/development/DebugGpuOverdrawPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/DebugGpuOverdrawPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class DebugGpuOverdrawPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/DebugNonRectClipOperationsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/DebugNonRectClipOperationsPreferenceControllerTest.java
index 877f7fb..585fe51 100644
--- a/tests/robotests/src/com/android/settings/development/DebugNonRectClipOperationsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/DebugNonRectClipOperationsPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class DebugNonRectClipOperationsPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/DebugViewAttributesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/DebugViewAttributesPreferenceControllerTest.java
index 6256ddb..76efa90 100644
--- a/tests/robotests/src/com/android/settings/development/DebugViewAttributesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/DebugViewAttributesPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DebugViewAttributesPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
index 43e389a..881ee84 100644
--- a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DevelopmentSettingsDashboardFragmentTest {
 
     private SwitchBar mSwitchBar;
diff --git a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDisabledActivityTest.java b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDisabledActivityTest.java
index aa9a3a3..5927646 100644
--- a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDisabledActivityTest.java
+++ b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDisabledActivityTest.java
@@ -31,7 +31,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DevelopmentSettingsDisabledActivityTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/development/DevelopmentSwitchBarControllerTest.java b/tests/robotests/src/com/android/settings/development/DevelopmentSwitchBarControllerTest.java
index f34bedf..bfe30fb 100644
--- a/tests/robotests/src/com/android/settings/development/DevelopmentSwitchBarControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/DevelopmentSwitchBarControllerTest.java
@@ -44,7 +44,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUtils.class
         })
diff --git a/tests/robotests/src/com/android/settings/development/DisableAutomaticUpdatesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/DisableAutomaticUpdatesPreferenceControllerTest.java
index d1e2fd9..b4e0755 100644
--- a/tests/robotests/src/com/android/settings/development/DisableAutomaticUpdatesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/DisableAutomaticUpdatesPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DisableAutomaticUpdatesPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/EnableGpuDebugLayersPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/EnableGpuDebugLayersPreferenceControllerTest.java
index 4f4d4af..9cc5f61 100644
--- a/tests/robotests/src/com/android/settings/development/EnableGpuDebugLayersPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/EnableGpuDebugLayersPreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EnableGpuDebugLayersPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
index f94213f..1810b11 100644
--- a/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
@@ -51,7 +51,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class FileEncryptionPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ForceGpuRenderingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ForceGpuRenderingPreferenceControllerTest.java
index e81b422..66060a8 100644
--- a/tests/robotests/src/com/android/settings/development/ForceGpuRenderingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ForceGpuRenderingPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class ForceGpuRenderingPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ForceMSAAPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ForceMSAAPreferenceControllerTest.java
index 5aaadb4..ca1ff08 100644
--- a/tests/robotests/src/com/android/settings/development/ForceMSAAPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ForceMSAAPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class ForceMSAAPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/FreeformWindowsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/FreeformWindowsPreferenceControllerTest.java
index 43757d0..b4a4212 100644
--- a/tests/robotests/src/com/android/settings/development/FreeformWindowsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/FreeformWindowsPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FreeformWindowsPreferenceControllerTest {
 
     private static final String ENG_BUILD_TYPE = "eng";
diff --git a/tests/robotests/src/com/android/settings/development/GpuViewUpdatesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/GpuViewUpdatesPreferenceControllerTest.java
index 028c29e..ecb0da5 100644
--- a/tests/robotests/src/com/android/settings/development/GpuViewUpdatesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/GpuViewUpdatesPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class GpuViewUpdatesPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/HardwareLayersUpdatesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/HardwareLayersUpdatesPreferenceControllerTest.java
index e7c984b..9288df9 100644
--- a/tests/robotests/src/com/android/settings/development/HardwareLayersUpdatesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/HardwareLayersUpdatesPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class HardwareLayersUpdatesPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/HardwareOverlaysPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/HardwareOverlaysPreferenceControllerTest.java
index 31e910e..09e48d3 100644
--- a/tests/robotests/src/com/android/settings/development/HardwareOverlaysPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/HardwareOverlaysPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class HardwareOverlaysPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/HdcpCheckingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/HdcpCheckingPreferenceControllerTest.java
index a85075b..434941c 100644
--- a/tests/robotests/src/com/android/settings/development/HdcpCheckingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/HdcpCheckingPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class HdcpCheckingPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/KeepActivitiesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/KeepActivitiesPreferenceControllerTest.java
index 9736365..02a5df6 100644
--- a/tests/robotests/src/com/android/settings/development/KeepActivitiesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/KeepActivitiesPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class KeepActivitiesPreferenceControllerTest {
 
     private static final int SETTING_VALUE_ON = 1;
diff --git a/tests/robotests/src/com/android/settings/development/LocalBackupPasswordPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/LocalBackupPasswordPreferenceControllerTest.java
index 24b0290..c698313 100644
--- a/tests/robotests/src/com/android/settings/development/LocalBackupPasswordPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/LocalBackupPasswordPreferenceControllerTest.java
@@ -28,7 +28,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocalBackupPasswordPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/LocalTerminalPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/LocalTerminalPreferenceControllerTest.java
index 66e7ccd..bd33319 100644
--- a/tests/robotests/src/com/android/settings/development/LocalTerminalPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/LocalTerminalPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocalTerminalPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
index b567dbe..1dc1255 100644
--- a/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class LogPersistPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
index ec0f492..f7be653 100644
--- a/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
@@ -39,7 +39,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class LogdSizePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/MemoryUsagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/MemoryUsagePreferenceControllerTest.java
index a769344..d68f276 100644
--- a/tests/robotests/src/com/android/settings/development/MemoryUsagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/MemoryUsagePreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MemoryUsagePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/MobileDataAlwaysOnPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/MobileDataAlwaysOnPreferenceControllerTest.java
index 7f33630..01ed435 100644
--- a/tests/robotests/src/com/android/settings/development/MobileDataAlwaysOnPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/MobileDataAlwaysOnPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MobileDataAlwaysOnPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/MockLocationAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/MockLocationAppPreferenceControllerTest.java
index e136fc0..0aab0db 100644
--- a/tests/robotests/src/com/android/settings/development/MockLocationAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/MockLocationAppPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MockLocationAppPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java
index f471f35..5ad0329 100644
--- a/tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationChannelWarningsPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/OemUnlockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/OemUnlockPreferenceControllerTest.java
index 5018b75..c25faa9 100644
--- a/tests/robotests/src/com/android/settings/development/OemUnlockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/OemUnlockPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class OemUnlockPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/PictureColorModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/PictureColorModePreferenceControllerTest.java
index ff5ffd3..fac74ac 100644
--- a/tests/robotests/src/com/android/settings/development/PictureColorModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/PictureColorModePreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PictureColorModePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/PointerLocationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/PointerLocationPreferenceControllerTest.java
index 120e4a4..6a6cd2c 100644
--- a/tests/robotests/src/com/android/settings/development/PointerLocationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/PointerLocationPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PointerLocationPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/ProfileGpuRenderingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ProfileGpuRenderingPreferenceControllerTest.java
index d6c6185..8175110 100644
--- a/tests/robotests/src/com/android/settings/development/ProfileGpuRenderingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ProfileGpuRenderingPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class ProfileGpuRenderingPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ResizableActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ResizableActivityPreferenceControllerTest.java
index 3d6bd16..1289aec 100644
--- a/tests/robotests/src/com/android/settings/development/ResizableActivityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ResizableActivityPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ResizableActivityPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/RtlLayoutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/RtlLayoutPreferenceControllerTest.java
index d607a27..808e2a7 100644
--- a/tests/robotests/src/com/android/settings/development/RtlLayoutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/RtlLayoutPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RtlLayoutPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/SecondaryDisplayPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/SecondaryDisplayPreferenceControllerTest.java
index d11c117..485e441 100644
--- a/tests/robotests/src/com/android/settings/development/SecondaryDisplayPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/SecondaryDisplayPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SecondaryDisplayPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/SelectDebugAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/SelectDebugAppPreferenceControllerTest.java
index 6c38cea..03f4972 100644
--- a/tests/robotests/src/com/android/settings/development/SelectDebugAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/SelectDebugAppPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SelectDebugAppPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/SelectUsbConfigPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/SelectUsbConfigPreferenceControllerTest.java
index bbbc52b..6b55984 100644
--- a/tests/robotests/src/com/android/settings/development/SelectUsbConfigPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/SelectUsbConfigPreferenceControllerTest.java
@@ -50,14 +50,13 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowUtils.class})
 public class SelectUsbConfigPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/SetGpuRendererPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/SetGpuRendererPreferenceControllerTest.java
index 9ad1540..7b3097b 100644
--- a/tests/robotests/src/com/android/settings/development/SetGpuRendererPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/SetGpuRendererPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class SetGpuRendererPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ShortcutManagerThrottlingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ShortcutManagerThrottlingPreferenceControllerTest.java
index 6654f9a..0a189cb 100644
--- a/tests/robotests/src/com/android/settings/development/ShortcutManagerThrottlingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ShortcutManagerThrottlingPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ShortcutManagerThrottlingPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/ShowLayoutBoundsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ShowLayoutBoundsPreferenceControllerTest.java
index 8320c97..2eb1070 100644
--- a/tests/robotests/src/com/android/settings/development/ShowLayoutBoundsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ShowLayoutBoundsPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class ShowLayoutBoundsPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/ShowSurfaceUpdatesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ShowSurfaceUpdatesPreferenceControllerTest.java
index 94af993..a5cfa22 100644
--- a/tests/robotests/src/com/android/settings/development/ShowSurfaceUpdatesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ShowSurfaceUpdatesPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ShowSurfaceUpdatesPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/ShowTapsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/ShowTapsPreferenceControllerTest.java
index d8fec93..40e2fbd 100644
--- a/tests/robotests/src/com/android/settings/development/ShowTapsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/ShowTapsPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ShowTapsPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/SimulateColorSpacePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/SimulateColorSpacePreferenceControllerTest.java
index 3570368..23c6e4c 100644
--- a/tests/robotests/src/com/android/settings/development/SimulateColorSpacePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/SimulateColorSpacePreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SimulateColorSpacePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/StayAwakePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/StayAwakePreferenceControllerTest.java
index 2dd0caf..41b9fde 100644
--- a/tests/robotests/src/com/android/settings/development/StayAwakePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/StayAwakePreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StayAwakePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/StrictModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/StrictModePreferenceControllerTest.java
index fdc841b..0f839c1 100644
--- a/tests/robotests/src/com/android/settings/development/StrictModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/StrictModePreferenceControllerTest.java
@@ -45,7 +45,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
 public class StrictModePreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/development/TetheringHardwareAccelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/TetheringHardwareAccelPreferenceControllerTest.java
index 43798c0..e044f2a 100644
--- a/tests/robotests/src/com/android/settings/development/TetheringHardwareAccelPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/TetheringHardwareAccelPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TetheringHardwareAccelPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/TransitionAnimationScalePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/TransitionAnimationScalePreferenceControllerTest.java
index 5da1abc..e8f9980 100644
--- a/tests/robotests/src/com/android/settings/development/TransitionAnimationScalePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/TransitionAnimationScalePreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TransitionAnimationScalePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/UsbAudioRoutingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/UsbAudioRoutingPreferenceControllerTest.java
index 644e7c9..4b7e82b 100644
--- a/tests/robotests/src/com/android/settings/development/UsbAudioRoutingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/UsbAudioRoutingPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsbAudioRoutingPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
index 4585b6d..e396ebe 100644
--- a/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
@@ -51,7 +51,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VerifyAppsOverUsbPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WaitForDebuggerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WaitForDebuggerPreferenceControllerTest.java
index 1d7f3f7..e1d96d1 100644
--- a/tests/robotests/src/com/android/settings/development/WaitForDebuggerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WaitForDebuggerPreferenceControllerTest.java
@@ -50,7 +50,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WaitForDebuggerPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
index 26331b1..59f6e35 100644
--- a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WebViewAppPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WifiAggressiveHandoverPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WifiAggressiveHandoverPreferenceControllerTest.java
index 57b6e1d..ebda837 100644
--- a/tests/robotests/src/com/android/settings/development/WifiAggressiveHandoverPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WifiAggressiveHandoverPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiAggressiveHandoverPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WifiDisplayCertificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WifiDisplayCertificationPreferenceControllerTest.java
index 9ca9b55d..c049bc1 100644
--- a/tests/robotests/src/com/android/settings/development/WifiDisplayCertificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WifiDisplayCertificationPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiDisplayCertificationPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WifiRoamScansPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WifiRoamScansPreferenceControllerTest.java
index a7a6608..60e5e49 100644
--- a/tests/robotests/src/com/android/settings/development/WifiRoamScansPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WifiRoamScansPreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiRoamScansPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/WifiVerboseLoggingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WifiVerboseLoggingPreferenceControllerTest.java
index 09a5e9c..f8a9b87 100644
--- a/tests/robotests/src/com/android/settings/development/WifiVerboseLoggingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WifiVerboseLoggingPreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiVerboseLoggingPreferenceControllerTest {
     @Mock
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/development/WindowAnimationScalePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WindowAnimationScalePreferenceControllerTest.java
index c7e2258..0fbff3b 100644
--- a/tests/robotests/src/com/android/settings/development/WindowAnimationScalePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WindowAnimationScalePreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WindowAnimationScalePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceControllerTest.java
index fabf3b6..e505d03 100644
--- a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FeatureFlagPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceTest.java b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceTest.java
index 35ad7e1..11099b1 100644
--- a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagPreferenceTest.java
@@ -30,7 +30,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FeatureFlagPreferenceTest {
 
     private static final String KEY = "feature_key";
diff --git a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagsDashboardTest.java b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagsDashboardTest.java
index 1fd07c3..0839a02 100644
--- a/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagsDashboardTest.java
+++ b/tests/robotests/src/com/android/settings/development/featureflags/FeatureFlagsDashboardTest.java
@@ -29,7 +29,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FeatureFlagsDashboardTest {
 
     private FeatureFlagsDashboard mDashboard;
diff --git a/tests/robotests/src/com/android/settings/development/qstile/DevelopmentTilePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/qstile/DevelopmentTilePreferenceControllerTest.java
index e4c479e..1cdff20 100644
--- a/tests/robotests/src/com/android/settings/development/qstile/DevelopmentTilePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/qstile/DevelopmentTilePreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.shadows.ShadowPackageManager;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DevelopmentTilePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/BatteryInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/BatteryInfoPreferenceControllerTest.java
index 5587f4b..0ccc139 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/BatteryInfoPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/BatteryInfoPreferenceControllerTest.java
@@ -50,7 +50,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryInfoPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/BuildNumberPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/BuildNumberPreferenceControllerTest.java
index 66d397e..ab68c17 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/BuildNumberPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/BuildNumberPreferenceControllerTest.java
@@ -57,7 +57,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUtils.class
         })
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java
index c344df3..1c8bde1 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java
@@ -20,7 +20,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -44,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DeviceModelPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/FccEquipmentIdPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/FccEquipmentIdPreferenceControllerTest.java
index c77a279..951d8c7 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/FccEquipmentIdPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/FccEquipmentIdPreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FccEquipmentIdPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/FeedbackPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/FeedbackPreferenceControllerTest.java
index 293127c..dfc1a0c 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/FeedbackPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/FeedbackPreferenceControllerTest.java
@@ -34,7 +34,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FeedbackPreferenceControllerTest {
     @Mock
     private Fragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java b/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java
index e56a2b2..15461cc2 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class HardwareInfoDialogFragmentTest {
 
     private Activity mActivity;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/KernelVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/KernelVersionPreferenceControllerTest.java
index a889e9b..10e4958 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/KernelVersionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/KernelVersionPreferenceControllerTest.java
@@ -30,7 +30,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class KernelVersionPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/ManualPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/ManualPreferenceControllerTest.java
index 916c45d..6151ca0 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/ManualPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/ManualPreferenceControllerTest.java
@@ -34,7 +34,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ManualPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
index 37c814a..f30425b 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PhoneNumberPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/PrivateVolumeOptionMenuControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/PrivateVolumeOptionMenuControllerTest.java
index 866b53d..6363317 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/PrivateVolumeOptionMenuControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/PrivateVolumeOptionMenuControllerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PrivateVolumeOptionMenuControllerTest {
     @Mock
     private MenuItem mMigrateMenuItem;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceControllerTest.java
index 99a835f..4ea33ee 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RegulatoryInfoPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
index 8ad91cd..b1296e5 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StorageDashboardFragmentTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private StorageManager mStorageManager;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/StorageItemPreferenceTest.java b/tests/robotests/src/com/android/settings/deviceinfo/StorageItemPreferenceTest.java
index cec1887..5b34c7d 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/StorageItemPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/StorageItemPreferenceTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StorageItemPreferenceTest {
     private Context mContext;
     private StorageItemPreference mPreference;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/StorageProfileFragmentTest.java b/tests/robotests/src/com/android/settings/deviceinfo/StorageProfileFragmentTest.java
index 80aebab..b0f464c 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/StorageProfileFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/StorageProfileFragmentTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StorageProfileFragmentTest {
     @Captor
     private ArgumentCaptor<SparseArray<StorageAsyncLoader.AppsStorageResult>> mCaptor;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/StorageSettingsTest.java b/tests/robotests/src/com/android/settings/deviceinfo/StorageSettingsTest.java
index cc8b31d..5e95a61 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/StorageSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/StorageSettingsTest.java
@@ -48,7 +48,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StorageSettingsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/SystemUpdatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/SystemUpdatePreferenceControllerTest.java
index 32bcd60..05670e2 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/SystemUpdatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/SystemUpdatePreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SystemUpdatePreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/UsbBackendTest.java b/tests/robotests/src/com/android/settings/deviceinfo/UsbBackendTest.java
index 5939174..ce384a5 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/UsbBackendTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/UsbBackendTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsbBackendTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/UsbModeChooserActivityTest.java b/tests/robotests/src/com/android/settings/deviceinfo/UsbModeChooserActivityTest.java
index 34246b4..1817bfb 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/UsbModeChooserActivityTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/UsbModeChooserActivityTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsbModeChooserActivityTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java
index 0584a53..55594c2 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java
@@ -47,7 +47,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowConnectivityManager.class, SettingsShadowSystemProperties.class})
 public class BasebandVersionDialogControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java
index 8bdf84c..54e7e86 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BuildNumberDialogControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java
index 00d1386..a416662 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FirmwareVersionDialogControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerV2Test.java
index d27d880..5fa8a91 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerV2Test.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FirmwareVersionPreferenceControllerV2Test {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java
index 0dfedf4..493cb84 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class KernelVersionDialogControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java
index ea37c2e..387450b 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java
@@ -49,7 +49,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SecurityPatchLevelDialogControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java
index fd7089e..03ee9f8 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java
@@ -49,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ImeiInfoDialogControllerTest {
 
     private static final String PRL_VERSION = "some_prl_version";
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceControllerV2Test.java
index f077386..186d9b7 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceControllerV2Test.java
@@ -23,7 +23,6 @@
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -50,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ImeiInfoPreferenceControllerV2Test {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
index 3eb4955..fd48162 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
@@ -68,7 +68,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SimStatusDialogControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceControllerV2Test.java
index ec6b0be..8e9cb0b 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceControllerV2Test.java
@@ -20,7 +20,6 @@
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -34,7 +33,6 @@
 
 import com.android.settings.R;
 import com.android.settings.TestConfig;
-import com.android.settings.deviceinfo.imei.ImeiInfoPreferenceControllerV2;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 import org.junit.Before;
@@ -48,7 +46,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SimStatusPreferenceControllerV2Test {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceControllerTest.java
index 23d42da..90ce395 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceControllerTest.java
@@ -60,7 +60,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class}
 )
 public class AutomaticStorageManagementSwitchPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelperTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelperTest.java
index 7b3556f..68fff54 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelperTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelperTest.java
@@ -55,7 +55,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CachedStorageValuesHelperTest {
     private Context mContext;
 
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
index 804c6dc..800097d 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
@@ -27,8 +27,6 @@
 
 import android.content.Context;
 import android.content.pm.UserInfo;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.graphics.drawable.Drawable;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceGroup;
@@ -38,7 +36,6 @@
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.wrapper.UserManagerWrapper;
-import com.android.settingslib.R;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.drawable.UserIconDrawable;
@@ -56,7 +53,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SecondaryUserControllerTest {
     private static final String TEST_NAME = "Fred";
     private static final String TARGET_PREFERENCE_GROUP_KEY = "pref_secondary_users";
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
index 4828769..b20823b 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
@@ -63,7 +63,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -71,7 +70,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StorageItemPreferenceControllerTest {
     private Context mContext;
     private VolumeInfo mVolume;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreferenceControllerTest.java
index b9a4963..6ad37ce 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreferenceControllerTest.java
@@ -55,7 +55,7 @@
 import java.io.File;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
index 98e796e..5276df9 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
@@ -27,8 +27,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.UserInfo;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.graphics.drawable.Drawable;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
@@ -40,7 +38,6 @@
 import com.android.settings.TestConfig;
 import com.android.settings.deviceinfo.StorageProfileFragment;
 import com.android.settings.wrapper.UserManagerWrapper;
-import com.android.settingslib.R;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.drawable.UserIconDrawable;
 
@@ -54,7 +51,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserProfileControllerTest {
     private static final String TEST_NAME = "Fred";
 
diff --git a/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java
index d1d479a..db99472 100644
--- a/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowSecureSettings.class})
 public class AmbientDisplayAlwaysOnPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceControllerTest.java
index d442c82..e1ce694 100644
--- a/tests/robotests/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowSecureSettings.class})
 public class AmbientDisplayNotificationsPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/display/AmbientDisplayPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AmbientDisplayPreferenceControllerTest.java
index 123dd85..2933517 100644
--- a/tests/robotests/src/com/android/settings/display/AmbientDisplayPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AmbientDisplayPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowSecureSettings.class})
 public class AmbientDisplayPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/display/AppGridViewTest.java b/tests/robotests/src/com/android/settings/display/AppGridViewTest.java
index a2cc76d..f7ed825 100644
--- a/tests/robotests/src/com/android/settings/display/AppGridViewTest.java
+++ b/tests/robotests/src/com/android/settings/display/AppGridViewTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppGridViewTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/display/AutoBrightnessPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AutoBrightnessPreferenceControllerTest.java
index 4acf609..36f754b 100644
--- a/tests/robotests/src/com/android/settings/display/AutoBrightnessPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AutoBrightnessPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AutoBrightnessPreferenceControllerTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
index e193b94..f3a1edd 100644
--- a/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
@@ -47,7 +47,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = ShadowSystemSettings.class
 )
 public class AutoRotatePreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/display/BatteryPercentagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/BatteryPercentagePreferenceControllerTest.java
index 655cf51..73c5374 100644
--- a/tests/robotests/src/com/android/settings/display/BatteryPercentagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/BatteryPercentagePreferenceControllerTest.java
@@ -31,7 +31,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryPercentagePreferenceControllerTest {
     @Mock private Context mContext;
     private BatteryPercentagePreferenceController mController;
diff --git a/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
index f8999b5..95144bd 100644
--- a/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.shadows.ShadowContentResolver;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BrightnessLevelPreferenceControllerTest {
     @Mock
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
index dc9dc5b..dc3d27a 100644
--- a/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
@@ -46,7 +46,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ColorModePreferenceFragmentTest {
 
     private ColorModePreferenceFragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/display/NightDisplaySettingsTest.java b/tests/robotests/src/com/android/settings/display/NightDisplaySettingsTest.java
index 113e7ec..62f2c67 100644
--- a/tests/robotests/src/com/android/settings/display/NightDisplaySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/display/NightDisplaySettingsTest.java
@@ -34,7 +34,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NightDisplaySettingsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/display/ShowOperatorNamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/ShowOperatorNamePreferenceControllerTest.java
index 4d701ca..23b43d6 100644
--- a/tests/robotests/src/com/android/settings/display/ShowOperatorNamePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/ShowOperatorNamePreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ShowOperatorNamePreferenceControllerTest {
 
     private static final String KEY_SHOW_OPERATOR_NAME = "show_operator_name";
diff --git a/tests/robotests/src/com/android/settings/display/ThemePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/ThemePreferenceControllerTest.java
index 751fa40..4e69b04 100644
--- a/tests/robotests/src/com/android/settings/display/ThemePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/ThemePreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ThemePreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/display/TimeoutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/TimeoutPreferenceControllerTest.java
index 48997c3..480e41f 100644
--- a/tests/robotests/src/com/android/settings/display/TimeoutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/TimeoutPreferenceControllerTest.java
@@ -33,7 +33,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TimeoutPreferenceControllerTest {
     private static final int TIMEOUT = 30;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/display/VrDisplayPreferencePickerTest.java b/tests/robotests/src/com/android/settings/display/VrDisplayPreferencePickerTest.java
index f874007..191a8fb 100644
--- a/tests/robotests/src/com/android/settings/display/VrDisplayPreferencePickerTest.java
+++ b/tests/robotests/src/com/android/settings/display/VrDisplayPreferencePickerTest.java
@@ -39,7 +39,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VrDisplayPreferencePickerTest {
 
     private VrDisplayPreferencePicker mPicker;
diff --git a/tests/robotests/src/com/android/settings/display/WallpaperPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/WallpaperPreferenceControllerTest.java
index 17d12c0..1419ad5 100644
--- a/tests/robotests/src/com/android/settings/display/WallpaperPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/WallpaperPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WallpaperPreferenceControllerTest {
 
     private static final String WALLPAPER_PACKAGE = "TestPkg";
diff --git a/tests/robotests/src/com/android/settings/dream/CurrentDreamPickerTest.java b/tests/robotests/src/com/android/settings/dream/CurrentDreamPickerTest.java
index 93403fe..68a5dc4 100644
--- a/tests/robotests/src/com/android/settings/dream/CurrentDreamPickerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/CurrentDreamPickerTest.java
@@ -45,7 +45,7 @@
 import java.util.Arrays;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CurrentDreamPickerTest {
     private static String COMPONENT_KEY = "mocked_component_name_string";
 
diff --git a/tests/robotests/src/com/android/settings/dream/CurrentDreamPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/dream/CurrentDreamPreferenceControllerTest.java
index b0ef640..e3493a1 100644
--- a/tests/robotests/src/com/android/settings/dream/CurrentDreamPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/CurrentDreamPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CurrentDreamPreferenceControllerTest {
     private static String TAG = "CurrentDreamPreferenceControllerTest";
 
diff --git a/tests/robotests/src/com/android/settings/dream/DreamSettingsTest.java b/tests/robotests/src/com/android/settings/dream/DreamSettingsTest.java
index ba3aab5..73526e5 100644
--- a/tests/robotests/src/com/android/settings/dream/DreamSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/dream/DreamSettingsTest.java
@@ -33,7 +33,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DreamSettingsTest {
     private static final List<String> KEYS = Arrays.asList(
             DreamSettings.WHILE_CHARGING_ONLY,
diff --git a/tests/robotests/src/com/android/settings/dream/StartNowPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/dream/StartNowPreferenceControllerTest.java
index 7e310c3..444591a 100644
--- a/tests/robotests/src/com/android/settings/dream/StartNowPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/StartNowPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StartNowPreferenceControllerTest {
     private StartNowPreferenceController mController;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/dream/WhenToDreamPickerTest.java b/tests/robotests/src/com/android/settings/dream/WhenToDreamPickerTest.java
index 94d6853..51a486f 100644
--- a/tests/robotests/src/com/android/settings/dream/WhenToDreamPickerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/WhenToDreamPickerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WhenToDreamPickerTest {
     private WhenToDreamPicker mPicker;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
index 4763f29..2acf82b 100644
--- a/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WhenToDreamPreferenceControllerTest {
     private WhenToDreamPreferenceController mController;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/enterprise/AdminActionPreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/enterprise/AdminActionPreferenceControllerBaseTest.java
index 24a96b1..111e503 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AdminActionPreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AdminActionPreferenceControllerBaseTest.java
@@ -31,7 +31,7 @@
  * Tests for {@link AdminActionPreferenceControllerBase}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AdminActionPreferenceControllerBaseTest extends
         AdminActionPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedCameraPermissionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedCameraPermissionPreferenceControllerTest.java
index b003ad8..1154aa7 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedCameraPermissionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedCameraPermissionPreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link AdminGrantedCameraPermissionPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AdminGrantedCameraPermissionPreferenceControllerTest extends
         AdminGrantedPermissionsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedLocationPermissionsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedLocationPermissionsPreferenceControllerTest.java
index 2fb3e21..1c30da1 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedLocationPermissionsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedLocationPermissionsPreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link AdminGrantedLocationPermissionsPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AdminGrantedLocationPermissionsPreferenceControllerTest extends
         AdminGrantedPermissionsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedMicrophonePermissionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedMicrophonePermissionPreferenceControllerTest.java
index 9ee8100..624022b 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedMicrophonePermissionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedMicrophonePermissionPreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link AdminGrantedMicrophonePermissionPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AdminGrantedMicrophonePermissionPreferenceControllerTest extends
         AdminGrantedPermissionsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedPermissionsPreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedPermissionsPreferenceControllerBaseTest.java
index 918c5fb..a5d1d1a 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AdminGrantedPermissionsPreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AdminGrantedPermissionsPreferenceControllerBaseTest.java
@@ -26,7 +26,7 @@
  * Tests for {@link AdminGrantedPermissionsPreferenceControllerBase}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AdminGrantedPermissionsPreferenceControllerBaseTest extends
         AdminGrantedPermissionsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceControllerTest.java
index 3c6b4c0..73e0fca 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceControllerTest.java
@@ -39,7 +39,7 @@
  * Tests for {@link AlwaysOnVpnCurrentUserPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AlwaysOnVpnCurrentUserPreferenceControllerTest {
 
     private static final String VPN_SET_DEVICE = "VPN set";
diff --git a/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnManagedProfilePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnManagedProfilePreferenceControllerTest.java
index 662b984..6b59f8f 100644
--- a/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnManagedProfilePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/AlwaysOnVpnManagedProfilePreferenceControllerTest.java
@@ -38,7 +38,7 @@
  * Tests for {@link AlwaysOnVpnManagedProfilePreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class AlwaysOnVpnManagedProfilePreferenceControllerTest {
 
     private static final String KEY_ALWAYS_ON_VPN_MANAGED_PROFILE = "always_on_vpn_managed_profile";
diff --git a/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java b/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
index fce2719..80d4aaf 100644
--- a/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
@@ -46,7 +46,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ApplicationListFragmentTest {
     private static final int USER_ID = 0;
     private static final int USER_APP_UID = 0;
diff --git a/tests/robotests/src/com/android/settings/enterprise/ApplicationListPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/ApplicationListPreferenceControllerTest.java
index 963b2ce..04ef467 100644
--- a/tests/robotests/src/com/android/settings/enterprise/ApplicationListPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/ApplicationListPreferenceControllerTest.java
@@ -59,7 +59,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ApplicationListPreferenceControllerTest {
 
     private static final int MAIN_USER_ID = 0;
diff --git a/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
index cc1de27..0b97353 100644
--- a/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
@@ -32,7 +32,7 @@
  * Tests for {@link BugReportsPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class BugReportsPreferenceControllerTest extends
         AdminActionPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
index c933d18..5ee1145 100644
--- a/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
@@ -35,7 +35,7 @@
  * Tests for {@link CaCertsCurrentUserPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class CaCertsCurrentUserPreferenceControllerTest extends
         CaCertsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
index d246488..2aa5306 100644
--- a/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link CaCertsManagedProfilePreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class CaCertsManagedProfilePreferenceControllerTest extends
         CaCertsPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/CaCertsPreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/enterprise/CaCertsPreferenceControllerBaseTest.java
index 7a6bc88..ec76b2b 100644
--- a/tests/robotests/src/com/android/settings/enterprise/CaCertsPreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/CaCertsPreferenceControllerBaseTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link CaCertsPreferenceControllerBase}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CaCertsPreferenceControllerBaseTest extends CaCertsPreferenceControllerTestBase {
     private static final String PREF_KEY = "pref";
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterpriseInstalledPackagesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterpriseInstalledPackagesPreferenceControllerTest.java
index 19349a7..dbbf573 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterpriseInstalledPackagesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterpriseInstalledPackagesPreferenceControllerTest.java
@@ -45,7 +45,7 @@
  * Tests for {@link EnterpriseInstalledPackagesPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class EnterpriseInstalledPackagesPreferenceControllerTest {
 
     private static final String KEY_NUMBER_ENTERPRISE_INSTALLED_PACKAGES
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
index 516ccb5..1ea2567 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
@@ -57,7 +57,7 @@
  * Tests for {@link EnterprisePrivacyFeatureProviderImpl}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class EnterprisePrivacyFeatureProviderImplTest {
 
     private final ComponentName OWNER = new ComponentName("dummy", "component");
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyPreferenceControllerTest.java
index 8cbddb9..8a3fc15 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyPreferenceControllerTest.java
@@ -39,7 +39,7 @@
  * Tests for {@link EnterprisePrivacyPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class EnterprisePrivacyPreferenceControllerTest {
 
     private static final String MANAGED_GENERIC = "managed by organization";
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
index 845fd61..b38b0f0 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
@@ -44,7 +44,7 @@
  * Tests for {@link EnterprisePrivacySettings}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class EnterprisePrivacySettingsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
index c47a0ac..567c06f 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
@@ -42,7 +42,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EnterpriseSetDefaultAppsListFragmentTest {
     @Mock(answer = RETURNS_DEEP_STUBS)
     private PreferenceScreen mScreen;
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceControllerTest.java
index da26ba3..0c7996e 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceControllerTest.java
@@ -58,7 +58,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EnterpriseSetDefaultAppsListPreferenceControllerTest {
     private static final int USER_ID = 0;
     private static final int APP_UID = 0;
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsPreferenceControllerTest.java
index 9d980cc..0f64693 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsPreferenceControllerTest.java
@@ -52,7 +52,7 @@
  * Tests for {@link EnterpriseSetDefaultAppsPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class EnterpriseSetDefaultAppsPreferenceControllerTest {
 
     private static final String KEY_DEFAULT_APPS = "number_enterprise_set_default_apps";
diff --git a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeCurrentUserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeCurrentUserPreferenceControllerTest.java
index 77d6ea0..8453d62 100644
--- a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeCurrentUserPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeCurrentUserPreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link FailedPasswordWipeCurrentUserPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class FailedPasswordWipeCurrentUserPreferenceControllerTest extends
         FailedPasswordWipePreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeManagedProfilePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeManagedProfilePreferenceControllerTest.java
index c88c22b..a001a9c 100644
--- a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeManagedProfilePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipeManagedProfilePreferenceControllerTest.java
@@ -28,7 +28,7 @@
  * Tests for {@link FailedPasswordWipeManagedProfilePreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class FailedPasswordWipeManagedProfilePreferenceControllerTest extends
         FailedPasswordWipePreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipePreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipePreferenceControllerBaseTest.java
index ecc490f..f80667c 100644
--- a/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipePreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/FailedPasswordWipePreferenceControllerBaseTest.java
@@ -26,7 +26,7 @@
  * Tests for {@link FailedPasswordWipePreferenceControllerBase}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class FailedPasswordWipePreferenceControllerBaseTest extends
         FailedPasswordWipePreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
index 9bcda9a..6594f99 100644
--- a/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
@@ -38,7 +38,7 @@
  * Tests for {@link GlobalHttpProxyPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class GlobalHttpProxyPreferenceControllerTest {
 
     private static final String KEY_GLOBAL_HTTP_PROXY = "global_http_proxy";
diff --git a/tests/robotests/src/com/android/settings/enterprise/ImePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/ImePreferenceControllerTest.java
index a56d9d3..64bbd76 100644
--- a/tests/robotests/src/com/android/settings/enterprise/ImePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/ImePreferenceControllerTest.java
@@ -39,7 +39,7 @@
  * Tests for {@link ImePreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class ImePreferenceControllerTest {
 
     private static final String DEFAULT_IME_LABEL = "Test IME";
diff --git a/tests/robotests/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceControllerTest.java
index f656f10..5874984 100644
--- a/tests/robotests/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceControllerTest.java
@@ -39,7 +39,7 @@
  * Tests for {@link ManageDeviceAdminPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class ManageDeviceAdminPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/enterprise/NetworkLogsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/NetworkLogsPreferenceControllerTest.java
index e8f7398..43b793d 100644
--- a/tests/robotests/src/com/android/settings/enterprise/NetworkLogsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/NetworkLogsPreferenceControllerTest.java
@@ -32,7 +32,7 @@
  * Tests for {@link NetworkLogsPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class NetworkLogsPreferenceControllerTest extends
         AdminActionPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/enterprise/SecurityLogsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/SecurityLogsPreferenceControllerTest.java
index 7a597dc..11e219a 100644
--- a/tests/robotests/src/com/android/settings/enterprise/SecurityLogsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/SecurityLogsPreferenceControllerTest.java
@@ -32,7 +32,7 @@
  * Tests for {@link SecurityLogsPreferenceController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class SecurityLogsPreferenceControllerTest extends
         AdminActionPreferenceControllerTestBase {
 
diff --git a/tests/robotests/src/com/android/settings/fingerprint/DeleteFingerprintDialogTest.java b/tests/robotests/src/com/android/settings/fingerprint/DeleteFingerprintDialogTest.java
index 125977f..81947e8 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/DeleteFingerprintDialogTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/DeleteFingerprintDialogTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowEventLogWriter.class,
                 ShadowFragment.class
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollEnrollingTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollEnrollingTest.java
index 190d65d..c590fd3 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollEnrollingTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollEnrollingTest.java
@@ -57,7 +57,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUtils.class,
                 ShadowVibrator.class
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
index d479e1e..d495b74 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
@@ -55,7 +55,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollSuggestionActivityTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollSuggestionActivityTest.java
index 2856325..e299fd5 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollSuggestionActivityTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollSuggestionActivityTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FingerprintEnrollSuggestionActivityTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoViewTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoViewTest.java
index f80b324..7b7e440 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoViewTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoViewTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FingerprintLocationAnimationVideoViewTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintPreferenceTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintPreferenceTest.java
index 23e0e73..29c6f10 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintPreferenceTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FingerprintPreferenceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintSuggestionActivityTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintSuggestionActivityTest.java
index 0e4446f..0254bcb 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintSuggestionActivityTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintSuggestionActivityTest.java
@@ -50,7 +50,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowEventLogWriter.class,
                 ShadowLockPatternUtils.class,
diff --git a/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollFindSensorTest.java b/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollFindSensorTest.java
index f9d1994..c3899e9 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollFindSensorTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollFindSensorTest.java
@@ -47,7 +47,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollIntroductionTest.java b/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollIntroductionTest.java
index bf5c187..2d98bf4 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollIntroductionTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/SetupFingerprintEnrollIntroductionTest.java
@@ -60,7 +60,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowEventLogWriter.class,
                 ShadowFingerprintManager.class,
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
index 338373b..5dfeec3 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
@@ -77,7 +77,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowEntityHeaderController.class, ShadowActivityManager.class})
 public class AdvancedPowerUsageDetailTest {
     private static final String APP_LABEL = "app label";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AppButtonsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/AppButtonsPreferenceControllerTest.java
index acd9b97..e01f3e1 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/AppButtonsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/AppButtonsPreferenceControllerTest.java
@@ -66,7 +66,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppButtonsPreferenceControllerTest {
     private static final String PACKAGE_NAME = "com.android.settings";
     private static final String RESOURCE_STRING = "string";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java
index cb5914f..092f602 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java
@@ -58,7 +58,7 @@
 @RunWith(RobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryBroadcastReceiverTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryBroadcastReceiverTest.java
index 30b3448..a163a43 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryBroadcastReceiverTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryBroadcastReceiverTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryBroadcastReceiverTest {
     private static final String BATTERY_INIT_LEVEL = "100%";
     private static final String BATTERY_INIT_STATUS = "Not charging";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryEntryTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryEntryTest.java
index 04040ac..a57b6ca 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryEntryTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryEntryTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryEntryTest {
 
     private static final int APP_UID = 123;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
index e433b3c..9276424 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
@@ -59,7 +59,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResourcesImpl.class,
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHistoryPreferenceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHistoryPreferenceTest.java
index 60d06cd..933d673 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHistoryPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHistoryPreferenceTest.java
@@ -44,7 +44,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION
         ,
         shadows = {
                 SettingsShadowResources.class,
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoLoaderTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoLoaderTest.java
index ea0e6e5..305bd58 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoLoaderTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryInfoLoaderTest {
     private static final long TEST_TIME_REMAINING = 1000L;
 
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
index 4842b4e..70958a9 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
@@ -58,7 +58,7 @@
 import java.util.concurrent.TimeUnit;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryInfoTest {
 
     private static final String STATUS_FULL = "Full";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryMeterViewTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryMeterViewTest.java
index fba6a24..3a1fad0 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryMeterViewTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryMeterViewTest.java
@@ -39,7 +39,7 @@
 @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_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceControllerTest.java
index 8b8541a..77e3198 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 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";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverControllerTest.java
index eeca72f..c75a6a6 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatterySaverControllerTest {
     @Mock
     private MasterSwitchPreference mBatterySaverPref;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverReceiverTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverReceiverTest.java
index 944f755..259bcd2 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverReceiverTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverReceiverTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatterySaverReceiverTest {
     @Mock
     private BatterySaverReceiver.BatterySaverListener mBatterySaverListener;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverSettingsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverSettingsTest.java
index a7bcf53..0e32f6b 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatterySaverSettingsTest.java
@@ -35,7 +35,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatterySaverSettingsTest {
     private Context mContext;
     private BatterySaverSettings mBatterySaverSettings;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryStatsHelperLoaderTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryStatsHelperLoaderTest.java
index 5ba98f2..5f8d7cf 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryStatsHelperLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryStatsHelperLoaderTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryStatsHelperLoaderTest {
     @Mock
     private BatteryUtils mBatteryUtils;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
index 285ebc0..1393d57 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
@@ -67,7 +67,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BatteryUtilsTest {
     // unit that used to converted ms to us
     private static final long UNIT = 1000;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/ButtonActionDialogFragmentTest.java b/tests/robotests/src/com/android/settings/fuelgauge/ButtonActionDialogFragmentTest.java
index 468c160..dec445d 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/ButtonActionDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/ButtonActionDialogFragmentTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         ShadowEventLogWriter.class
 })
 public class ButtonActionDialogFragmentTest {
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/HighPowerDetailTest.java b/tests/robotests/src/com/android/settings/fuelgauge/HighPowerDetailTest.java
index 0b8832f..ca3fdd2 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/HighPowerDetailTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/HighPowerDetailTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class HighPowerDetailTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerGaugePreferenceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerGaugePreferenceTest.java
index e2f5fad..32f6a96 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerGaugePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerGaugePreferenceTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PowerGaugePreferenceTest {
     private static final String SUBTITLE = "Summary";
     private static final String CONTENT_DESCRIPTION = "Content description";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAdvancedTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAdvancedTest.java
index 2056262..2b5e704 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAdvancedTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAdvancedTest.java
@@ -63,7 +63,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PowerUsageAdvancedTest {
     private static final int FAKE_UID_1 = 50;
     private static final int FAKE_UID_2 = 100;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetailsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetailsTest.java
index c6040c0..c992d0a 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetailsTest.java
@@ -59,7 +59,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PowerUsageAnomalyDetailsTest {
     private static final String NAME_APP_1 = "app1";
     private static final String NAME_APP_2 = "app2";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
index df829aa..eb5d8cf 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
@@ -23,7 +23,6 @@
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 
-import android.app.Activity;
 import android.app.LoaderManager;
 import android.content.Context;
 import android.os.Bundle;
@@ -47,7 +46,7 @@
  * Unit tests for {@link PowerUsageBase}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowDashboardFragment.class)
 public class PowerUsageBaseTest {
     @Mock
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
index 6961b60..afda69f 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
@@ -33,7 +33,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 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;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
similarity index 98%
rename from tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
rename to tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
index 5ab7496..a317626 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
@@ -86,12 +86,12 @@
 // 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_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
         })
-public class PowerUsageSummaryTest {
+public class PowerUsageSummaryLegacyTest {
     private static final String[] PACKAGE_NAMES = {"com.app1", "com.app2"};
     private static final String STUB_STRING = "stub_string";
     private static final int UID = 123;
@@ -542,7 +542,7 @@
         verify(mBatteryHeaderPreferenceController, never()).quickUpdateHeaderPreference();
     }
 
-    public static class TestFragment extends PowerUsageSummary {
+    public static class TestFragment extends PowerUsageSummaryLegacy {
 
         private Context mContext;
         private boolean mStartActivityCalled;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicyTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicyTest.java
index 4ecd1dd..46db6b3 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicyTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicyTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnomalyDetectionPolicyTest {
     private static final String ANOMALY_DETECTION_CONSTANTS_VALUE =
             "anomaly_detection_enabled=true"
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDialogFragmentTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDialogFragmentTest.java
index eea2256..80d8e44 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDialogFragmentTest.java
@@ -49,7 +49,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowRuntimePermissionPresenter.class)
 public class AnomalyDialogFragmentTest {
     private static final String PACKAGE_NAME = "com.android.app";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyLoaderTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyLoaderTest.java
index 7193cca..469ad7c 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyLoaderTest.java
@@ -49,7 +49,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION
 )
 public class AnomalyLoaderTest {
     private static final String PACKAGE_NAME = "com.android.settings";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyPreferenceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyPreferenceTest.java
index 7061b8a..c0157ae 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyPreferenceTest.java
@@ -31,7 +31,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnomalyPreferenceTest {
     @Anomaly.AnomalyType
     private static final int ANOMALY_TYPE = Anomaly.AnomalyType.WAKE_LOCK;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalySummaryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalySummaryPreferenceControllerTest.java
index 1114e6a..d1d540d 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalySummaryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalySummaryPreferenceControllerTest.java
@@ -39,7 +39,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RuntimeEnvironment;
@@ -49,7 +48,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnomalySummaryPreferenceControllerTest {
     @Anomaly.AnomalyType
     private static final int ANOMALY_TYPE = Anomaly.AnomalyType.WAKE_LOCK;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyTest.java
index dae1141..13a5b31 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyTest.java
@@ -29,7 +29,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnomalyTest {
     private static int TYPE = Anomaly.AnomalyType.WAKE_LOCK;
     private static int UID = 111;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyUtilsTest.java
index d37d01e..38391c9 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyUtilsTest.java
@@ -45,7 +45,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         ShadowKeyValueListParserWrapperImpl.class})
 public class AnomalyUtilsTest {
     private static final String PACKAGE_NAME_WAKEUP = "com.android.app1";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/AnomalyActionTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/AnomalyActionTest.java
index 3f65a4c..4fc561d 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/AnomalyActionTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/AnomalyActionTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AnomalyActionTest {
     private static final String PACKAGE_NAME = "com.android.app";
     private static final int UID = 111;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/BackgroundCheckActionTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/BackgroundCheckActionTest.java
index 27f1b65..60d9984 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/BackgroundCheckActionTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/BackgroundCheckActionTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BackgroundCheckActionTest {
     private static final String PACKAGE_NAME = "com.android.app";
     private static final int UID = 111;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/ForceStopActionTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/ForceStopActionTest.java
index 351350a..48d3957 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/ForceStopActionTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/ForceStopActionTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ForceStopActionTest {
     private static final String PACKAGE_NAME = "com.android.app";
 
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/LocationCheckActionTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/LocationCheckActionTest.java
index 7b76261..964236b 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/LocationCheckActionTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/LocationCheckActionTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows =
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows =
         ShadowPermissionChecker.class)
 public class LocationCheckActionTest {
     private static final String PACKAGE_NAME = "com.android.app";
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/StopAndBackgroundActionTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/StopAndBackgroundActionTest.java
index 544b54e..e607bad 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/StopAndBackgroundActionTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/action/StopAndBackgroundActionTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StopAndBackgroundActionTest {
     private static final String PACKAGE_NAME = "com.android.app";
     private static final int UID = 111;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/BluetoothScanAnomalyDetectorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/BluetoothScanAnomalyDetectorTest.java
index b148ce9..edf026a 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/BluetoothScanAnomalyDetectorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/BluetoothScanAnomalyDetectorTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothScanAnomalyDetectorTest {
     private static final String TARGET_PACKAGE_NAME = "com.android.app";
     private static final int ANOMALY_UID = 111;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeLockAnomalyDetectorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeLockAnomalyDetectorTest.java
index 0991d89..d7682ea 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeLockAnomalyDetectorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeLockAnomalyDetectorTest.java
@@ -55,7 +55,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 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;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeupAlarmAnomalyDetectorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeupAlarmAnomalyDetectorTest.java
index f014f8d..dafcab3 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeupAlarmAnomalyDetectorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/anomaly/checker/WakeupAlarmAnomalyDetectorTest.java
@@ -25,7 +25,6 @@
 import static org.mockito.Mockito.spy;
 
 import android.content.Context;
-import android.content.pm.ApplicationInfo;
 import android.os.BatteryStats;
 import android.os.Build;
 import android.text.format.DateUtils;
@@ -56,7 +55,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WakeupAlarmAnomalyDetectorTest {
     private static final String TARGET_PACKAGE_NAME = "com.android.target";
     private static final String ANOMALY_PACKAGE_NAME = "com.android.anomaly";
diff --git a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsPreferenceControllerTest.java
index e2429c9..927133c 100644
--- a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsPreferenceControllerTest.java
@@ -43,9 +43,9 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
-        manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
-        shadows = ShadowSecureSettings.class
+    manifest = TestConfig.MANIFEST_PATH,
+    sdk = TestConfig.SDK_VERSION,
+    shadows = ShadowSecureSettings.class
 )
 public class AssistGestureSettingsPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
index 50cb611..a4a8873 100644
--- a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
@@ -39,7 +39,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AssistGestureSettingsTest {
 
     private FakeFeatureFactory mFakeFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
index 12ecc90..1f5ca20 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowResources.class
 })
 public class DoubleTapPowerPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java
index e322b07..b9635a7 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DoubleTapPowerSettingsTest {
 
     private DoubleTapPowerSettings mSettings;
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
index 72a77b0..8f06c40 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DoubleTapScreenPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java
index e29bf79..3d56d71 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DoubleTapScreenSettingsTest {
 
     private DoubleTapScreenSettings mSettings;
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java
index 081ff79..236896a 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DoubleTwistGestureSettingsTest {
 
     private DoubleTwistGestureSettings mSettings;
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
index b48889f..3fc6bcf 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
@@ -32,7 +32,6 @@
 import com.android.settings.TestConfig;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
-import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
 import com.android.settings.testutils.shadow.ShadowDoubleTwistPreferenceController;
 import com.android.settings.testutils.shadow.ShadowSecureSettings;
 
@@ -51,7 +50,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowResources.class
 })
 public class DoubleTwistPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/gestures/GesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/GesturePreferenceControllerTest.java
index df438c1..e7e1007 100644
--- a/tests/robotests/src/com/android/settings/gestures/GesturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/GesturePreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class GesturePreferenceControllerTest {
 
 
diff --git a/tests/robotests/src/com/android/settings/gestures/GesturesSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/GesturesSettingsPreferenceControllerTest.java
index f0e1063..d2333ba 100644
--- a/tests/robotests/src/com/android/settings/gestures/GesturesSettingsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/GesturesSettingsPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class GesturesSettingsPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/gestures/PickupGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/PickupGesturePreferenceControllerTest.java
index ffd4928..4e73ed6 100644
--- a/tests/robotests/src/com/android/settings/gestures/PickupGesturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/PickupGesturePreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowResources.class
 })
 public class PickupGesturePreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java
index 05c88ba..2c4a1c4 100644
--- a/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PickupGestureSettingsTest {
 
     private PickupGestureSettings mSettings;
diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
index f535a99..f3cc2ca 100644
--- a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SwipeToNotificationPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
index 7e3b90e..0b329d3 100644
--- a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
@@ -37,7 +37,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SwipeToNotificationSettingsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/graph/BottomLabelLayoutTest.java b/tests/robotests/src/com/android/settings/graph/BottomLabelLayoutTest.java
index eef6921..c9804d6 100644
--- a/tests/robotests/src/com/android/settings/graph/BottomLabelLayoutTest.java
+++ b/tests/robotests/src/com/android/settings/graph/BottomLabelLayoutTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BottomLabelLayoutTest {
     private BottomLabelLayout mBottomLabelLayout;
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/graph/UsageGraphTest.java b/tests/robotests/src/com/android/settings/graph/UsageGraphTest.java
index 4ab3381..fbd6fd4 100644
--- a/tests/robotests/src/com/android/settings/graph/UsageGraphTest.java
+++ b/tests/robotests/src/com/android/settings/graph/UsageGraphTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UsageGraphTest {
     private UsageGraph mGraph;
 
diff --git a/tests/robotests/src/com/android/settings/inputmethod/GameControllerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/GameControllerPreferenceControllerTest.java
index b8a63e4..2716fc3 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/GameControllerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/GameControllerPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class GameControllerPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
index 5684f17..8f9b2c5 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PhysicalKeyboardPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/inputmethod/SpellCheckerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/SpellCheckerPreferenceControllerTest.java
index 1991460..4457cc0 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/SpellCheckerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/SpellCheckerPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SpellCheckerPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryCursorLoaderTest.java b/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryCursorLoaderTest.java
index c21cc76..7b149f3 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryCursorLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryCursorLoaderTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.shadows.ShadowContentResolver;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserDictionaryCursorLoaderTest {
 
     private ContentProvider mContentProvider;
diff --git a/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryListTest.java b/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryListTest.java
index b220dd5..91fcaae 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryListTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/UserDictionaryListTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.shadows.ShadowContentResolver;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserDictionaryListTest {
 
     private FakeProvider mContentProvider;
diff --git a/tests/robotests/src/com/android/settings/inputmethod/VirtualKeyboardPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/VirtualKeyboardPreferenceControllerTest.java
index 5913f7e..fe2b0df 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/VirtualKeyboardPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/VirtualKeyboardPreferenceControllerTest.java
@@ -49,7 +49,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VirtualKeyboardPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java b/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
index da996e8..905d2d6 100644
--- a/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
@@ -64,7 +64,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LanguageAndInputSettingsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/language/PhoneLanguagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/language/PhoneLanguagePreferenceControllerTest.java
index 137bba4..6984e6a 100644
--- a/tests/robotests/src/com/android/settings/language/PhoneLanguagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/language/PhoneLanguagePreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PhoneLanguagePreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/language/TtsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/language/TtsPreferenceControllerTest.java
index 88a3bcb..15067c9 100644
--- a/tests/robotests/src/com/android/settings/language/TtsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/language/TtsPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TtsPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/language/UserDictionaryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/language/UserDictionaryPreferenceControllerTest.java
index fd6a9c4..0afa9d2 100644
--- a/tests/robotests/src/com/android/settings/language/UserDictionaryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/language/UserDictionaryPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import java.util.TreeSet;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserDictionaryPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java b/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
index 40a42b5..1ee52ca 100644
--- a/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
+++ b/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
@@ -33,7 +33,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = { ShadowSettingsPreferenceFragment.class })
 public class LocaleListEditorTest {
 
diff --git a/tests/robotests/src/com/android/settings/location/AppLocationPermissionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/AppLocationPermissionPreferenceControllerTest.java
index 61a9038..1b36a45 100644
--- a/tests/robotests/src/com/android/settings/location/AppLocationPermissionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/AppLocationPermissionPreferenceControllerTest.java
@@ -17,7 +17,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppLocationPermissionPreferenceControllerTest {
 
     private AppLocationPermissionPreferenceController mController;
diff --git a/tests/robotests/src/com/android/settings/location/BluetoothScanningPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/BluetoothScanningPreferenceControllerTest.java
index ffbf530..2384687 100644
--- a/tests/robotests/src/com/android/settings/location/BluetoothScanningPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/BluetoothScanningPreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BluetoothScanningPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/LocationEnablerTest.java b/tests/robotests/src/com/android/settings/location/LocationEnablerTest.java
index 01aadc2..25e491a 100644
--- a/tests/robotests/src/com/android/settings/location/LocationEnablerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationEnablerTest.java
@@ -56,7 +56,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationEnablerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/LocationForWorkPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationForWorkPreferenceControllerTest.java
index 86b9356..97fdb83 100644
--- a/tests/robotests/src/com/android/settings/location/LocationForWorkPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationForWorkPreferenceControllerTest.java
@@ -52,7 +52,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationForWorkPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/LocationModeBatterySavingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationModeBatterySavingPreferenceControllerTest.java
index 3529a7c..aa05cc6 100644
--- a/tests/robotests/src/com/android/settings/location/LocationModeBatterySavingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationModeBatterySavingPreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationModeBatterySavingPreferenceControllerTest {
 
     private Lifecycle mLifecycle;
diff --git a/tests/robotests/src/com/android/settings/location/LocationModeHighAccuracyPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationModeHighAccuracyPreferenceControllerTest.java
index 0608a68..fd1bb02 100644
--- a/tests/robotests/src/com/android/settings/location/LocationModeHighAccuracyPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationModeHighAccuracyPreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationModeHighAccuracyPreferenceControllerTest {
 
     private Lifecycle mLifecycle;
diff --git a/tests/robotests/src/com/android/settings/location/LocationModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationModePreferenceControllerTest.java
index b870d39..5383ed3 100644
--- a/tests/robotests/src/com/android/settings/location/LocationModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationModePreferenceControllerTest.java
@@ -15,6 +15,8 @@
  */
 package com.android.settings.location;
 
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
@@ -43,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationModePreferenceControllerTest {
 
     @Mock
@@ -73,6 +75,17 @@
     }
 
     @Test
+    @Config(qualifiers = "mcc999")
+    public void locationModePreference_ifXmlSetToFalse_shouldNotBeAvailable() {
+        assertFalse(mController.isAvailable());
+    }
+
+    @Test
+    public void locationModePreference_ifXmlSetToTrue_shouldBeAvailable() {
+        assertTrue(mController.isAvailable());
+    }
+
+    @Test
     public void onLocationModeChanged_locationOff_shouldDisablePreference() {
         when(mUserManager.hasUserRestriction(any())).thenReturn(false);
         mController.displayPreference(mScreen);
diff --git a/tests/robotests/src/com/android/settings/location/LocationModeRadioButtonPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationModeRadioButtonPreferenceControllerTest.java
index 69297dad..0c7ac41 100644
--- a/tests/robotests/src/com/android/settings/location/LocationModeRadioButtonPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationModeRadioButtonPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.RuntimeEnvironment;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationModeRadioButtonPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/LocationModeSensorsOnlyPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationModeSensorsOnlyPreferenceControllerTest.java
index 374e118..8561c97 100644
--- a/tests/robotests/src/com/android/settings/location/LocationModeSensorsOnlyPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationModeSensorsOnlyPreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationModeSensorsOnlyPreferenceControllerTest {
 
     private Lifecycle mLifecycle;
diff --git a/tests/robotests/src/com/android/settings/location/LocationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationPreferenceControllerTest.java
index 01ca899..fe45a93 100644
--- a/tests/robotests/src/com/android/settings/location/LocationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationPreferenceControllerTest.java
@@ -55,7 +55,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationPreferenceControllerTest {
     @Mock
     private Preference mPreference;
diff --git a/tests/robotests/src/com/android/settings/location/LocationServicePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationServicePreferenceControllerTest.java
index 46fba95..caf15f8 100644
--- a/tests/robotests/src/com/android/settings/location/LocationServicePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationServicePreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationServicePreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/location/LocationSwitchBarControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationSwitchBarControllerTest.java
index 9eb69a4..35c0f82 100644
--- a/tests/robotests/src/com/android/settings/location/LocationSwitchBarControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/LocationSwitchBarControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocationSwitchBarControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/RecentLocationRequestPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/RecentLocationRequestPreferenceControllerTest.java
index ed5374a..5d7cca4 100644
--- a/tests/robotests/src/com/android/settings/location/RecentLocationRequestPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/RecentLocationRequestPreferenceControllerTest.java
@@ -62,7 +62,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RecentLocationRequestPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/location/ScanningSettingsTest.java b/tests/robotests/src/com/android/settings/location/ScanningSettingsTest.java
index dff257b..27430a9 100644
--- a/tests/robotests/src/com/android/settings/location/ScanningSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/location/ScanningSettingsTest.java
@@ -34,7 +34,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ScanningSettingsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/location/WifiScanningPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/WifiScanningPreferenceControllerTest.java
index d8b6b75..75f7821 100644
--- a/tests/robotests/src/com/android/settings/location/WifiScanningPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/location/WifiScanningPreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiScanningPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java
index 4dd890d..d593b58 100644
--- a/tests/robotests/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java
@@ -53,7 +53,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = {ShadowRestrictedLockUtilsWrapper.class, ShadowConnectivityManager.class,
             ShadowUserManager.class}
 )
diff --git a/tests/robotests/src/com/android/settings/network/MobilePlanPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/MobilePlanPreferenceControllerTest.java
index 01d578f..a84179d 100644
--- a/tests/robotests/src/com/android/settings/network/MobilePlanPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/MobilePlanPreferenceControllerTest.java
@@ -30,7 +30,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MobilePlanPreferenceControllerTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
index 76ade7b..548d144 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
@@ -46,7 +46,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkDashboardFragmentTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/NetworkResetActionMenuControllerTest.java b/tests/robotests/src/com/android/settings/network/NetworkResetActionMenuControllerTest.java
index 087c0ff..896e802 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkResetActionMenuControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkResetActionMenuControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkResetActionMenuControllerTest {
 
     private static final int MENU_ID = Menu.FIRST;
diff --git a/tests/robotests/src/com/android/settings/network/NetworkResetPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/NetworkResetPreferenceControllerTest.java
index 5cbba61..4d8c626 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkResetPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkResetPreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkResetPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/NetworkResetRestrictionCheckerTest.java b/tests/robotests/src/com/android/settings/network/NetworkResetRestrictionCheckerTest.java
index 87bf812..792bdd3 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkResetRestrictionCheckerTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkResetRestrictionCheckerTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkResetRestrictionCheckerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/NetworkScorerPickerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/NetworkScorerPickerPreferenceControllerTest.java
index 5794820..7ed7f3f 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkScorerPickerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkScorerPickerPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkScorerPickerPreferenceControllerTest {
 
     private static final String TEST_SCORER_PACKAGE = "Test Package";
diff --git a/tests/robotests/src/com/android/settings/network/NetworkScorerPickerTest.java b/tests/robotests/src/com/android/settings/network/NetworkScorerPickerTest.java
index 773b311..7cfced8 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkScorerPickerTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkScorerPickerTest.java
@@ -48,7 +48,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NetworkScorerPickerTest {
 
     private static final String TEST_SCORER_PACKAGE_1 = "Test Package 1";
diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java
index 4e37d56..0be66e0 100644
--- a/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PrivateDnsMenuControllerTest {
     private static final int MENU_ID = 0;
 
diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java
index 2dcfdc8..f1d7a73 100644
--- a/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PrivateDnsModeDialogFragmentTest {
     private static final String HOST_NAME = "192.168.1.1";
     private static final String INVALID_HOST_NAME = "...,";
diff --git a/tests/robotests/src/com/android/settings/network/TetherPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/TetherPreferenceControllerTest.java
index 33fd36b..b8a6d28 100644
--- a/tests/robotests/src/com/android/settings/network/TetherPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/TetherPreferenceControllerTest.java
@@ -52,7 +52,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TetherPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/VpnPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/VpnPreferenceControllerTest.java
index 96a29c2..c35f1cf 100644
--- a/tests/robotests/src/com/android/settings/network/VpnPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/VpnPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.shadows.ShadowServiceManager;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VpnPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/network/WifiCallingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/WifiCallingPreferenceControllerTest.java
index 4d6a0be..4c2c03c 100644
--- a/tests/robotests/src/com/android/settings/network/WifiCallingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/WifiCallingPreferenceControllerTest.java
@@ -16,56 +16,59 @@
 
 package com.android.settings.network;
 
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Mockito.verify;
+
 import android.content.Context;
 import android.support.v7.preference.Preference;
-import android.telephony.CarrierConfigManager;
-import android.telephony.TelephonyManager;
 
 import com.android.ims.ImsManager;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.network.WifiCallingPreferenceControllerTest.ShadowImsManager;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH,
+        sdk = TestConfig.SDK_VERSION,
+        shadows = {ShadowImsManager.class})
 public class WifiCallingPreferenceControllerTest {
 
     @Mock
-    private Context mContext;
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private CarrierConfigManager mCarrierConfigManager;
-    @Mock
-    private TelephonyManager mTelephonyManager;
-    @Mock
     private Preference mPreference;
+
+    private Context mContext;
     private WifiCallingPreferenceController mController;
 
     @Before
     public void setUp() {
+        mContext = RuntimeEnvironment.application;
         MockitoAnnotations.initMocks(this);
-        when(mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE))
-                .thenReturn(mCarrierConfigManager);
-        when(mContext.getSystemService(Context.TELEPHONY_SERVICE))
-                .thenReturn(mTelephonyManager);
+
         mController = new WifiCallingPreferenceController(mContext);
     }
 
+    @After
+    public void teardown() {
+        ShadowImsManager.reset();
+    }
+
     @Test
     public void isAvailable_platformEnabledAndProvisioned_shouldReturnTrue() {
-        ImsManager.wfcEnabledByPlatform = true;
-        ImsManager.wfcProvisioned = true;
+        ShadowImsManager.wfcProvisioned = true;
+        ShadowImsManager.wfcEnabledByPlatform = true;
 
         assertThat(mController.isAvailable()).isTrue();
     }
@@ -76,4 +79,27 @@
 
         verify(mPreference).setSummary(anyInt());
     }
+
+    @Implements(ImsManager.class)
+    public static class ShadowImsManager {
+
+        public static boolean wfcEnabledByPlatform;
+        public static boolean wfcProvisioned;
+
+        public static void reset() {
+            wfcEnabledByPlatform = false;
+            wfcProvisioned = false;
+        }
+
+        @Implementation
+        public static boolean isWfcEnabledByPlatform(Context context) {
+            return wfcEnabledByPlatform;
+        }
+
+        @Implementation
+        public static boolean isWfcProvisionedOnDevice(Context context) {
+            return wfcProvisioned;
+        }
+    }
+
 }
diff --git a/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java b/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
index d4c74ed..a82daf3 100644
--- a/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
@@ -36,7 +36,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PaymentSettingsTest {
     @Mock
     Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/AdjustVolumeRestrictedPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AdjustVolumeRestrictedPreferenceControllerTest.java
index cc27649..d33d734 100644
--- a/tests/robotests/src/com/android/settings/notification/AdjustVolumeRestrictedPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/AdjustVolumeRestrictedPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AdjustVolumeRestrictedPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/AlarmRingtonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AlarmRingtonePreferenceControllerTest.java
index 85a3027..f4bd522 100644
--- a/tests/robotests/src/com/android/settings/notification/AlarmRingtonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/AlarmRingtonePreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AlarmRingtonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/AlarmVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AlarmVolumePreferenceControllerTest.java
index f070421..7b0b033 100644
--- a/tests/robotests/src/com/android/settings/notification/AlarmVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/AlarmVolumePreferenceControllerTest.java
@@ -33,7 +33,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AlarmVolumePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java
index c14e4aa..cd80986 100644
--- a/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java
@@ -36,7 +36,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
@@ -57,7 +56,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AllowSoundPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/AppLinkPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AppLinkPreferenceControllerTest.java
index 7198993..f5f1a31 100644
--- a/tests/robotests/src/com/android/settings/notification/AppLinkPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/AppLinkPreferenceControllerTest.java
@@ -32,7 +32,6 @@
 import android.app.NotificationManager;
 import android.content.Context;
 import android.content.Intent;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 
@@ -49,7 +48,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppLinkPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java
index 55dbd3c..912a4bd 100644
--- a/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java
@@ -20,7 +20,6 @@
 import static android.app.NotificationManager.IMPORTANCE_HIGH;
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_NONE;
-import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
 import static android.provider.Settings.Secure.NOTIFICATION_BADGING;
 
 import static junit.framework.Assert.assertFalse;
@@ -39,7 +38,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
@@ -61,7 +59,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BadgePreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
index d294122..8d59fd2 100644
--- a/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BadgingNotificationPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
index aca814a..d6df612 100644
--- a/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
@@ -40,7 +40,6 @@
 import android.app.NotificationChannelGroup;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 
 import com.android.settings.R;
@@ -59,7 +58,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BlockPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/BootSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BootSoundPreferenceControllerTest.java
index 3157d31..58ba46b 100644
--- a/tests/robotests/src/com/android/settings/notification/BootSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BootSoundPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BootSoundPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/CastPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/CastPreferenceControllerTest.java
index faace1b..ed9cc98 100644
--- a/tests/robotests/src/com/android/settings/notification/CastPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/CastPreferenceControllerTest.java
@@ -36,7 +36,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CastPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/ChargingSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ChargingSoundPreferenceControllerTest.java
index e8d945b..2b2d024 100644
--- a/tests/robotests/src/com/android/settings/notification/ChargingSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ChargingSoundPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ChargingSoundPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/ConfigureNotificationSettingsTest.java b/tests/robotests/src/com/android/settings/notification/ConfigureNotificationSettingsTest.java
index afdc355..8cf8f83 100644
--- a/tests/robotests/src/com/android/settings/notification/ConfigureNotificationSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ConfigureNotificationSettingsTest.java
@@ -40,7 +40,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConfigureNotificationSettingsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/DeletedChannelsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DeletedChannelsPreferenceControllerTest.java
index 2742d0d..fd903f9 100644
--- a/tests/robotests/src/com/android/settings/notification/DeletedChannelsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DeletedChannelsPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DeletedChannelsPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/DescriptionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DescriptionPreferenceControllerTest.java
index 7f695f3..3065d99 100644
--- a/tests/robotests/src/com/android/settings/notification/DescriptionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DescriptionPreferenceControllerTest.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.notification;
 
-import static android.app.NotificationChannel.DEFAULT_CHANNEL_ID;
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_NONE;
 
@@ -32,8 +31,6 @@
 import android.app.NotificationChannelGroup;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 
@@ -51,7 +48,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DescriptionPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/DialPadTonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DialPadTonePreferenceControllerTest.java
index 3400181..4ec67e6 100644
--- a/tests/robotests/src/com/android/settings/notification/DialPadTonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DialPadTonePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DialPadTonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java
index 428f536..f52cb2e 100644
--- a/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java
@@ -21,8 +21,6 @@
 import static android.app.NotificationManager.IMPORTANCE_HIGH;
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_MIN;
-import static android.app.NotificationManager.IMPORTANCE_NONE;
-import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
 
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
@@ -39,7 +37,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
@@ -61,7 +58,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DndPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/DockAudioMediaPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DockAudioMediaPreferenceControllerTest.java
index 0634cef..58e5636 100644
--- a/tests/robotests/src/com/android/settings/notification/DockAudioMediaPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DockAudioMediaPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DockAudioMediaPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/DockingSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DockingSoundPreferenceControllerTest.java
index 517b722..d6a277f 100644
--- a/tests/robotests/src/com/android/settings/notification/DockingSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/DockingSoundPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DockingSoundPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/EmergencyBroadcastPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/EmergencyBroadcastPreferenceControllerTest.java
index 6a7be85..24f4b6c 100644
--- a/tests/robotests/src/com/android/settings/notification/EmergencyBroadcastPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/EmergencyBroadcastPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EmergencyBroadcastPreferenceControllerTest {
 
     private static final String PREF_TEST_KEY = "test_key";
diff --git a/tests/robotests/src/com/android/settings/notification/EmergencyTonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/EmergencyTonePreferenceControllerTest.java
index 9e35ad9..c3e887f 100644
--- a/tests/robotests/src/com/android/settings/notification/EmergencyTonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/EmergencyTonePreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EmergencyTonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/HeaderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/HeaderPreferenceControllerTest.java
index f6b7e00..ab7e384 100644
--- a/tests/robotests/src/com/android/settings/notification/HeaderPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/HeaderPreferenceControllerTest.java
@@ -25,7 +25,6 @@
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -34,12 +33,10 @@
 import android.app.NotificationChannelGroup;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v14.preference.PreferenceFragment;
 import android.view.View;
 
-import com.android.settings.R;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.LayoutPreference;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
@@ -54,7 +51,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class HeaderPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/ImportancePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ImportancePreferenceControllerTest.java
index d04a4c6..0065e30 100644
--- a/tests/robotests/src/com/android/settings/notification/ImportancePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ImportancePreferenceControllerTest.java
@@ -33,7 +33,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 import android.text.TextUtils;
@@ -52,7 +51,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ImportancePreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java
index 0f3a37d..1a96b40 100644
--- a/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java
@@ -36,7 +36,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
@@ -59,7 +58,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowResources.class,
 })
 public class LightsPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/notification/MediaVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/MediaVolumePreferenceControllerTest.java
index 30cb158..ca7fc44 100644
--- a/tests/robotests/src/com/android/settings/notification/MediaVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/MediaVolumePreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MediaVolumePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAccessSettingsTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAccessSettingsTest.java
index 9709504..619c472 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationAccessSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationAccessSettingsTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationAccessSettingsTest {
 
     private FakeFeatureFactory mFeatureFactory;
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java b/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
index 0fb2e5c..089e330 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
@@ -31,7 +31,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationBackendTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java
index f4a5924..8f91806 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java
@@ -38,7 +38,6 @@
 import android.app.NotificationChannelGroup;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 
@@ -57,7 +56,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationRingtonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationRingtonePreferenceControllerTest.java
index ab26226..940a948 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationRingtonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationRingtonePreferenceControllerTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationRingtonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
index 3e0fd7b..f919e7b 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationVolumePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationsOffPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationsOffPreferenceControllerTest.java
index aacccf4..654d90c 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationsOffPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationsOffPreferenceControllerTest.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.notification;
 
-import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_NONE;
 
 import static junit.framework.Assert.assertFalse;
@@ -30,7 +29,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
 
@@ -48,7 +46,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotificationsOffPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/PhoneRingtonePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/PhoneRingtonePreferenceControllerTest.java
index 614de6f..57ab4d3 100644
--- a/tests/robotests/src/com/android/settings/notification/PhoneRingtonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/PhoneRingtonePreferenceControllerTest.java
@@ -35,7 +35,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PhoneRingtonePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/PulseNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/PulseNotificationPreferenceControllerTest.java
index 4ee5f5a..43833fd 100644
--- a/tests/robotests/src/com/android/settings/notification/PulseNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/PulseNotificationPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PulseNotificationPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
index 48edcf7..1a6d3d7 100644
--- a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RingVolumePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/RingtonePreferenceControllerBaseTest.java b/tests/robotests/src/com/android/settings/notification/RingtonePreferenceControllerBaseTest.java
index 82f4dab..e72ef53 100644
--- a/tests/robotests/src/com/android/settings/notification/RingtonePreferenceControllerBaseTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RingtonePreferenceControllerBaseTest.java
@@ -36,7 +36,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RingtonePreferenceControllerBaseTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/ScreenLockSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ScreenLockSoundPreferenceControllerTest.java
index 4e77793..f94f8bf 100644
--- a/tests/robotests/src/com/android/settings/notification/ScreenLockSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ScreenLockSoundPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ScreenLockSoundPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/SettingPrefControllerTest.java b/tests/robotests/src/com/android/settings/notification/SettingPrefControllerTest.java
index ef7ee04..307536d 100644
--- a/tests/robotests/src/com/android/settings/notification/SettingPrefControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SettingPrefControllerTest.java
@@ -47,7 +47,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingPrefControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java
index 3d6bc92..9025979 100644
--- a/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java
@@ -35,14 +35,12 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import android.app.Fragment;
 import android.app.Notification;
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
-import android.os.Build;
 import android.os.UserManager;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
@@ -59,13 +57,12 @@
 import org.junit.runner.RunWith;
 import org.mockito.Answers;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SoundPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java b/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
index 5b816d4..3f17e1d 100644
--- a/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
@@ -30,7 +30,6 @@
 import org.junit.runner.RunWith;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
-import org.robolectric.util.ReflectionHelpers;
 
 import java.util.List;
 
@@ -41,7 +40,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SoundSettingsTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/notification/SuppressorHelperTest.java b/tests/robotests/src/com/android/settings/notification/SuppressorHelperTest.java
index 5efad20..74c41f3 100644
--- a/tests/robotests/src/com/android/settings/notification/SuppressorHelperTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SuppressorHelperTest.java
@@ -33,7 +33,7 @@
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SuppressorHelperTest {
     private static final String SUPPRESSOR_NAME = "wear";
 
diff --git a/tests/robotests/src/com/android/settings/notification/TouchSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/TouchSoundPreferenceControllerTest.java
index ad9eb8f..eaf9bb5 100644
--- a/tests/robotests/src/com/android/settings/notification/TouchSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/TouchSoundPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TouchSoundPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/VibrateOnTouchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VibrateOnTouchPreferenceControllerTest.java
index b469f9b..b0ab54b 100644
--- a/tests/robotests/src/com/android/settings/notification/VibrateOnTouchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VibrateOnTouchPreferenceControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VibrateOnTouchPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java
index 19cf649..8787a73 100644
--- a/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VibrateWhenRingPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java
index ea2c058..72c5beb 100644
--- a/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java
@@ -35,7 +35,6 @@
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.content.Context;
-import android.os.Build;
 import android.os.UserManager;
 import android.os.Vibrator;
 import android.support.v7.preference.Preference;
@@ -57,7 +56,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VibrationPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/notification/VisibilityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VisibilityPreferenceControllerTest.java
index cd8cdad..cdd1e9e 100644
--- a/tests/robotests/src/com/android/settings/notification/VisibilityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VisibilityPreferenceControllerTest.java
@@ -42,7 +42,6 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.UserInfo;
-import android.os.Build;
 import android.os.UserManager;
 import android.provider.Settings;
 import android.support.v7.preference.PreferenceScreen;
@@ -68,7 +67,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         ShadowRestrictionUtils.class,
 })
 public class VisibilityPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceControllerTest.java
index f659e82..a1d9205 100644
--- a/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VolumeSeekBarPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceTest.java b/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceTest.java
index df98cff..b091cd3 100644
--- a/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/notification/VolumeSeekBarPreferenceTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class VolumeSeekBarPreferenceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/WorkSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/WorkSoundPreferenceControllerTest.java
index a9abdce..0c826ed 100644
--- a/tests/robotests/src/com/android/settings/notification/WorkSoundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/WorkSoundPreferenceControllerTest.java
@@ -49,7 +49,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WorkSoundPreferenceControllerTest {
 
     private static final String KEY_WORK_CATEGORY = "sound_work_settings_section";
diff --git a/tests/robotests/src/com/android/settings/notification/ZenAccessSettingsTest.java b/tests/robotests/src/com/android/settings/notification/ZenAccessSettingsTest.java
index 5fe3154..ff1356e 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenAccessSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenAccessSettingsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenAccessSettingsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeAlarmsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeAlarmsPreferenceControllerTest.java
index 06ca70a..4b981f3 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeAlarmsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeAlarmsPreferenceControllerTest.java
@@ -32,7 +32,6 @@
 import android.content.Context;
 import android.provider.Settings;
 import android.support.v14.preference.SwitchPreference;
-import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
 
 import com.android.settings.TestConfig;
@@ -42,7 +41,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -51,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeAlarmsPreferenceControllerTest {
     private ZenModeAlarmsPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java
new file mode 100644
index 0000000..0dae923
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import android.app.AutomaticZenRule;
+import android.app.Fragment;
+import android.app.NotificationManager;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.provider.Settings;
+import android.support.v7.preference.PreferenceCategory;
+import android.support.v7.preference.PreferenceScreen;
+
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+import org.robolectric.util.ReflectionHelpers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class ZenModeAutomaticRulesPreferenceControllerTest {
+    private ZenModeAutomaticRulesPreferenceController mController;
+    private final String GENERIC_RULE_NAME = "test";
+
+    @Mock
+    private ZenModeBackend mBackend;
+    @Mock
+    private NotificationManager mNotificationManager;
+    @Mock
+    private PreferenceCategory mockPref;
+    @Mock
+    private NotificationManager.Policy mPolicy;
+    @Mock
+    private PreferenceScreen mPreferenceScreen;
+
+    private Context mContext;
+    private ContentResolver mContentResolver;
+
+    @Before
+    public void setup() {
+        MockitoAnnotations.initMocks(this);
+        ShadowApplication shadowApplication = ShadowApplication.getInstance();
+        shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNotificationManager);
+
+        mContext = shadowApplication.getApplicationContext();
+        mContentResolver = RuntimeEnvironment.application.getContentResolver();
+        when(mNotificationManager.getNotificationPolicy()).thenReturn(mPolicy);
+        mController = new ZenModeAutomaticRulesPreferenceController(mContext, mock(Fragment.class),
+                mock(Lifecycle.class));
+        ReflectionHelpers.setField(mController, "mBackend", mBackend);
+
+        when(mPreferenceScreen.findPreference(mController.getPreferenceKey())).thenReturn(
+                mockPref);
+        mController.displayPreference(mPreferenceScreen);
+    }
+
+    @Test
+    public void updateState_checkRuleOrderingDescending() {
+        final int NUM_RULES = 4;
+        when(mNotificationManager.getAutomaticZenRules()).thenReturn(
+                mockAutoZenRulesDecreasingCreationTime(NUM_RULES));
+
+        Map.Entry<String, AutomaticZenRule>[] rules = mController.sortedRules();
+        assertEquals(NUM_RULES, rules.length);
+
+        // check ordering, most recent should be at the bottom/end (ie higher creation time)
+        for (int i = 0; i < NUM_RULES; i++) {
+            assertEquals(rules[i].getKey(), GENERIC_RULE_NAME + (NUM_RULES - 1 - i));
+        }
+    }
+
+    @Test
+    public void updateState_checkRuleOrderingAscending() {
+        final int NUM_RULES = 4;
+        when(mNotificationManager.getAutomaticZenRules()).thenReturn(
+                mockAutoZenRulesAscendingCreationTime(NUM_RULES));
+
+        Map.Entry<String, AutomaticZenRule>[] rules = mController.sortedRules();
+        assertEquals(NUM_RULES, rules.length);
+
+        // check ordering, most recent should be at the bottom/end (ie higher creation time)
+        for (int i = 0; i < NUM_RULES; i++) {
+            assertEquals(rules[i].getKey(), GENERIC_RULE_NAME + i);
+        }
+    }
+
+    @Test
+    public void updateState_checkRuleOrderingMix() {
+        final int NUM_RULES = 4;
+        // map with creation times: 0, 2, 4, 6
+        Map<String,AutomaticZenRule> rMap = mockAutoZenRulesAscendingCreationTime(NUM_RULES);
+
+        final String insertedRule1 = "insertedRule1";
+        rMap.put(insertedRule1, new AutomaticZenRule(insertedRule1, null, null,
+                Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, 5));
+
+        final String insertedRule2 = "insertedRule2";
+        rMap.put(insertedRule2, new AutomaticZenRule(insertedRule2, null, null,
+                Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, 3));
+
+        // rule map with rule creation times, 0, 2, 4, 6, 5, 3
+        // sort should create ordering based on creation times: 0, 2, 3, 4, 5, 6
+        when(mNotificationManager.getAutomaticZenRules()).thenReturn(rMap);
+
+        Map.Entry<String, AutomaticZenRule>[] rules = mController.sortedRules();
+        assertEquals(NUM_RULES + 2, rules.length); // inserted 2 rules
+
+        // check ordering of inserted rules
+        assertEquals(rules[4].getKey(), insertedRule1);
+        assertEquals(rules[2].getKey(), insertedRule2);
+    }
+
+    private Map<String, AutomaticZenRule> mockAutoZenRulesAscendingCreationTime(int numRules) {
+        Map<String, AutomaticZenRule> ruleMap = new HashMap<>();
+
+        for (int i = 0; i < numRules; i++) {
+            ruleMap.put(GENERIC_RULE_NAME + i, new AutomaticZenRule(GENERIC_RULE_NAME + i, null,
+                    null, Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, i * 2));
+        }
+
+        return ruleMap;
+    }
+
+    private Map<String, AutomaticZenRule> mockAutoZenRulesDecreasingCreationTime(int numRules) {
+        Map<String, AutomaticZenRule> ruleMap = new HashMap<>();
+
+        for (int i = 0; i < numRules; i++) {
+            ruleMap.put(GENERIC_RULE_NAME + i, new AutomaticZenRule(GENERIC_RULE_NAME + i, null,
+                    null, Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, numRules - i));
+        }
+
+        return ruleMap;
+    }
+}
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeBehaviorFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeBehaviorFooterPreferenceControllerTest.java
index a7c051b..3786101 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeBehaviorFooterPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeBehaviorFooterPreferenceControllerTest.java
@@ -62,7 +62,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeBehaviorFooterPreferenceControllerTest {
     private ZenModeBehaviorFooterPreferenceController mController;
     private final String TEST_APP_NAME = "test_app";
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeButtonPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeButtonPreferenceControllerTest.java
index a6f7b2b..862b8d0 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeButtonPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeButtonPreferenceControllerTest.java
@@ -42,7 +42,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -51,7 +50,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeButtonPreferenceControllerTest {
     private ZenModeButtonPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeCallsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeCallsPreferenceControllerTest.java
index ea7e9f5..21eea0e 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeCallsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeCallsPreferenceControllerTest.java
@@ -43,7 +43,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -52,7 +51,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeCallsPreferenceControllerTest {
     private ZenModeCallsPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeCallsTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeCallsTest.java
index b7c122c..8ed0075 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeCallsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeCallsTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeCallsTest {
     private ZenModeCallsSettings mCalls;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeEventsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeEventsPreferenceControllerTest.java
index b527abf..7bd37e0 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeEventsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeEventsPreferenceControllerTest.java
@@ -41,7 +41,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RuntimeEnvironment;
@@ -50,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeEventsPreferenceControllerTest {
     private ZenModeEventsPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeMediaPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeMediaPreferenceControllerTest.java
index 976d6d4..e98f17d 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeMediaPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeMediaPreferenceControllerTest.java
@@ -50,7 +50,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeMediaPreferenceControllerTest {
     private ZenModeMediaSystemOtherPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeMessagesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeMessagesPreferenceControllerTest.java
index c06f93f..9625623 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeMessagesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeMessagesPreferenceControllerTest.java
@@ -25,7 +25,6 @@
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -33,7 +32,6 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.provider.Settings;
-import android.support.v14.preference.SwitchPreference;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
 
@@ -45,7 +43,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -54,7 +51,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeMessagesPreferenceControllerTest {
     private ZenModeMessagesPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeMessagesTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeMessagesTest.java
index e924487..181a238 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeMessagesTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeMessagesTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeMessagesTest {
     private ZenModeMessagesSettings mMessages;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModePreferenceControllerTest.java
index 0a28673..1d71a8a 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModePreferenceControllerTest.java
@@ -43,7 +43,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeRemindersPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeRemindersPreferenceControllerTest.java
index 9d8b011..d8d95b6 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeRemindersPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeRemindersPreferenceControllerTest.java
@@ -41,7 +41,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -50,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeRemindersPreferenceControllerTest {
     private ZenModeRemindersPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceControllerTest.java
index d4ee9bc..ba52ce2 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceControllerTest.java
@@ -41,7 +41,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -50,7 +49,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeRepeatCallersPreferenceControllerTest {
     private ZenModeRepeatCallersPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeScheduleRuleSettingsTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeScheduleRuleSettingsTest.java
index e45847d..f8cc767 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeScheduleRuleSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeScheduleRuleSettingsTest.java
@@ -26,17 +26,14 @@
 import com.android.settings.TestConfig;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
-import com.android.settings.testutils.shadow.ShadowUserManager;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowToast;
-import org.robolectric.RuntimeEnvironment;
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Mockito.doReturn;
@@ -47,7 +44,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeScreenOffPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeScreenOffPreferenceControllerTest.java
index 3fe1eab..870452e 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeScreenOffPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeScreenOffPreferenceControllerTest.java
@@ -22,7 +22,6 @@
 
 import android.app.NotificationManager;
 import android.content.Context;
-import android.provider.Settings;
 import android.support.v14.preference.SwitchPreference;
 
 import com.android.settings.TestConfig;
@@ -32,7 +31,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -40,7 +38,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeScreenOffPreferenceControllerTest {
     private ZenModeScreenOffPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeScreenOnPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeScreenOnPreferenceControllerTest.java
index 24e3ce3..58ccf3e 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeScreenOnPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeScreenOnPreferenceControllerTest.java
@@ -22,7 +22,6 @@
 
 import android.app.NotificationManager;
 import android.content.Context;
-import android.provider.Settings;
 import android.support.v14.preference.SwitchPreference;
 
 import com.android.settings.TestConfig;
@@ -32,7 +31,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
@@ -40,7 +38,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeScreenOnPreferenceControllerTest {
     private ZenModeScreenOnPreferenceController mController;
 
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceControllerTest.java
index eed8237..10bdbb6 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceControllerTest.java
@@ -59,7 +59,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeSettingsFooterPreferenceControllerTest {
     private ZenModeSettingsFooterPreferenceController mController;
     private final String TEST_APP_NAME = "test_app";
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
index 966c927..fa2c6b9 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
@@ -38,7 +38,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ZenModeSettingsTest {
 
     private ZenModeSettings.SummaryBuilder mBuilder;
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
index 5b86374..28b0264 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
@@ -47,7 +47,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class
         })
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
index 12c6b99..c003603 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
@@ -48,7 +48,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResourcesImpl.class,
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockPatternTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockPatternTest.java
index da3a157..e17136e 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockPatternTest.java
@@ -44,7 +44,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResourcesImpl.class,
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockSettingsHelperTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockSettingsHelperTest.java
index 55e60e5..20a05e3 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockSettingsHelperTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockSettingsHelperTest.java
@@ -33,7 +33,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUserManager.class,
                 ShadowUtils.class
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
index 2d82e0e..0a0734f 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
@@ -49,7 +49,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowEventLogWriter.class,
                 ShadowUserManager.class,
diff --git a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
index 1568f19..d76968e 100644
--- a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
+++ b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
@@ -35,7 +35,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/password/ScreenLockTypeTest.java b/tests/robotests/src/com/android/settings/password/ScreenLockTypeTest.java
index f8792a8..8beefa8 100644
--- a/tests/robotests/src/com/android/settings/password/ScreenLockTypeTest.java
+++ b/tests/robotests/src/com/android/settings/password/ScreenLockTypeTest.java
@@ -30,7 +30,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O)
+        sdk = TestConfig.SDK_VERSION)
 public class ScreenLockTypeTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
index 06086fc..cb863a0 100644
--- a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.shadows.ShadowActivity;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SetNewPasswordActivityTest {
 
     private int mProvisioned;
diff --git a/tests/robotests/src/com/android/settings/password/SetNewPasswordControllerTest.java b/tests/robotests/src/com/android/settings/password/SetNewPasswordControllerTest.java
index a3f1787..52678fb 100644
--- a/tests/robotests/src/com/android/settings/password/SetNewPasswordControllerTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetNewPasswordControllerTest.java
@@ -57,7 +57,7 @@
  * Tests for {@link SetNewPasswordController}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class SetNewPasswordControllerTest {
     private static final int CURRENT_USER_ID = 101;
     private static final long FINGERPRINT_CHALLENGE = -9876512313131L;
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
index 97fffd5..28be616 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
@@ -58,7 +58,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResourcesImpl.class,
diff --git a/tests/robotests/src/com/android/settings/password/SetupSkipDialogTest.java b/tests/robotests/src/com/android/settings/password/SetupSkipDialogTest.java
index 6cd4244..0e6f28a 100644
--- a/tests/robotests/src/com/android/settings/password/SetupSkipDialogTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupSkipDialogTest.java
@@ -40,7 +40,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/print/PrintSettingsFragmentTest.java b/tests/robotests/src/com/android/settings/print/PrintSettingsFragmentTest.java
index 717fe88..cf34f45 100644
--- a/tests/robotests/src/com/android/settings/print/PrintSettingsFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/print/PrintSettingsFragmentTest.java
@@ -45,7 +45,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PrintSettingsFragmentTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/search/AccessibilityServiceResultFutureTaskTest.java b/tests/robotests/src/com/android/settings/search/AccessibilityServiceResultFutureTaskTest.java
index 456f820..b4f07d7 100644
--- a/tests/robotests/src/com/android/settings/search/AccessibilityServiceResultFutureTaskTest.java
+++ b/tests/robotests/src/com/android/settings/search/AccessibilityServiceResultFutureTaskTest.java
@@ -47,7 +47,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AccessibilityServiceResultFutureTaskTest {
 
     private static final String QUERY = "test_query";
diff --git a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
index 4c19220..6c6d7ab 100644
--- a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
+++ b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
@@ -45,7 +45,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class BaseSearchIndexProviderTest {
 
     private static final String TEST_PREF_KEY = "test_pref_key";
diff --git a/tests/robotests/src/com/android/settings/search/CursorToSearchResultConverterTest.java b/tests/robotests/src/com/android/settings/search/CursorToSearchResultConverterTest.java
index f862529..cd62c15 100644
--- a/tests/robotests/src/com/android/settings/search/CursorToSearchResultConverterTest.java
+++ b/tests/robotests/src/com/android/settings/search/CursorToSearchResultConverterTest.java
@@ -52,7 +52,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CursorToSearchResultConverterTest {
 
     private static final List<String> TITLES = Arrays.asList("title1", "title2", "title3");
diff --git a/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java b/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
index 7f30dba..464e9d3 100644
--- a/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
+++ b/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
@@ -69,11 +69,9 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
-        manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
-        shadows = {
-                ShadowRunnableAsyncTask.class,
-        }
+    manifest = TestConfig.MANIFEST_PATH,
+    sdk = TestConfig.SDK_VERSION,
+    shadows = {ShadowRunnableAsyncTask.class,}
 )
 public class DatabaseIndexingManagerTest {
     private final String localeStr = "en_US";
diff --git a/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java b/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
index 4b662b6..13481c4 100644
--- a/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
@@ -22,7 +22,6 @@
 import android.content.Context;
 
 import com.android.settings.TestConfig;
-import com.android.settings.deviceinfo.SystemUpdatePreferenceController;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 import org.junit.Before;
@@ -35,7 +34,7 @@
 import java.util.Map;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DatabaseIndexingUtilsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/search/InlineListPayloadTest.java b/tests/robotests/src/com/android/settings/search/InlineListPayloadTest.java
index 8194b12..fc15205 100644
--- a/tests/robotests/src/com/android/settings/search/InlineListPayloadTest.java
+++ b/tests/robotests/src/com/android/settings/search/InlineListPayloadTest.java
@@ -14,7 +14,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InlineListPayloadTest {
 
     private static final String DUMMY_SETTING = "inline_list_key";
diff --git a/tests/robotests/src/com/android/settings/search/InlinePayloadTest.java b/tests/robotests/src/com/android/settings/search/InlinePayloadTest.java
index 180e6a0..8bb558f 100644
--- a/tests/robotests/src/com/android/settings/search/InlinePayloadTest.java
+++ b/tests/robotests/src/com/android/settings/search/InlinePayloadTest.java
@@ -17,7 +17,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InlinePayloadTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/search/InlineSwitchPayloadTest.java b/tests/robotests/src/com/android/settings/search/InlineSwitchPayloadTest.java
index 895bf9c..64778a0 100644
--- a/tests/robotests/src/com/android/settings/search/InlineSwitchPayloadTest.java
+++ b/tests/robotests/src/com/android/settings/search/InlineSwitchPayloadTest.java
@@ -37,7 +37,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InlineSwitchPayloadTest {
 
     private static final String DUMMY_SETTING = "inline_test";
diff --git a/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java b/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
index 2ab24e2..ca98c15 100644
--- a/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
@@ -42,7 +42,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InlineSwitchViewHolderTest {
 
     private static final String TITLE = "title";
diff --git a/tests/robotests/src/com/android/settings/search/InputDeviceResultFutureTaskTest.java b/tests/robotests/src/com/android/settings/search/InputDeviceResultFutureTaskTest.java
index 73fe52c..e31b3d7 100644
--- a/tests/robotests/src/com/android/settings/search/InputDeviceResultFutureTaskTest.java
+++ b/tests/robotests/src/com/android/settings/search/InputDeviceResultFutureTaskTest.java
@@ -56,7 +56,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowInputDevice.class
         })
diff --git a/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java b/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
index 4dcd9b2..1cf1480 100644
--- a/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
@@ -63,7 +63,7 @@
 import java.util.stream.Collectors;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class InstalledAppResultLoaderTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java b/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
index f19da83..1c5a67e 100644
--- a/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
@@ -60,7 +60,7 @@
 import java.util.Objects;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class IntentSearchViewHolderTest {
 
     private static final String TITLE = "title";
diff --git a/tests/robotests/src/com/android/settings/search/ResultPayloadTest.java b/tests/robotests/src/com/android/settings/search/ResultPayloadTest.java
index 2d9d4aa..0bb43c5 100644
--- a/tests/robotests/src/com/android/settings/search/ResultPayloadTest.java
+++ b/tests/robotests/src/com/android/settings/search/ResultPayloadTest.java
@@ -30,7 +30,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ResultPayloadTest {
     private ResultPayload mPayload;
 
diff --git a/tests/robotests/src/com/android/settings/search/ResultPayloadUtilsTest.java b/tests/robotests/src/com/android/settings/search/ResultPayloadUtilsTest.java
index a86089e..50bdb84 100644
--- a/tests/robotests/src/com/android/settings/search/ResultPayloadUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/search/ResultPayloadUtilsTest.java
@@ -30,7 +30,7 @@
 import static junit.framework.Assert.fail;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ResultPayloadUtilsTest {
     private ResultPayload payload;
 
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
index 4142111..780a8a5d 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
@@ -38,7 +38,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedQueryLoaderTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryPayloadTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryPayloadTest.java
index 0845aa6..7421d1a 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryPayloadTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryPayloadTest.java
@@ -28,7 +28,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedQueryPayloadTest {
 
     private SavedQueryPayload mPayload;
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
index 5e1de45..af8cfe4 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
@@ -36,7 +36,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedQueryRecorderAndRemoverTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryViewHolderTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryViewHolderTest.java
index 0bb30e9..bb8f6d1 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryViewHolderTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedQueryViewHolderTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
index fae814f..4349ab4 100644
--- a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
         SettingsShadowSystemProperties.class
 })
 public class SearchFeatureProviderImplTest {
diff --git a/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java b/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
index 014ca7c..f547fe8 100644
--- a/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
@@ -62,7 +62,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
index 90dba29..eedb324 100644
--- a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
@@ -40,7 +40,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SearchIndexableResourcesTest {
 
     Set<Class> sProviderClassCopy;
diff --git a/tests/robotests/src/com/android/settings/search/SearchResultAggregatorTest.java b/tests/robotests/src/com/android/settings/search/SearchResultAggregatorTest.java
index babb6e4..27fcd6a 100644
--- a/tests/robotests/src/com/android/settings/search/SearchResultAggregatorTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchResultAggregatorTest.java
@@ -30,7 +30,7 @@
 import java.util.concurrent.TimeUnit;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SearchResultAggregatorTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/search/SearchResultBuilderTest.java b/tests/robotests/src/com/android/settings/search/SearchResultBuilderTest.java
index 6d38aa8..cd77b25 100644
--- a/tests/robotests/src/com/android/settings/search/SearchResultBuilderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchResultBuilderTest.java
@@ -37,7 +37,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SearchResultBuilderTest {
 
     private static final String TITLE = "title";
diff --git a/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java b/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
index 1dad447..4baf8d2 100644
--- a/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
@@ -46,7 +46,7 @@
 import java.util.Objects;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SearchResultsAdapterTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
index ac70a63..efeaed7 100644
--- a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
@@ -27,7 +27,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsSearchIndexablesProviderTest {
 
     private final String BASE_AUTHORITY = "com.android.settings";
diff --git a/tests/robotests/src/com/android/settings/search/StaticSearchResultFutureTaskTest.java b/tests/robotests/src/com/android/settings/search/StaticSearchResultFutureTaskTest.java
index 69795e7..b1494e4 100644
--- a/tests/robotests/src/com/android/settings/search/StaticSearchResultFutureTaskTest.java
+++ b/tests/robotests/src/com/android/settings/search/StaticSearchResultFutureTaskTest.java
@@ -61,7 +61,7 @@
 import java.util.concurrent.TimeoutException;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class StaticSearchResultFutureTaskTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java b/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
index 4a9baa1..6050b32 100644
--- a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
+++ b/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
@@ -43,7 +43,7 @@
  * with another preference with a matchin replacement attribute.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class XmlParserUtilTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/search/actionbar/SearchMenuControllerTest.java b/tests/robotests/src/com/android/settings/search/actionbar/SearchMenuControllerTest.java
index 52918fb..e79e2d0 100644
--- a/tests/robotests/src/com/android/settings/search/actionbar/SearchMenuControllerTest.java
+++ b/tests/robotests/src/com/android/settings/search/actionbar/SearchMenuControllerTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SearchMenuControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/search/indexing/IndexDataConverterTest.java b/tests/robotests/src/com/android/settings/search/indexing/IndexDataConverterTest.java
index 58003c4..0f2ab56 100644
--- a/tests/robotests/src/com/android/settings/search/indexing/IndexDataConverterTest.java
+++ b/tests/robotests/src/com/android/settings/search/indexing/IndexDataConverterTest.java
@@ -46,7 +46,7 @@
 import static org.mockito.Mockito.spy;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, qualifiers = "mcc999")
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, qualifiers = "mcc999")
 public class IndexDataConverterTest {
 
     private final String localeStr = "en_US";
diff --git a/tests/robotests/src/com/android/settings/search/indexing/IndexDataTest.java b/tests/robotests/src/com/android/settings/search/indexing/IndexDataTest.java
index 9fe647a..1a05a2b 100644
--- a/tests/robotests/src/com/android/settings/search/indexing/IndexDataTest.java
+++ b/tests/robotests/src/com/android/settings/search/indexing/IndexDataTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class IndexDataTest {
     private IndexData.Builder mBuilder;
 
diff --git a/tests/robotests/src/com/android/settings/search/indexing/PreIndexDataCollectorTest.java b/tests/robotests/src/com/android/settings/search/indexing/PreIndexDataCollectorTest.java
index ef16a37..2bb03cb 100644
--- a/tests/robotests/src/com/android/settings/search/indexing/PreIndexDataCollectorTest.java
+++ b/tests/robotests/src/com/android/settings/search/indexing/PreIndexDataCollectorTest.java
@@ -46,7 +46,7 @@
 import static org.mockito.Mockito.spy;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PreIndexDataCollectorTest {
 
     private final String AUTHORITY_ONE = "authority";
diff --git a/tests/robotests/src/com/android/settings/security/ConfigureKeyGuardDialogTest.java b/tests/robotests/src/com/android/settings/security/ConfigureKeyGuardDialogTest.java
index df0cc2e..ab7512f 100644
--- a/tests/robotests/src/com/android/settings/security/ConfigureKeyGuardDialogTest.java
+++ b/tests/robotests/src/com/android/settings/security/ConfigureKeyGuardDialogTest.java
@@ -36,7 +36,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = ShadowEventLogWriter.class
 )
 public class ConfigureKeyGuardDialogTest {
diff --git a/tests/robotests/src/com/android/settings/security/CredentialStoragePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/CredentialStoragePreferenceControllerTest.java
index 71253d6..638fb51 100644
--- a/tests/robotests/src/com/android/settings/security/CredentialStoragePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/CredentialStoragePreferenceControllerTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowKeyStore.class
         })
diff --git a/tests/robotests/src/com/android/settings/security/EncryptionAndCredentialTest.java b/tests/robotests/src/com/android/settings/security/EncryptionAndCredentialTest.java
index f5f0bb3..60e7dee 100644
--- a/tests/robotests/src/com/android/settings/security/EncryptionAndCredentialTest.java
+++ b/tests/robotests/src/com/android/settings/security/EncryptionAndCredentialTest.java
@@ -42,7 +42,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EncryptionAndCredentialTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java
index d66d495..a53ee42 100644
--- a/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUserManager.class,
                 ShadowLockPatternUtils.class
diff --git a/tests/robotests/src/com/android/settings/security/LockscreenDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/security/LockscreenDashboardFragmentTest.java
index 1a41c2d..bb667f2 100644
--- a/tests/robotests/src/com/android/settings/security/LockscreenDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/security/LockscreenDashboardFragmentTest.java
@@ -30,7 +30,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LockscreenDashboardFragmentTest {
 
     private LockscreenDashboardFragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/security/OwnerInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/OwnerInfoPreferenceControllerTest.java
index 9bf8606..4f05e81 100644
--- a/tests/robotests/src/com/android/settings/security/OwnerInfoPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/OwnerInfoPreferenceControllerTest.java
@@ -51,7 +51,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class OwnerInfoPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/security/RestrictedEncryptionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/RestrictedEncryptionPreferenceControllerTest.java
index 59b267f..ef3f9cd 100644
--- a/tests/robotests/src/com/android/settings/security/RestrictedEncryptionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/RestrictedEncryptionPreferenceControllerTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUserManager.class
         })
diff --git a/tests/robotests/src/com/android/settings/security/SecurityFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/security/SecurityFeatureProviderImplTest.java
index 62ed3ab..627ecf5 100644
--- a/tests/robotests/src/com/android/settings/security/SecurityFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/security/SecurityFeatureProviderImplTest.java
@@ -53,7 +53,7 @@
 import org.robolectric.shadows.ShadowLooper;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SecurityFeatureProviderImplTest {
 
     private static final String MOCK_KEY = "key";
diff --git a/tests/robotests/src/com/android/settings/security/SecuritySettingsTest.java b/tests/robotests/src/com/android/settings/security/SecuritySettingsTest.java
index a1e264d..1ecdd0f 100644
--- a/tests/robotests/src/com/android/settings/security/SecuritySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/security/SecuritySettingsTest.java
@@ -58,7 +58,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowLockPatternUtils.class
         })
diff --git a/tests/robotests/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceControllerTest.java
index a1d7b4e..0915060 100644
--- a/tests/robotests/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceControllerTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LockAfterTimeoutPreferenceControllerTest {
 
     private static final int TEST_USER_ID = 0;
diff --git a/tests/robotests/src/com/android/settings/security/screenlock/PatternVisiblePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/screenlock/PatternVisiblePreferenceControllerTest.java
index a947fca..6958d40 100644
--- a/tests/robotests/src/com/android/settings/security/screenlock/PatternVisiblePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/screenlock/PatternVisiblePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PatternVisiblePreferenceControllerTest {
 
     private static final int TEST_USER_ID = 0;
diff --git a/tests/robotests/src/com/android/settings/security/screenlock/PowerButtonInstantLockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/screenlock/PowerButtonInstantLockPreferenceControllerTest.java
index 2d2e92f..b3821a3 100644
--- a/tests/robotests/src/com/android/settings/security/screenlock/PowerButtonInstantLockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/screenlock/PowerButtonInstantLockPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PowerButtonInstantLockPreferenceControllerTest {
 
     private static final int TEST_USER_ID = 0;
diff --git a/tests/robotests/src/com/android/settings/security/screenlock/ScreenLockSettingsTest.java b/tests/robotests/src/com/android/settings/security/screenlock/ScreenLockSettingsTest.java
index a97046c..4213fc5 100644
--- a/tests/robotests/src/com/android/settings/security/screenlock/ScreenLockSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/security/screenlock/ScreenLockSettingsTest.java
@@ -36,7 +36,7 @@
 import java.util.Map;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ScreenLockSettingsTest {
 
     private ScreenLockSettings mSettings;
diff --git a/tests/robotests/src/com/android/settings/security/trustagent/TrustAgentManagerTest.java b/tests/robotests/src/com/android/settings/security/trustagent/TrustAgentManagerTest.java
index ed616be..a2b6263 100644
--- a/tests/robotests/src/com/android/settings/security/trustagent/TrustAgentManagerTest.java
+++ b/tests/robotests/src/com/android/settings/security/trustagent/TrustAgentManagerTest.java
@@ -34,7 +34,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class TrustAgentManagerTest {
 
     private static final String CANNED_PACKAGE_NAME = "com.test.package";
diff --git a/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java b/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java
index 4f0bee2..677bf41 100644
--- a/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java
+++ b/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java
@@ -41,7 +41,7 @@
 import java.util.Map;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SettingsSuggestionsTest {
 
     private static final String CATEGORY_FIRST_IMPRESSION =
diff --git a/tests/robotests/src/com/android/settings/support/NewDeviceIntroSuggestionActivityTest.java b/tests/robotests/src/com/android/settings/support/NewDeviceIntroSuggestionActivityTest.java
index 92e1384..57fda9f 100644
--- a/tests/robotests/src/com/android/settings/support/NewDeviceIntroSuggestionActivityTest.java
+++ b/tests/robotests/src/com/android/settings/support/NewDeviceIntroSuggestionActivityTest.java
@@ -52,7 +52,7 @@
 import org.robolectric.shadows.ShadowPackageManager;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NewDeviceIntroSuggestionActivityTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/support/SupportConfigTest.java b/tests/robotests/src/com/android/settings/support/SupportConfigTest.java
index ae4fcff..28b0a9d 100644
--- a/tests/robotests/src/com/android/settings/support/SupportConfigTest.java
+++ b/tests/robotests/src/com/android/settings/support/SupportConfigTest.java
@@ -28,7 +28,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SupportConfigTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java b/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java
index e7de81c..178e4ec 100644
--- a/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java
+++ b/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java
@@ -40,7 +40,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SupportDashboardActivityTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/support/SupportDisclaimerDialogFragmentTest.java b/tests/robotests/src/com/android/settings/support/SupportDisclaimerDialogFragmentTest.java
index 8aacb52..6aebe36 100644
--- a/tests/robotests/src/com/android/settings/support/SupportDisclaimerDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/support/SupportDisclaimerDialogFragmentTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {SupportDisclaimerShadowResources.class})
 public class SupportDisclaimerDialogFragmentTest {
 
diff --git a/tests/robotests/src/com/android/settings/support/actionbar/HelpMenuControllerTest.java b/tests/robotests/src/com/android/settings/support/actionbar/HelpMenuControllerTest.java
index 24e7d81..b86511f 100644
--- a/tests/robotests/src/com/android/settings/support/actionbar/HelpMenuControllerTest.java
+++ b/tests/robotests/src/com/android/settings/support/actionbar/HelpMenuControllerTest.java
@@ -35,7 +35,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class HelpMenuControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/survey/SurveyMixinTest.java b/tests/robotests/src/com/android/settings/survey/SurveyMixinTest.java
index f8c7247..69574a6 100644
--- a/tests/robotests/src/com/android/settings/survey/SurveyMixinTest.java
+++ b/tests/robotests/src/com/android/settings/survey/SurveyMixinTest.java
@@ -35,7 +35,7 @@
 import java.util.HashMap;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SurveyMixinTest {
 
     private static final String FAKE_KEY = "fake_key";
diff --git a/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
index 7ae6cdb..b986e4f 100644
--- a/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = {ShadowSecureSettings.class, ShadowUtils.class}
 )
 public class FactoryResetPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/system/SystemDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/system/SystemDashboardFragmentTest.java
index 8a1951a..cd25953 100644
--- a/tests/robotests/src/com/android/settings/system/SystemDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/system/SystemDashboardFragmentTest.java
@@ -41,7 +41,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowUserManager.class,
                 SettingsShadowResources.class,
diff --git a/tests/robotests/src/com/android/settings/users/UserFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/users/UserFeatureProviderImplTest.java
index 8c10c31..e1bc157 100644
--- a/tests/robotests/src/com/android/settings/users/UserFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/users/UserFeatureProviderImplTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserFeatureProviderImplTest {
     public static final int FIRST_USER_ID = 0;
     public static final int SECOND_USER_ID = 4;
diff --git a/tests/robotests/src/com/android/settings/users/UserPreferenceTest.java b/tests/robotests/src/com/android/settings/users/UserPreferenceTest.java
index 242604a..5b31a82 100644
--- a/tests/robotests/src/com/android/settings/users/UserPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/users/UserPreferenceTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserPreferenceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/users/UserSettingsTest.java b/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
index 28b8c86..56f3949 100644
--- a/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UserSettingsTest {
 
     @Mock private UserManager mUserManager;
diff --git a/tests/robotests/src/com/android/settings/utils/LocalClassLoaderContextThemeWrapperTest.java b/tests/robotests/src/com/android/settings/utils/LocalClassLoaderContextThemeWrapperTest.java
index ac6dc02..690c292 100644
--- a/tests/robotests/src/com/android/settings/utils/LocalClassLoaderContextThemeWrapperTest.java
+++ b/tests/robotests/src/com/android/settings/utils/LocalClassLoaderContextThemeWrapperTest.java
@@ -32,7 +32,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LocalClassLoaderContextThemeWrapperTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java b/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
index 587a82a..4b4f3fb 100644
--- a/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppDialogFragmentTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java b/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
index 5a029c7..9442892 100644
--- a/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
@@ -32,7 +32,7 @@
  * Tests for {@link VpnUtils}.
  */
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public final class VpnUtilsTest {
     @Test
     public void testIsAlwaysOnVpnSet() {
diff --git a/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java b/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
index b8fe81e..ced4b0a 100644
--- a/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.shadows.ShadowActivity;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 WallpaperSuggestionActivityTest.ShadowWallpaperManagerWrapper.class
         })
diff --git a/tests/robotests/src/com/android/settings/wallpaper/WallpaperTypeSettingsTest.java b/tests/robotests/src/com/android/settings/wallpaper/WallpaperTypeSettingsTest.java
index 7e15f7a..0c6a9f8 100644
--- a/tests/robotests/src/com/android/settings/wallpaper/WallpaperTypeSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wallpaper/WallpaperTypeSettingsTest.java
@@ -24,7 +24,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WallpaperTypeSettingsTest {
 
     private Preference mPreference;
diff --git a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
index d06980b..e44be0e 100644
--- a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
+++ b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
@@ -63,7 +63,7 @@
 import java.util.Arrays;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WebViewAppPickerTest {
     private Context mContext;
 
diff --git a/tests/robotests/src/com/android/settings/wfd/WifiDisplaySettingsTest.java b/tests/robotests/src/com/android/settings/wfd/WifiDisplaySettingsTest.java
index a65bd3b..1cf85fb 100644
--- a/tests/robotests/src/com/android/settings/wfd/WifiDisplaySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wfd/WifiDisplaySettingsTest.java
@@ -27,7 +27,6 @@
 import android.hardware.display.DisplayManager;
 import android.media.MediaRouter;
 import android.net.wifi.p2p.WifiP2pManager;
-import android.os.ServiceManager;
 
 import com.android.settings.R;
 import com.android.settings.TestConfig;
@@ -42,7 +41,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiDisplaySettingsTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java b/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java
index f69012e..0f3eb31 100644
--- a/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java
@@ -45,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ActionBarShadowControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/widget/ActionButtonPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/ActionButtonPreferenceTest.java
index a215967..a080bc6 100644
--- a/tests/robotests/src/com/android/settings/widget/ActionButtonPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/ActionButtonPreferenceTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ActionButtonPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/AppPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/AppPreferenceTest.java
index 6481f8a..d489094 100644
--- a/tests/robotests/src/com/android/settings/widget/AppPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/AppPreferenceTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/AppSwitchPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/AppSwitchPreferenceTest.java
index 81537a8..a7c8d7c 100644
--- a/tests/robotests/src/com/android/settings/widget/AppSwitchPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/AppSwitchPreferenceTest.java
@@ -33,7 +33,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AppSwitchPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/AspectRatioFrameLayoutTest.java b/tests/robotests/src/com/android/settings/widget/AspectRatioFrameLayoutTest.java
index 4a19258..dd6138c 100644
--- a/tests/robotests/src/com/android/settings/widget/AspectRatioFrameLayoutTest.java
+++ b/tests/robotests/src/com/android/settings/widget/AspectRatioFrameLayoutTest.java
@@ -32,7 +32,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class AspectRatioFrameLayoutTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/DefaultIndicatorSeekBarTest.java b/tests/robotests/src/com/android/settings/widget/DefaultIndicatorSeekBarTest.java
index 47a9aa6..7fcf328 100644
--- a/tests/robotests/src/com/android/settings/widget/DefaultIndicatorSeekBarTest.java
+++ b/tests/robotests/src/com/android/settings/widget/DefaultIndicatorSeekBarTest.java
@@ -29,7 +29,7 @@
 import static junit.framework.Assert.assertEquals;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultIndicatorSeekBarTest {
 
     private DefaultIndicatorSeekBar mDefaultIndicatorSeekBar;
diff --git a/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java b/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
index 842f53c..daa42b4 100644
--- a/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
@@ -58,7 +58,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class EntityHeaderControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/widget/FixedLineSummaryPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/FixedLineSummaryPreferenceTest.java
index 5022ceb..0d9a77b 100644
--- a/tests/robotests/src/com/android/settings/widget/FixedLineSummaryPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/FixedLineSummaryPreferenceTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class FixedLineSummaryPreferenceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/widget/LoadingViewControllerTest.java b/tests/robotests/src/com/android/settings/widget/LoadingViewControllerTest.java
index 6ab2b17..09b52c8 100644
--- a/tests/robotests/src/com/android/settings/widget/LoadingViewControllerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/LoadingViewControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LoadingViewControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/MasterSwitchPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/MasterSwitchPreferenceTest.java
index c80c7b4..1c449cc 100644
--- a/tests/robotests/src/com/android/settings/widget/MasterSwitchPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/MasterSwitchPreferenceTest.java
@@ -40,7 +40,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class MasterSwitchPreferenceTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/PreferenceCategoryControllerTest.java b/tests/robotests/src/com/android/settings/widget/PreferenceCategoryControllerTest.java
index d8661bf..23aa378 100644
--- a/tests/robotests/src/com/android/settings/widget/PreferenceCategoryControllerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/PreferenceCategoryControllerTest.java
@@ -36,7 +36,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class PreferenceCategoryControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
index b4b86f6..fd1d79e 100644
--- a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
@@ -45,7 +45,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RadioButtonPickerFragmentTest {
 
 
diff --git a/tests/robotests/src/com/android/settings/widget/RingProgressBarTest.java b/tests/robotests/src/com/android/settings/widget/RingProgressBarTest.java
index 0226c22..a1a2f24 100644
--- a/tests/robotests/src/com/android/settings/widget/RingProgressBarTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RingProgressBarTest.java
@@ -31,7 +31,7 @@
 import static junit.framework.Assert.assertEquals;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RingProgressBarTest {
 
     private Context mContext = RuntimeEnvironment.application;
diff --git a/tests/robotests/src/com/android/settings/widget/RtlCompatibleViewPagerTest.java b/tests/robotests/src/com/android/settings/widget/RtlCompatibleViewPagerTest.java
index 1072152..78afc43 100644
--- a/tests/robotests/src/com/android/settings/widget/RtlCompatibleViewPagerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RtlCompatibleViewPagerTest.java
@@ -36,7 +36,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
     manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION_O,
+    sdk = TestConfig.SDK_VERSION,
     shadows = {ShadowTextUtils.class}
 )
 public class RtlCompatibleViewPagerTest {
diff --git a/tests/robotests/src/com/android/settings/widget/ScrollToParentEditTextTest.java b/tests/robotests/src/com/android/settings/widget/ScrollToParentEditTextTest.java
index 8e91259..5755015 100644
--- a/tests/robotests/src/com/android/settings/widget/ScrollToParentEditTextTest.java
+++ b/tests/robotests/src/com/android/settings/widget/ScrollToParentEditTextTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.shadows.ShadowView;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ScrollToParentEditTextTest {
 
     private static final int EDIT_TEXT_SIZE = 20;
diff --git a/tests/robotests/src/com/android/settings/widget/SummaryUpdaterTest.java b/tests/robotests/src/com/android/settings/widget/SummaryUpdaterTest.java
index 8dbe552..2f42550 100644
--- a/tests/robotests/src/com/android/settings/widget/SummaryUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/widget/SummaryUpdaterTest.java
@@ -34,7 +34,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SummaryUpdaterTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/widget/ValidatedEditTextPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/ValidatedEditTextPreferenceTest.java
index ff2332c..59be160 100644
--- a/tests/robotests/src/com/android/settings/widget/ValidatedEditTextPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/ValidatedEditTextPreferenceTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ValidatedEditTextPreferenceTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
index 84d73c1..415cd92 100644
--- a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
@@ -34,7 +34,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class CellularFallbackPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
index 3cd5ee8..687287b 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
@@ -23,7 +23,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConfigureWifiSettingsTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java b/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java
index 5a38c4e..2eaa587 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConnectedAccessPointPreferenceTest.java
@@ -37,7 +37,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class ConnectedAccessPointPreferenceTest {
     @Mock
     private AccessPoint mAccessPoint;
diff --git a/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java b/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java
index f8d8428..9321827 100644
--- a/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/LinkablePreferenceTest.java
@@ -38,7 +38,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class LinkablePreferenceTest {
 
     private static final String TITLE = "Title";
diff --git a/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java
index f1299f4..b83a3e3 100644
--- a/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NotifyOpenNetworkPreferenceControllerTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class NotifyOpenNetworkPreferenceControllerTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java
index d157615..a6c3b2b 100644
--- a/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/SavedAccessPointsWifiSettingsTest.java
@@ -28,7 +28,6 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 import org.robolectric.util.ReflectionHelpers;
 
@@ -37,7 +36,7 @@
 import static org.mockito.Mockito.*;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class SavedAccessPointsWifiSettingsTest {
 
     @Mock private WifiManagerWrapper mockWifiManager;
diff --git a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
index 851c4c2..16d883a 100644
--- a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
@@ -58,7 +58,7 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class UseOpenWifiPreferenceControllerTest {
     private static ComponentName sEnableActivityComponent;
     private static NetworkScorerAppData sAppData;
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
index 7cef9ce..e9b6146 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
@@ -41,7 +41,7 @@
 import static org.mockito.Mockito.*;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowConnectivityManager.class)
 public class WifiConfigControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java b/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
index 40c1478..394436c 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
@@ -42,7 +42,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = {
                 SettingsShadowResources.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
index 1460c33..00941ad 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
@@ -21,7 +21,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = ShadowEntityHeaderController.class)
 public class WifiDialogTest {
     @Mock private AccessPoint mockAccessPoint;
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
index b9dbae5..63f89e6 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
@@ -38,7 +38,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiEnablerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java
index 7582143..cf3cca7 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiInfoPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiInfoPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java
index 425f17d..f1bca6f 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiMasterSwitchPreferenceControllerTest.java
@@ -44,7 +44,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiMasterSwitchPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java b/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java
index a9757bd..4507e54 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiSummaryUpdaterTest.java
@@ -44,7 +44,7 @@
 import static org.mockito.Mockito.verify;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiSummaryUpdaterTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
index 3cdcee4..1ccdb1f 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
@@ -27,7 +27,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiUtilsTest {
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java
index 07f2d30..29df539 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiWakeupPreferenceControllerTest.java
@@ -46,7 +46,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = { SettingsShadowResources.class })
 public class WifiWakeupPreferenceControllerTest {
 
diff --git a/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java
index 21488e8..7a734e5 100644
--- a/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WpsPreferenceControllerTest.java
@@ -48,7 +48,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WpsPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java b/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java
index 4fc118a..5e10e0f 100644
--- a/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WriteWifiConfigToNfcDialogTest.java
@@ -42,7 +42,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION_O,
+        sdk = TestConfig.SDK_VERSION,
         shadows = ShadowNfcAdapter.class
 )
 public class WriteWifiConfigToNfcDialogTest {
diff --git a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
index 64d9f59..6a36a79 100644
--- a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
@@ -98,7 +98,7 @@
 import java.util.stream.Collectors;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 ShadowDevicePolicyManagerWrapper.class,
                 ShadowEntityHeaderController.class,
diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/P2pCategoryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/P2pCategoryPreferenceControllerTest.java
index e53fb87..4fad863 100644
--- a/tests/robotests/src/com/android/settings/wifi/p2p/P2pCategoryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/p2p/P2pCategoryPreferenceControllerTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class P2pCategoryPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java
index 02017f7..62fd01f 100644
--- a/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/p2p/P2pThisDevicePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class P2pThisDevicePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java
index 0b8d27a..e809431 100644
--- a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2PPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiP2PPreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
index bb33f93..6832ca8 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiTetherApBandPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
index 044efad..a6d536d 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiTetherPasswordPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPreferenceControllerTest.java
index 48b5379..a40cce6 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPreferenceControllerTest.java
@@ -60,7 +60,7 @@
 import java.util.ArrayList;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {
                 WifiTetherPreferenceControllerTest.ShadowWifiTetherSettings.class,
                 WifiTetherPreferenceControllerTest.ShadowWifiTetherSwitchBarController.class,
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
index e058eed..1cba30e 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiTetherSSIDPreferenceControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
index 76a8e23..9cb19c0 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
@@ -28,7 +28,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WifiTetherSettingsTest {
 
     @Test