Merge changes Icae52730,I38282b97

* changes:
  Move dashboard test package to sdk 26
  Update DashboardFeatureProviderImplTest to sdk 26
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1e5964e..05c5075 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1920,7 +1920,8 @@
                   android:label="@string/development_settings_title"
                   android:icon="@drawable/ic_settings_development"
                   android:taskAffinity="com.android.settings"
-                  android:parentActivityName="Settings">
+                  android:parentActivityName="Settings"
+                  android:enabled="false">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
                 <action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
@@ -1989,15 +1990,6 @@
                 android:value="com.android.settings.print.PrintJobSettingsFragment" />
         </activity>
 
-        <!-- Keep compatibility with old shortcuts. -->
-        <activity-alias android:name="DevelopmentSettings"
-                  android:exported="true"
-                  android:label="@string/development_settings_title"
-                  android:targetActivity="Settings$DevelopmentSettingsDashboardActivity">
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.development.DevelopmentSettingsDashboardFragment" />
-        </activity-alias>
-
         <activity android:name=".development.AppPicker"
                   android:label="@string/select_application"
                   android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />
@@ -2006,15 +1998,6 @@
                   android:label="@string/select_webview_provider_dialog_title">
         </activity>
 
-        <!-- Keep compatibility with old shortcuts. -->
-        <activity-alias android:name="UsbSettings"
-                  android:exported="true"
-                  android:label="@string/storage_title_usb"
-                  android:targetActivity="Settings$DevelopmentSettingsDashboardActivity">
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.deviceinfo.UsbSettings" />
-        </activity-alias>
-
         <!-- Bluetooth stuff -->
 
         <activity android:name=".bluetooth.BluetoothPairingDialog"
diff --git a/res/layout-land/fingerprint_enroll_enrolling.xml b/res/layout-land/fingerprint_enroll_enrolling.xml
index fb6c78b..8b902f1 100644
--- a/res/layout-land/fingerprint_enroll_enrolling.xml
+++ b/res/layout-land/fingerprint_enroll_enrolling.xml
@@ -110,10 +110,11 @@
 
                 <com.android.setupwizardlib.view.FillContentLayout
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
+                    android:layout_height="0dp"
+                    android:layout_marginVertical="24dp"
+                    android:layout_weight="1"
                     android:paddingTop="0dp"
-                    android:paddingBottom="0dp"
-                    android:layout_marginVertical="24dp">
+                    android:paddingBottom="0dp">
 
                     <include layout="@layout/fingerprint_enroll_enrolling_content"
                          android:layout_width="match_parent"
diff --git a/res/layout/preference_dropdown_material_settings.xml b/res/layout/preference_dropdown_material_settings.xml
deleted file mode 100644
index a3f5ab9..0000000
--- a/res/layout/preference_dropdown_material_settings.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 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.
-  -->
-
-
-<!-- Based off frameworks/base/core/res/res/layout/preference_dropdown_material.xml
-     except that icon space in this layout is always reserved -->
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <Spinner
-        android:id="@+id/spinner"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/preference_no_icon_padding_start"
-        android:visibility="invisible" />
-
-    <include layout="@layout/preference_material"/>
-
-</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/settings_main_dashboard.xml b/res/layout/settings_main_dashboard.xml
index 8e83cff..7c34803 100644
--- a/res/layout/settings_main_dashboard.xml
+++ b/res/layout/settings_main_dashboard.xml
@@ -32,7 +32,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/search_bar_margin"
-            app:cardCornerRadius="2dp"
+            app:cardCornerRadius="@dimen/search_bar_half_height"
             app:cardBackgroundColor="?android:attr/colorBackground"
             app:cardElevation="2dp">
             <Toolbar
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 4d30969..1f78abd 100755
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -60,6 +60,7 @@
     <dimen name="switchbar_subsettings_margin_end">24dp</dimen>
 
     <dimen name="search_bar_height">64dp</dimen>
+    <dimen name="search_bar_half_height">32dp</dimen>
 
     <!-- Dimensions for Wifi Assistant Card -->
     <dimen name="wifi_assistant_padding_top_bottom">24dp</dimen>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0d4289a..2f00297 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -121,6 +121,7 @@
     <dimen name="search_bar_negative_margin">-8dp</dimen>
 
     <dimen name="search_bar_height">48dp</dimen>
+    <dimen name="search_bar_half_height">24dp</dimen>
     <dimen name="search_bar_text_size">16dp</dimen>
 
     <!-- Dimensions for Wifi Assistant Card -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 793498e..3fb50e5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2676,13 +2676,13 @@
     <string name="status_imei_sv">IMEI SV</string>
     <!-- Do not translate. About phone, status item title -->
     <string name="status_iccid">ICCID</string>
-    <!-- About tablet, status item title.  The Mobile Directory Number [CHAR LIMIT=30] -->
+    <!-- About tablet, status item title.  The Mobile Directory Number [CHAR LIMIT=40] -->
     <string name="status_number" product="tablet">MDN</string>
-    <!-- About phone, status item title.  The phone number of the current device [CHAR LIMIT=30] -->
+    <!-- About phone, status item title.  The phone number of the current device [CHAR LIMIT=40] -->
     <string name="status_number" product="default">Phone number</string>
-    <!-- About tablet, status item title for multi-sim devices.  The Mobile Directory Number [CHAR LIMIT=30] -->
+    <!-- About tablet, status item title for multi-sim devices.  The Mobile Directory Number [CHAR LIMIT=40] -->
     <string name="status_number_sim_slot" product="tablet">MDN (sim slot %1$d)</string>
-    <!-- About phone, status item title for multi-sim devices.  The phone number of the current device [CHAR LIMIT=30] -->
+    <!-- About phone, status item title for multi-sim devices.  The phone number of the current device [CHAR LIMIT=40] -->
     <string name="status_number_sim_slot" product="default">Phone number (sim slot %1$d)</string>
     <!-- About tablet, status item title.  The Mobile Directory Number [CHAR LIMIT=30] -->
     <string name="status_number_sim_status" product="tablet">MDN on SIM</string>
@@ -4975,7 +4975,7 @@
     <string name="process_dex2oat_label">App optimization</string>
 
     <!-- [CHAR_LIMIT=40] Battery saver: Label for feature, title + menu item -->
-    <string name="battery_saver">Battery saver</string>
+    <string name="battery_saver">Battery Saver</string>
 
     <!-- [CHAR_LIMIT=40] Battery saver: Title for automatic entry option -->
     <string name="battery_saver_turn_on_automatically_title">Turn on automatically</string>
@@ -6583,7 +6583,7 @@
     <string name="keywords_imei_info">imei, meid, min, prl version, imei sv</string>
     <string name="keywords_sim_status">network, mobile network state, service state, signal strength, mobile network type, roaming, iccid</string>
     <string name="keywords_model_and_hardware">serial number, hardware version</string>
-    <string name="keywords_android_version">android security patch level, baseband version, kernel version, </string>
+    <string name="keywords_android_version">android security patch level, baseband version, kernel version</string>
 
     <!-- NFC Wi-Fi pairing/setup strings-->
 
diff --git a/res/values/styles_preference.xml b/res/values/styles_preference.xml
index 056d55a..b8b9eb3 100644
--- a/res/values/styles_preference.xml
+++ b/res/values/styles_preference.xml
@@ -20,19 +20,19 @@
 <resources>
 
     <!-- Fragment style -->
-    <style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragmentStyle.SettingsBase">
+    <style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragment.Material">
         <item name="android:layout">@layout/preference_list_fragment</item>
     </style>
 
-    <style name="ApnPreference" parent="Preference.SettingsBase">
+    <style name="ApnPreference" parent="@style/Preference.Material">
         <item name="android:layout">@layout/apn_preference_layout</item>
     </style>
 
-    <style name="SettingsSeekBarPreference" parent="Preference.SettingsBase">
+    <style name="SettingsSeekBarPreference" parent="@style/Preference.Material">
         <item name="android:layout">@layout/preference_widget_seekbar_settings</item>
     </style>
 
-    <style name="SyncSwitchPreference" parent="Preference.SettingsBase">
+    <style name="SyncSwitchPreference" parent="@style/Preference.Material">
         <item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item>
     </style>
 
diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java
index e5d40b7..ffbd2ce 100644
--- a/src/com/android/settings/CredentialStorage.java
+++ b/src/com/android/settings/CredentialStorage.java
@@ -275,6 +275,16 @@
                 Log.e(TAG, "Failed to install " + key + " as uid " + uid);
                 return;
             }
+            // The key was prepended USER_PRIVATE_KEY by the CredentialHelper. However,
+            // KeyChain internally uses the raw alias name and only prepends USER_PRIVATE_KEY
+            // to the key name when interfacing with KeyStore.
+            // This is generally a symptom of CredentialStorage and CredentialHelper relying
+            // on internal implementation details of KeyChain and imitating its functionality
+            // rather than delegating to KeyChain for the certificate installation.
+            if (uid == Process.SYSTEM_UID || uid == KeyStore.UID_SELF) {
+                new MarkKeyAsUserSelectable(
+                        key.replaceFirst("^" + Credentials.USER_PRIVATE_KEY, "")).execute();
+            }
         }
 
         int flags = KeyStore.FLAG_NONE;
@@ -391,6 +401,33 @@
     }
 
     /**
+     * Background task to mark a given key alias as user-selectable, so that
+     * it can be selected by users from the Certificate Selection prompt.
+     */
+    private class MarkKeyAsUserSelectable extends AsyncTask<Void, Void, Boolean> {
+        final String mAlias;
+
+        public MarkKeyAsUserSelectable(String alias) {
+            mAlias = alias;
+        }
+
+        @Override
+        protected Boolean doInBackground(Void... unused) {
+            try (KeyChainConnection keyChainConnection = KeyChain.bind(CredentialStorage.this)) {
+                keyChainConnection.getService().setUserSelectable(mAlias, true);
+                return true;
+            } catch (RemoteException e) {
+                Log.w(TAG, "Failed to mark key " + mAlias + " as user-selectable.");
+                return false;
+            } catch (InterruptedException e) {
+                Log.w(TAG, "Failed to mark key " + mAlias + " as user-selectable.");
+                Thread.currentThread().interrupt();
+                return false;
+            }
+        }
+    }
+
+    /**
      * Check that the caller is either certinstaller or Settings running in a profile of this user.
      */
     private boolean checkCallerIsCertInstallerOrSelfInProfile() {
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 60d16ff..193c2b3 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -835,7 +835,8 @@
                 || somethingChanged;
 
         final boolean showDev = DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(this)
-                && !um.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES);
+                && !um.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)
+                && !Utils.isMonkeyRunning();
 
         somethingChanged = setTileEnabled(new ComponentName(packageName,
                         Settings.DevelopmentSettingsDashboardActivity.class.getName()),
diff --git a/src/com/android/settings/applications/AppInfoWithHeader.java b/src/com/android/settings/applications/AppInfoWithHeader.java
index 3df81c7..af0cf5b 100644
--- a/src/com/android/settings/applications/AppInfoWithHeader.java
+++ b/src/com/android/settings/applications/AppInfoWithHeader.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.applications;
 
+import static com.android.settings.widget.EntityHeaderController.ActionType;
+
 import android.app.Activity;
 import android.os.Bundle;
 import android.support.v7.preference.Preference;
@@ -25,8 +27,6 @@
 import com.android.settings.widget.EntityHeaderController;
 import com.android.settingslib.applications.AppUtils;
 
-import static com.android.settings.widget.EntityHeaderController.ActionType;
-
 public abstract class AppInfoWithHeader extends AppInfoBase {
 
     private boolean mCreated;
@@ -44,7 +44,7 @@
         final Preference pref = EntityHeaderController
                 .newInstance(activity, this, null /* header */)
                 .setRecyclerView(getListView(), getLifecycle())
-                .setIcon(IconDrawableFactory.newInstance(activity)
+                .setIcon(IconDrawableFactory.newInstance(getContext())
                         .getBadgedIcon(mPackageInfo.applicationInfo))
                 .setLabel(mPackageInfo.applicationInfo.loadLabel(mPm))
                 .setSummary(mPackageInfo)
diff --git a/src/com/android/settings/development/BugReportInPowerPreferenceControllerV2.java b/src/com/android/settings/development/BugReportInPowerPreferenceController.java
similarity index 96%
rename from src/com/android/settings/development/BugReportInPowerPreferenceControllerV2.java
rename to src/com/android/settings/development/BugReportInPowerPreferenceController.java
index 0ab826f..31b618b 100644
--- a/src/com/android/settings/development/BugReportInPowerPreferenceControllerV2.java
+++ b/src/com/android/settings/development/BugReportInPowerPreferenceController.java
@@ -30,7 +30,7 @@
 import com.android.settingslib.development.DeveloperOptionsPreferenceController;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
-public class BugReportInPowerPreferenceControllerV2 extends
+public class BugReportInPowerPreferenceController extends
         DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
         PreferenceControllerMixin {
 
@@ -48,7 +48,7 @@
     private final UserManager mUserManager;
     private SwitchPreference mPreference;
 
-    public BugReportInPowerPreferenceControllerV2(Context context) {
+    public BugReportInPowerPreferenceController(Context context) {
         super(context);
         mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
         mPackageManager = new PackageManagerWrapper(context.getPackageManager());
diff --git a/src/com/android/settings/development/BugReportPreferenceControllerV2.java b/src/com/android/settings/development/BugReportPreferenceController.java
similarity index 89%
rename from src/com/android/settings/development/BugReportPreferenceControllerV2.java
rename to src/com/android/settings/development/BugReportPreferenceController.java
index 5876f84..ac2ae0d 100644
--- a/src/com/android/settings/development/BugReportPreferenceControllerV2.java
+++ b/src/com/android/settings/development/BugReportPreferenceController.java
@@ -22,14 +22,14 @@
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settingslib.development.DeveloperOptionsPreferenceController;
 
-public class BugReportPreferenceControllerV2 extends DeveloperOptionsPreferenceController implements
+public class BugReportPreferenceController extends DeveloperOptionsPreferenceController implements
         PreferenceControllerMixin {
 
     private static final String KEY_BUGREPORT = "bugreport";
 
     private final UserManager mUserManager;
 
-    public BugReportPreferenceControllerV2(Context context) {
+    public BugReportPreferenceController(Context context) {
         super(context);
 
         mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
diff --git a/src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2.java b/src/com/android/settings/development/CameraLaserSensorPreferenceController.java
similarity index 96%
rename from src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2.java
rename to src/com/android/settings/development/CameraLaserSensorPreferenceController.java
index 43943ac..41a7983 100644
--- a/src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2.java
+++ b/src/com/android/settings/development/CameraLaserSensorPreferenceController.java
@@ -29,7 +29,7 @@
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settingslib.development.DeveloperOptionsPreferenceController;
 
-public class CameraLaserSensorPreferenceControllerV2 extends
+public class CameraLaserSensorPreferenceController extends
         DeveloperOptionsPreferenceController implements
         Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
 
@@ -51,7 +51,7 @@
 
     private SwitchPreference mPreference;
 
-    public CameraLaserSensorPreferenceControllerV2(Context context) {
+    public CameraLaserSensorPreferenceController(Context context) {
         super(context);
     }
 
diff --git a/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2.java b/src/com/android/settings/development/ConnectivityMonitorPreferenceController.java
similarity index 96%
rename from src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2.java
rename to src/com/android/settings/development/ConnectivityMonitorPreferenceController.java
index fdcecfb..075af2b 100644
--- a/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2.java
+++ b/src/com/android/settings/development/ConnectivityMonitorPreferenceController.java
@@ -29,7 +29,7 @@
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settingslib.development.DeveloperOptionsPreferenceController;
 
-public class ConnectivityMonitorPreferenceControllerV2 extends
+public class ConnectivityMonitorPreferenceController extends
         DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
         PreferenceControllerMixin {
 
@@ -55,7 +55,7 @@
 
     private SwitchPreference mPreference;
 
-    public ConnectivityMonitorPreferenceControllerV2(Context context) {
+    public ConnectivityMonitorPreferenceController(Context context) {
         super(context);
     }
 
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 72eb30a..237f9ba 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -257,15 +257,15 @@
 
     @Override
     public void onDisableLogPersistDialogConfirmed() {
-        final LogPersistPreferenceControllerV2 controller = getDevelopmentOptionsController(
-                LogPersistPreferenceControllerV2.class);
+        final LogPersistPreferenceController controller = getDevelopmentOptionsController(
+                LogPersistPreferenceController.class);
         controller.onDisableLogPersistDialogConfirmed();
     }
 
     @Override
     public void onDisableLogPersistDialogRejected() {
-        final LogPersistPreferenceControllerV2 controller = getDevelopmentOptionsController(
-                LogPersistPreferenceControllerV2.class);
+        final LogPersistPreferenceController controller = getDevelopmentOptionsController(
+                LogPersistPreferenceController.class);
         controller.onDisableLogPersistDialogRejected();
     }
 
@@ -298,12 +298,15 @@
 
     @Override
     protected int getPreferenceScreenResId() {
-        Log.d(TAG, "Creating pref screen");
-        return R.xml.development_settings;
+        return Utils.isMonkeyRunning()? R.xml.placeholder_prefs : R.xml.development_settings;
     }
 
     @Override
     protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+        if (Utils.isMonkeyRunning()) {
+            mPreferenceControllers = new ArrayList<>();
+            return null;
+        }
         mPreferenceControllers = buildPreferenceControllers(context, getActivity(), getLifecycle(),
                 this /* devOptionsDashboardFragment */,
                 new BluetoothA2dpConfigStore());
@@ -326,6 +329,9 @@
     }
 
     private void enableDeveloperOptions() {
+        if (Utils.isMonkeyRunning()) {
+            return;
+        }
         DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), true);
         for (AbstractPreferenceController controller : mPreferenceControllers) {
             if (controller instanceof DeveloperOptionsPreferenceController) {
@@ -335,6 +341,9 @@
     }
 
     private void disableDeveloperOptions() {
+        if (Utils.isMonkeyRunning()) {
+            return;
+        }
         DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
         final SystemPropPoker poker = SystemPropPoker.getInstance();
         poker.blockPokes();
@@ -362,7 +371,7 @@
             BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
         controllers.add(new MemoryUsagePreferenceController(context));
-        controllers.add(new BugReportPreferenceControllerV2(context));
+        controllers.add(new BugReportPreferenceController(context));
         controllers.add(new LocalBackupPasswordPreferenceController(context));
         controllers.add(new StayAwakePreferenceController(context, lifecycle));
         controllers.add(new HdcpCheckingPreferenceController(context));
@@ -370,23 +379,23 @@
         controllers.add(new OemUnlockPreferenceController(context, activity, fragment));
         controllers.add(new FileEncryptionPreferenceController(context));
         controllers.add(new PictureColorModePreferenceController(context, lifecycle));
-        controllers.add(new WebViewAppPreferenceControllerV2(context));
+        controllers.add(new WebViewAppPreferenceController(context));
         controllers.add(new CoolColorTemperaturePreferenceController(context));
         controllers.add(new DisableAutomaticUpdatesPreferenceController(context));
         controllers.add(new AdbPreferenceController(context, fragment));
         controllers.add(new ClearAdbKeysPreferenceController(context, fragment));
         controllers.add(new LocalTerminalPreferenceController(context));
-        controllers.add(new BugReportInPowerPreferenceControllerV2(context));
+        controllers.add(new BugReportInPowerPreferenceController(context));
         controllers.add(new MockLocationAppPreferenceController(context, fragment));
         controllers.add(new DebugViewAttributesPreferenceController(context));
         controllers.add(new SelectDebugAppPreferenceController(context, fragment));
         controllers.add(new WaitForDebuggerPreferenceController(context));
         controllers.add(new EnableGpuDebugLayersPreferenceController(context));
-        controllers.add(new VerifyAppsOverUsbPreferenceControllerV2(context));
-        controllers.add(new LogdSizePreferenceControllerV2(context));
-        controllers.add(new LogPersistPreferenceControllerV2(context, fragment, lifecycle));
-        controllers.add(new ConnectivityMonitorPreferenceControllerV2(context));
-        controllers.add(new CameraLaserSensorPreferenceControllerV2(context));
+        controllers.add(new VerifyAppsOverUsbPreferenceController(context));
+        controllers.add(new LogdSizePreferenceController(context));
+        controllers.add(new LogPersistPreferenceController(context, fragment, lifecycle));
+        controllers.add(new ConnectivityMonitorPreferenceController(context));
+        controllers.add(new CameraLaserSensorPreferenceController(context));
         controllers.add(new WifiDisplayCertificationPreferenceController(context));
         controllers.add(new WifiVerboseLoggingPreferenceController(context));
         controllers.add(new WifiAggressiveHandoverPreferenceController(context));
diff --git a/src/com/android/settings/development/LogPersistPreferenceControllerV2.java b/src/com/android/settings/development/LogPersistPreferenceController.java
similarity index 95%
rename from src/com/android/settings/development/LogPersistPreferenceControllerV2.java
rename to src/com/android/settings/development/LogPersistPreferenceController.java
index 537b71b..a958379 100644
--- a/src/com/android/settings/development/LogPersistPreferenceControllerV2.java
+++ b/src/com/android/settings/development/LogPersistPreferenceController.java
@@ -26,14 +26,14 @@
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.development.AbstractLogpersistPreferenceController;
 
-public class LogPersistPreferenceControllerV2 extends
+public class LogPersistPreferenceController extends
         AbstractLogpersistPreferenceController implements PreferenceControllerMixin {
 
     private final DevelopmentSettingsDashboardFragment mFragment;
     private ListPreference mPreference;
 
 
-    public LogPersistPreferenceControllerV2(Context context,
+    public LogPersistPreferenceController(Context context,
             DevelopmentSettingsDashboardFragment fragment, Lifecycle lifecycle) {
         super(context, lifecycle);
 
diff --git a/src/com/android/settings/development/LogdSizePreferenceControllerV2.java b/src/com/android/settings/development/LogdSizePreferenceController.java
similarity index 91%
rename from src/com/android/settings/development/LogdSizePreferenceControllerV2.java
rename to src/com/android/settings/development/LogdSizePreferenceController.java
index 8194c48..6522800 100644
--- a/src/com/android/settings/development/LogdSizePreferenceControllerV2.java
+++ b/src/com/android/settings/development/LogdSizePreferenceController.java
@@ -24,12 +24,12 @@
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settingslib.development.AbstractLogdSizePreferenceController;
 
-public class LogdSizePreferenceControllerV2 extends AbstractLogdSizePreferenceController implements
+public class LogdSizePreferenceController extends AbstractLogdSizePreferenceController implements
         Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
 
     private ListPreference mPreference;
 
-    public LogdSizePreferenceControllerV2(Context context) {
+    public LogdSizePreferenceController(Context context) {
         super(context);
     }
 
diff --git a/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2.java b/src/com/android/settings/development/VerifyAppsOverUsbPreferenceController.java
similarity index 97%
rename from src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2.java
rename to src/com/android/settings/development/VerifyAppsOverUsbPreferenceController.java
index 6e3035e..f01da0d 100644
--- a/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2.java
+++ b/src/com/android/settings/development/VerifyAppsOverUsbPreferenceController.java
@@ -38,7 +38,7 @@
 /**
  * Controller to manage the state of "Verify apps over USB" toggle.
  */
-public class VerifyAppsOverUsbPreferenceControllerV2 extends
+public class VerifyAppsOverUsbPreferenceController extends
         DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
         AdbOnChangeListener, PreferenceControllerMixin {
     private static final String VERIFY_APPS_OVER_USB_KEY = "verify_apps_over_usb";
@@ -70,7 +70,7 @@
     // This field is accessed using reflection in the test, please keep name in sync.
     private final PackageManagerWrapper mPackageManager;
 
-    public VerifyAppsOverUsbPreferenceControllerV2(Context context) {
+    public VerifyAppsOverUsbPreferenceController(Context context) {
         super(context);
 
         mPackageManager = new PackageManagerWrapper(context.getPackageManager());
diff --git a/src/com/android/settings/development/WebViewAppPreferenceControllerV2.java b/src/com/android/settings/development/WebViewAppPreferenceController.java
similarity index 96%
rename from src/com/android/settings/development/WebViewAppPreferenceControllerV2.java
rename to src/com/android/settings/development/WebViewAppPreferenceController.java
index d061281..9ccb20b 100644
--- a/src/com/android/settings/development/WebViewAppPreferenceControllerV2.java
+++ b/src/com/android/settings/development/WebViewAppPreferenceController.java
@@ -31,7 +31,7 @@
 import com.android.settingslib.development.DeveloperOptionsPreferenceController;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
-public class WebViewAppPreferenceControllerV2 extends
+public class WebViewAppPreferenceController extends
         DeveloperOptionsPreferenceController implements PreferenceControllerMixin {
 
     private static final String TAG = "WebViewAppPrefCtrl";
@@ -42,7 +42,7 @@
 
     private Preference mPreference;
 
-    public WebViewAppPreferenceControllerV2(Context context) {
+    public WebViewAppPreferenceController(Context context) {
         super(context);
 
         mPackageManager = new PackageManagerWrapper(context.getPackageManager());
diff --git a/src/com/android/settings/fuelgauge/FakeUid.java b/src/com/android/settings/fuelgauge/FakeUid.java
index 2c3e3cf..2b5afe1 100644
--- a/src/com/android/settings/fuelgauge/FakeUid.java
+++ b/src/com/android/settings/fuelgauge/FakeUid.java
@@ -51,6 +51,11 @@
     }
 
     @Override
+    public Timer getMulticastWakelockStats() {
+        return null;
+    }
+
+    @Override
     public ArrayMap<String, ? extends Timer> getSyncStats() {
         return null;
     }
diff --git a/src/com/android/settings/notification/EmergencyBroadcastPreferenceController.java b/src/com/android/settings/notification/EmergencyBroadcastPreferenceController.java
index d6291a8..2eb9f6a 100644
--- a/src/com/android/settings/notification/EmergencyBroadcastPreferenceController.java
+++ b/src/com/android/settings/notification/EmergencyBroadcastPreferenceController.java
@@ -40,7 +40,6 @@
     private AccountRestrictionHelper mHelper;
     private UserManager mUserManager;
     private PackageManager mPm;
-    private boolean mCellBroadcastAppLinkEnabled;
 
     public EmergencyBroadcastPreferenceController(Context context, String prefKey) {
         this(context, new AccountRestrictionHelper(context), prefKey);
@@ -54,8 +53,6 @@
         mHelper = helper;
         mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
         mPm = mContext.getPackageManager();
-        // Enable link to CMAS app settings depending on the value in config.xml.
-        mCellBroadcastAppLinkEnabled = isCellBroadcastAppLinkEnabled();
     }
 
     @Override
@@ -79,12 +76,13 @@
 
     @Override
     public boolean isAvailable() {
-        return mUserManager.isAdminUser() && mCellBroadcastAppLinkEnabled
+        return mUserManager.isAdminUser() && isCellBroadcastAppLinkEnabled()
                 && !mHelper.hasBaseUserRestriction(
                 UserManager.DISALLOW_CONFIG_CELL_BROADCASTS, UserHandle.myUserId());
     }
 
     private boolean isCellBroadcastAppLinkEnabled() {
+        // Enable link to CMAS app settings depending on the value in config.xml.
         boolean enabled = mContext.getResources().getBoolean(
                 com.android.internal.R.bool.config_cellBroadcastAppLinks);
         if (enabled) {
diff --git a/src/com/android/settings/webview/WebViewAppPreferenceController.java b/src/com/android/settings/webview/WebViewAppPreferenceController.java
index 9410af7..18d874e 100644
--- a/src/com/android/settings/webview/WebViewAppPreferenceController.java
+++ b/src/com/android/settings/webview/WebViewAppPreferenceController.java
@@ -23,7 +23,7 @@
 import com.android.settings.applications.defaultapps.DefaultAppPreferenceController;
 
 /**
- * Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceControllerV2}
+ * Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceController}
  */
 @Deprecated
 public class WebViewAppPreferenceController extends DefaultAppPreferenceController {
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 435a998..4113c90 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -19,4 +19,5 @@
     <bool name="config_enableColorTemperature">false</bool>
     <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>
 </resources>
\ No newline at end of file
diff --git a/tests/robotests/res/values/config.xml b/tests/robotests/res/values/config.xml
index 9e2d911..4004106 100644
--- a/tests/robotests/res/values/config.xml
+++ b/tests/robotests/res/values/config.xml
@@ -20,4 +20,5 @@
     <bool name="config_enableColorTemperature">true</bool>
     <bool name="config_show_camera_laser_sensor">true</bool>
     <bool name="config_show_connectivity_monitor">true</bool>
+    <bool name="config_display_recent_apps">true</bool>
 </resources>
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java b/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
index 206ba95..17d1021 100644
--- a/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/SetupChooseLockPatternTest.java
@@ -30,6 +30,7 @@
 import com.android.settings.password.SetupChooseLockPattern;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
+import com.android.settings.testutils.shadow.SettingsShadowResourcesImpl;
 import com.android.settings.testutils.shadow.ShadowEventLogWriter;
 import com.android.settings.testutils.shadow.ShadowUtils;
 
@@ -44,9 +45,10 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION,
+        sdk = TestConfig.SDK_VERSION_O,
         shadows = {
                 SettingsShadowResources.class,
+                SettingsShadowResourcesImpl.class,
                 SettingsShadowResources.SettingsShadowTheme.class,
                 ShadowEventLogWriter.class,
                 ShadowUtils.class
@@ -62,7 +64,7 @@
                 PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                 PackageManager.DONT_KILL_APP);
 
-        mActivity =  Robolectric.buildActivity(
+        mActivity = Robolectric.buildActivity(
                 SetupChooseLockPattern.class,
                 SetupChooseLockPattern.modifyIntentForSetup(
                         application,
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
index cfed83b..8924551 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountDetailDashboardFragmentTest.java
@@ -55,7 +55,7 @@
 import static org.robolectric.Shadows.shadowOf;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class AccountDetailDashboardFragmentTest {
 
     private static final String METADATA_CATEGORY = "com.android.settings.category";
@@ -63,8 +63,6 @@
     private static final String METADATA_USER_HANDLE = "user_handle";
 
     @Mock(answer = RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock(answer = RETURNS_DEEP_STUBS)
     private AccountManager mAccountManager;
     @Mock
     private Preference mPreference;
@@ -129,11 +127,11 @@
 
     @Test
     public void refreshDashboardTiles_HasAccountType_shouldAddAccountNameToIntent() {
-        FakeFeatureFactory.setupForTest(mActivity);
+        FakeFeatureFactory.setupForTest(mContext);
         final FakeFeatureFactory featureFactory =
-                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
         final DashboardFeatureProviderImpl dashboardFeatureProvider =
-                new DashboardFeatureProviderImpl(mActivity);
+                new DashboardFeatureProviderImpl(mContext);
         final PackageManager packageManager = mock(PackageManager.class);
         ReflectionHelpers.setField(dashboardFeatureProvider, "mPackageManager", packageManager);
         when(packageManager.resolveActivity(any(Intent.class), anyInt()))
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java
index 4380e5c..1b20e96 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,
+    sdk = TestConfig.SDK_VERSION_O,
     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 139bee7..6daaeca 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 0778043..4399580 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 5fbd3a7..dde68f5 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 fff73b7..2e7f0fa 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 faaf7db..e00a0ae 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 4715f88..336de21 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
@@ -44,14 +44,14 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class AutoSyncDataPreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
     private PreferenceScreen mScreen;
     @Mock(answer = RETURNS_DEEP_STUBS)
     private UserManager mUserManager;
-    @Mock(answer = RETURNS_DEEP_STUBS)
+    @Mock
     private Fragment mFragment;
 
     private Preference mPreference;
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
index 597fbd4..50d4df8 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a25aa28..35a8bb6 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class AutoSyncWorkDataPreferenceControllerTest {
 
     private static int MANAGED_PROFILE_ID = 10;
diff --git a/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java b/tests/robotests/src/com/android/settings/accounts/ProviderPreferenceTest.java
index 4e4bb4f..4d1667f 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 d4e866f..8250340 100644
--- a/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java
@@ -40,6 +40,7 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.support.v14.preference.PreferenceFragment;
+import android.support.v7.preference.PreferenceManager;
 import android.support.v7.preference.PreferenceScreen;
 import android.widget.Button;
 
@@ -60,7 +61,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class RemoveAccountPreferenceControllerTest {
 
     private static final String KEY_REMOVE_ACCOUNT = "remove_account";
@@ -70,9 +71,11 @@
     private AccountManager mAccountManager;
     @Mock
     private DevicePolicyManagerWrapper mDevicePolicyManager;
-    @Mock(answer = RETURNS_DEEP_STUBS)
+    @Mock
     private PreferenceFragment mFragment;
     @Mock
+    private PreferenceManager mPreferenceManager;
+    @Mock
     private PreferenceScreen mScreen;
     @Mock
     private FragmentManager mFragmentManager;
@@ -92,7 +95,8 @@
         mContext = spy(shadowContext.getApplicationContext());
 
         when(mFragment.getPreferenceScreen()).thenReturn(mScreen);
-        when(mFragment.getPreferenceManager().getContext()).thenReturn(mContext);
+        when(mFragment.getPreferenceManager()).thenReturn(mPreferenceManager);
+        when(mPreferenceManager.getContext()).thenReturn(mContext);
         when(mFragment.getFragmentManager()).thenReturn(mFragmentManager);
         when(mFragmentManager.beginTransaction()).thenReturn(mFragmentTransaction);
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(
diff --git a/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/RemoveUserFragmentTest.java
index cd73068..ef23d22 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 8dba2f2..2383ed1 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 5a798f9..55141f7 100644
--- a/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppAndNotificationDashboardFragmentTest.java
@@ -16,32 +16,35 @@
 
 package com.android.settings.applications;
 
-import android.content.Context;
+import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
 import android.os.UserManager;
 
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.notification.EmergencyBroadcastPreferenceController;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.testutils.XmlTestUtils;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
-import org.robolectric.util.ReflectionHelpers;
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
 
 import java.util.List;
 
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class AppAndNotificationDashboardFragmentTest {
 
     @Test
+    @Config(shadows = {ShadowEmergencyBroadcastPreferenceController.class})
     public void testNonIndexableKeys_existInXmlLayout() {
         final Context context = spy(RuntimeEnvironment.application);
         UserManager manager = mock(UserManager.class);
@@ -56,4 +59,13 @@
 
         assertThat(keys).containsAllIn(niks);
     }
+
+    @Implements(EmergencyBroadcastPreferenceController.class)
+    public static class ShadowEmergencyBroadcastPreferenceController {
+
+        @Implementation
+        public boolean isAvailable() {
+            return true;
+        }
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java b/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
index 62395f3..75ae458 100644
--- a/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppInfoWithHeaderTest.java
@@ -16,6 +16,13 @@
 
 package com.android.settings.applications;
 
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import android.app.AlertDialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -49,14 +56,8 @@
 import org.robolectric.shadows.ShadowApplication;
 import org.robolectric.util.ReflectionHelpers;
 
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 2e52214..b0f0d0c 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 d63697e..6fadb43 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 62623e5..c88f878 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 1f6aea4..d254074 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 027bd33..62cb26c 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
@@ -8,8 +8,10 @@
 import android.content.Context;
 import android.support.v7.preference.Preference;
 
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settings.R;
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -18,11 +20,8 @@
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
-import com.android.settings.R;
-import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
-
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class AppStorageSizesControllerTest {
     private static final String COMPUTING = "Computing…";
     private static final String INVALID_SIZE = "Couldn’t compute package size.";
@@ -85,9 +84,9 @@
         mController.setResult(result);
         mController.updateUi(mContext);
 
-        assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
-        assertThat(mCachePreference.getSummary()).isEqualTo("10.00 B");
-        assertThat(mDataPreference.getSummary()).isEqualTo("90.00 B");
+        assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
+        assertThat(mCachePreference.getSummary()).isEqualTo("10 B");
+        assertThat(mDataPreference.getSummary()).isEqualTo("90 B");
         assertThat(mTotalPreference.getSummary()).isEqualTo("101 B");
     }
 
@@ -103,10 +102,10 @@
         mController.setCacheCleared(true);
         mController.updateUi(mContext);
 
-        assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
-        assertThat(mCachePreference.getSummary()).isEqualTo("0.00 B");
-        assertThat(mDataPreference.getSummary()).isEqualTo("90.00 B");
-        assertThat(mTotalPreference.getSummary()).isEqualTo("91.00 B");
+        assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
+        assertThat(mCachePreference.getSummary()).isEqualTo("0 B");
+        assertThat(mDataPreference.getSummary()).isEqualTo("90 B");
+        assertThat(mTotalPreference.getSummary()).isEqualTo("91 B");
     }
 
     @Test
@@ -121,9 +120,9 @@
         mController.setDataCleared(true);
         mController.updateUi(mContext);
 
-        assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
-        assertThat(mCachePreference.getSummary()).isEqualTo("0.00 B");
-        assertThat(mDataPreference.getSummary()).isEqualTo("0.00 B");
-        assertThat(mTotalPreference.getSummary()).isEqualTo("1.00 B");
+        assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
+        assertThat(mCachePreference.getSummary()).isEqualTo("0 B");
+        assertThat(mDataPreference.getSummary()).isEqualTo("0 B");
+        assertThat(mTotalPreference.getSummary()).isEqualTo("1 B");
     }
 }
diff --git a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
index 33d261f..eb3d94f 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 2e9328a..d7c8059 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 e5b7a66..dad02ef 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 9441707..78ec265 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 5d20a4c..38c0128 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 10caf13..8014dbb 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 3269acb..d34b2eb 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 58c4386..def8758 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 58a9577..b8a27b9 100644
--- a/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/InstalledAppDetailsTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.applications;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.anyDouble;
 import static org.mockito.Matchers.anyInt;
@@ -83,9 +84,9 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
-    manifest = TestConfig.MANIFEST_PATH,
-    sdk = TestConfig.SDK_VERSION,
-    shadows = InstalledAppDetailsTest.ShadowUtils.class
+        manifest = TestConfig.MANIFEST_PATH,
+        sdk = TestConfig.SDK_VERSION_O,
+        shadows = InstalledAppDetailsTest.ShadowUtils.class
 )
 public final class InstalledAppDetailsTest {
 
@@ -192,7 +193,7 @@
         when(stats.getTotalBytes()).thenReturn(1L);
 
         assertThat(InstalledAppDetails.getStorageSummary(context, stats, true))
-                .isEqualTo("1.00 B used in external storage");
+                .isEqualTo("1 B used in external storage");
     }
 
     @Test
@@ -202,7 +203,7 @@
         when(stats.getTotalBytes()).thenReturn(1L);
 
         assertThat(InstalledAppDetails.getStorageSummary(context, stats, false))
-                .isEqualTo("1.00 B used in internal storage");
+                .isEqualTo("1 B used in internal storage");
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java b/tests/robotests/src/com/android/settings/applications/InstalledAppListerTest.java
index c74deae..6a5cfeb 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public final class InstalledAppListerTest {
 
     private final String APP_1 = "app1";
diff --git a/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java b/tests/robotests/src/com/android/settings/applications/NotificationAppsTest.java
index 11d757f..735a811 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 02b8c7a..b998b81e 100644
--- a/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/PictureInPictureDetailsTest.java
@@ -39,7 +39,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class PictureInPictureDetailsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java b/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
index d379dbd..85b398a 100644
--- a/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/PictureInPictureSettingsTest.java
@@ -51,7 +51,7 @@
 import java.util.Collections;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 30ebcde..dedb61d 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class PremiumSmsAccessTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
index 5e85f9b..d0d8a3b 100644
--- a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
@@ -16,13 +16,30 @@
 
 package com.android.settings.applications;
 
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.argThat;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import android.app.Application;
 import android.app.usage.UsageStats;
 import android.app.usage.UsageStatsManager;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
-import android.content.res.Configuration;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
@@ -31,14 +48,13 @@
 import android.text.TextUtils;
 
 import com.android.settings.R;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settingslib.applications.ApplicationsState;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Answers;
 import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -47,25 +63,9 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Locale;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class RecentAppsPreferenceControllerTest {
 
     @Mock
@@ -76,14 +76,18 @@
     private Preference mSeeAllPref;
     @Mock
     private PreferenceCategory mDivider;
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Context mMockContext;
     @Mock
     private UsageStatsManager mUsageStatsManager;
     @Mock
     private UserManager mUserManager;
     @Mock
     private ApplicationsState mAppState;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private ApplicationsState.AppEntry mAppEntry;
+    @Mock
+    private ApplicationInfo mApplicationInfo;
 
     private Context mContext;
     private RecentAppsPreferenceController mController;
@@ -91,12 +95,11 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        when(mMockContext.getSystemService(Context.USAGE_STATS_SERVICE))
-                .thenReturn(mUsageStatsManager);
-        when(mMockContext.getSystemService(Context.USER_SERVICE))
-                .thenReturn(mUserManager);
+        mContext = spy(RuntimeEnvironment.application);
+        doReturn(mUsageStatsManager).when(mContext).getSystemService(Context.USAGE_STATS_SERVICE);
+        doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE);
+        doReturn(mPackageManager).when(mContext).getPackageManager();
 
-        mContext = RuntimeEnvironment.application;
         mController = new RecentAppsPreferenceController(mContext, mAppState, null);
         when(mScreen.findPreference(anyString())).thenReturn(mCategory);
 
@@ -125,7 +128,7 @@
     @Test
     public void onDisplayAndUpdateState_shouldRefreshUi() {
         mController = spy(
-                new RecentAppsPreferenceController(mMockContext, (Application) null, null));
+                new RecentAppsPreferenceController(mContext, (Application) null, null));
 
         doNothing().when(mController).refreshUi(mContext);
 
@@ -136,11 +139,8 @@
     }
 
     @Test
+    @Config(qualifiers = "mcc999")
     public void display_shouldNotShowRecents_showAppInfoPreference() {
-        mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
-        when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
-                .thenReturn(false);
-
         mController.displayPreference(mScreen);
 
         verify(mCategory, never()).addPreference(any(Preference.class));
@@ -152,8 +152,6 @@
 
     @Test
     public void display_showRecents() {
-        when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
-                .thenReturn(true);
         final List<UsageStats> stats = new ArrayList<>();
         final UsageStats stat1 = new UsageStats();
         final UsageStats stat2 = new UsageStats();
@@ -172,20 +170,17 @@
 
         // stat1, stat2 are valid apps. stat3 is invalid.
         when(mAppState.getEntry(stat1.mPackageName, UserHandle.myUserId()))
-                .thenReturn(mock(ApplicationsState.AppEntry.class));
+                .thenReturn(mAppEntry);
         when(mAppState.getEntry(stat2.mPackageName, UserHandle.myUserId()))
-                .thenReturn(mock(ApplicationsState.AppEntry.class));
+                .thenReturn(mAppEntry);
         when(mAppState.getEntry(stat3.mPackageName, UserHandle.myUserId()))
                 .thenReturn(null);
-        when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
-                .thenReturn(new ResolveInfo());
+        when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
+                new ResolveInfo());
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
-        final Configuration configuration = new Configuration();
-        configuration.locale = Locale.US;
-        when(mMockContext.getResources().getConfiguration()).thenReturn(configuration);
+        mAppEntry.info = mApplicationInfo;
 
-        mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
         mController.displayPreference(mScreen);
 
         verify(mCategory).setTitle(R.string.recent_app_category_title);
@@ -200,8 +195,6 @@
 
     @Test
     public void display_hasRecentButNoneDisplayable_showAppInfo() {
-        when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
-                .thenReturn(true);
         final List<UsageStats> stats = new ArrayList<>();
         final UsageStats stat1 = new UsageStats();
         final UsageStats stat2 = new UsageStats();
@@ -218,12 +211,11 @@
                 .thenReturn(mock(ApplicationsState.AppEntry.class));
         when(mAppState.getEntry(stat2.mPackageName, UserHandle.myUserId()))
                 .thenReturn(mock(ApplicationsState.AppEntry.class));
-        when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
-                .thenReturn(new ResolveInfo());
+        when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
+                new ResolveInfo());
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
 
-        mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
         mController.displayPreference(mScreen);
 
         verify(mCategory, never()).addPreference(any(Preference.class));
@@ -234,8 +226,6 @@
 
     @Test
     public void display_showRecents_formatSummary() {
-        when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
-            .thenReturn(true);
         final List<UsageStats> stats = new ArrayList<>();
         final UsageStats stat1 = new UsageStats();
         stat1.mLastTimeUsed = System.currentTimeMillis();
@@ -243,17 +233,13 @@
         stats.add(stat1);
 
         when(mAppState.getEntry(stat1.mPackageName, UserHandle.myUserId()))
-            .thenReturn(mock(ApplicationsState.AppEntry.class));
-        when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
-            .thenReturn(new ResolveInfo());
+                .thenReturn(mAppEntry);
+        when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
+                new ResolveInfo());
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
-            .thenReturn(stats);
+                .thenReturn(stats);
+        mAppEntry.info = mApplicationInfo;
 
-        final Configuration configuration = new Configuration();
-        configuration.locale = Locale.US;
-        when(mMockContext.getResources().getConfiguration()).thenReturn(configuration);
-
-        mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
         mController.displayPreference(mScreen);
 
         verify(mCategory).addPreference(argThat(summaryMatches("0 min. ago")));
diff --git a/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java
index f17addd..09bfc29 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 1a3aeb5..64ef4ff 100644
--- a/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/UsageAccessDetailsTest.java
@@ -41,7 +41,7 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class UsageAccessDetailsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java b/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
index d2f1bbd..5f9ec95 100644
--- a/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/VrListenerSettingsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class VrListenerSettingsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java b/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
index a995394..6cd07e3 100644
--- a/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/WriteSettingsDetailsTest.java
@@ -36,7 +36,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class WriteSettingsDetailsTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
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 c59ac18..253d6ea 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 1dec8d0..e062291 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 f0956c7..431cfba 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 65f0b46..1018872 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 180abbb..199862f 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 1b4fb09..6abf09d 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 d4cd6da..0b933c6 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
@@ -17,11 +17,17 @@
 package com.android.settings.applications.defaultapps;
 
 import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.content.ComponentName;
 import android.content.Context;
+import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageItemInfo;
 import android.content.pm.PackageManager;
 import android.graphics.drawable.Drawable;
@@ -39,7 +45,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class DefaultAppInfoTest {
 
     @Mock
@@ -50,15 +56,24 @@
     private PackageManager mPackageManager;
     @Mock
     private PackageManagerWrapper mPackageManagerWrapper;
+    @Mock
+    private ApplicationInfo mApplicationInfo;
+    @Mock
+    private Drawable mIcon;
 
     private Context mContext;
     private DefaultAppInfo mInfo;
 
     @Before
-    public void setUp() {
+    public void setUp() throws PackageManager.NameNotFoundException {
         MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
+        mContext = spy(RuntimeEnvironment.application);
+        doReturn(mPackageManager).when(mContext).getPackageManager();
         when(mPackageManagerWrapper.getPackageManager()).thenReturn(mPackageManager);
+        when(mPackageManagerWrapper.getApplicationInfoAsUser(anyString(), anyInt(),
+                anyInt())).thenReturn(mApplicationInfo);
+        when(mPackageManager.loadUnbadgedItemIcon(mPackageItemInfo, mApplicationInfo)).thenReturn(
+                mIcon);
     }
 
     @Test
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 42a6225..804df51 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a02a2de..f16c05e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 06d3b8b..61d7f34 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
@@ -43,7 +43,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 bc72ee4..8a181d8 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 e8a6c1e..934c4c6 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 8d527ff..b3406a1 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 124817a..d499ac2 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 4b82f1a..4680a08 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 8a8cc29..cf19655 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 6a73269..025d50a 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 f2b7db8..b1bea25 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 91e68ea..e9bdfe3 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 982fb56..2dde6f4 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 3fe5e67..ccd8470 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 c32b262..ebc0ddc 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 dfe8e4c..d208194 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,
+        sdk = TestConfig.SDK_VERSION_O,
         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 fc761cc..c7f2f53 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.applications.manageapplications;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Matchers.nullable;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -27,6 +28,7 @@
 import android.os.UserHandle;
 import android.os.storage.VolumeInfo;
 import android.provider.DocumentsContract;
+import android.text.format.Formatter;
 import android.view.View;
 import android.widget.FrameLayout;
 
@@ -46,7 +48,7 @@
 
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class MusicViewHolderControllerTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Fragment mFragment;
@@ -75,7 +77,8 @@
     public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
         mController.setupView(mHolder);
 
-        assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
+        assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+                Formatter.formatFileSize(mContext, 0));
     }
 
     @Test
@@ -86,7 +89,8 @@
         mController.queryStats();
         mController.setupView(mHolder);
 
-        assertThat(mHolder.mSummary.getText().toString()).isEqualTo("1.00 B");
+        assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+                Formatter.formatFileSize(mContext, 1));
     }
 
     @Test
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 0a147ac..fd25921 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.applications.manageapplications;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Matchers.nullable;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -26,6 +27,7 @@
 import android.content.Intent;
 import android.os.UserHandle;
 import android.os.storage.VolumeInfo;
+import android.text.format.Formatter;
 import android.view.View;
 import android.widget.FrameLayout;
 
@@ -44,11 +46,12 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class PhotosViewHolderControllerTest {
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Fragment mFragment;
-    @Mock private StorageStatsSource mSource;
+    @Mock
+    private StorageStatsSource mSource;
 
     private Context mContext;
     private PhotosViewHolderController mController;
@@ -74,7 +77,8 @@
     public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
         mController.setupView(mHolder);
 
-        assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
+        assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+                Formatter.formatFileSize(mContext, 0));
     }
 
     @Test
@@ -85,7 +89,8 @@
         mController.queryStats();
         mController.setupView(mHolder);
 
-        assertThat(mHolder.mSummary.getText().toString()).isEqualTo("11.00 B");
+        assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+                Formatter.formatFileSize(mContext, 11));
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
index 5fc3ebc..39cc9a2 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 44c7e10..cf3cb53 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 9de0c6a..eb33cd6 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 3ad49e7..83d9709 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 fd46b4b..3cc90bd 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 7b0a3f23..e7ce7e0 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         shadows = SettingsShadowBluetoothDevice.class)
 public class BluetoothDetailsButtonsControllerTest extends BluetoothDetailsControllerTestBase {
     private BluetoothDetailsButtonsController mController;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
index 33a5ed5..b03ecc1 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java
@@ -28,14 +28,20 @@
 import android.support.v7.preference.PreferenceScreen;
 
 import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import org.junit.Before;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 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)
 public class BluetoothDetailsControllerTestBase {
     protected Context mContext;
     protected Lifecycle mLifecycle;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
index 544b590..cd07a90 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 2e094e2..93de52d 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 bc1151b..3dd97bb 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDevicePreferenceTest.java
@@ -49,7 +49,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 cde95cd..186e274 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class BluetoothDeviceRenamePreferenceControllerTest {
 
     private static final String DEVICE_NAME = "Nightshade";
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothEnablerTest.java
index b973edb..102f0a7 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, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, 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 cdaf876..ed63fc4 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 c9d5746..534cace 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothMasterSwitchPreferenceControllerTest.java
@@ -47,7 +47,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 d1d4935..2b30ae4 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java
@@ -52,7 +52,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 fba11de..25a24d4 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 4459f61..192e447 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 0061ee5..e7a66fa 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 c772560..b177729 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 0c27412..cb04347 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothSummaryUpdaterTest.java
@@ -51,7 +51,7 @@
 import java.util.Set;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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/DeviceListPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
index 49efecb..169db24 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 3294ffd..f9b392e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a6793bb..56454b8 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, shadows = {
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, 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 9343721..71e9933 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java
@@ -46,7 +46,7 @@
 import org.robolectric.shadows.ShadowDialog;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a8ef4e6..65fe46c 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
@@ -50,7 +50,7 @@
 import org.robolectric.util.FragmentTestUtil;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class RemoteDeviceNameDialogFragmentTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java b/tests/robotests/src/com/android/settings/bluetooth/UtilsTest.java
index e0d4638..43583ed 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 static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         shadows = SettingsShadowResources.class)
 public class UtilsTest {
 
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
index de83f5e..4bcb299 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 static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class ConnectedDeviceDashboardFragment2Test {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/UsbModePreferenceControllerTest.java
index 7edde6e..59a5172 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class UsbModePreferenceControllerTest {
 
     @Mock(answer = RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/AppDataUsagePreferenceTest.java
index 15ca6e4..4f7e216 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 26071ed..75fec68 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
@@ -57,7 +57,7 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         shadows = ShadowEntityHeaderController.class)
 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 ac28e1d..b6547ab 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 8b635d2..d735342 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 9ddce53..a5dea97 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 748c317..cf790e9 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 ba2d5f1..1e2565e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 e60243b..57041fd 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 9ab88d3..59c99f4 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 dc53ca1..179f743 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 cdcd3a9..1dacc68 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 6eff393..e96b4e8 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 f20e50c..081337f 100644
--- a/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/UnrestrictedDataAccessTest.java
@@ -40,7 +40,7 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class UnrestrictedDataAccessTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/AutoTimeFormatPreferenceControllerTest.java
index 06969bb..f9784ef 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 d28cad1..f4c1596 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 5cbef72..950fd0d 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,
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
         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 f1d34f8..000dd2c 100644
--- a/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/DatePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 ada59f4..524a88e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 cd13513..2e975c3 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 89c5f47..afec523 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 ec26448..aa10a70 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimeZonePreferenceControllerTest.java
@@ -37,7 +37,7 @@
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 4c1794c..10e5e5c 100644
--- a/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/ZonePickerComparatorTest.java
@@ -23,7 +23,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 92807e9..09ff1cd 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class ZonePickerTest {
 
     private Activity mActivity;
diff --git a/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
similarity index 91%
rename from tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
index 6fa1400..82086dd 100644
--- a/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/BugReportInPowerPreferenceControllerTest.java
@@ -16,12 +16,11 @@
 
 package com.android.settings.development;
 
-import static com.android.settings.development
-        .BugReportInPowerPreferenceControllerV2.COMPONENT_NAME;
-import static com.android.settings.development
-        .BugReportInPowerPreferenceControllerV2.SETTING_VALUE_OFF;
-import static com.android.settings.development
-        .BugReportInPowerPreferenceControllerV2.SETTING_VALUE_ON;
+import static com.android.settings.development.BugReportInPowerPreferenceController.COMPONENT_NAME;
+import static com.android.settings.development.BugReportInPowerPreferenceController
+        .SETTING_VALUE_OFF;
+import static com.android.settings.development.BugReportInPowerPreferenceController
+        .SETTING_VALUE_ON;
 
 import static com.google.common.truth.Truth.assertThat;
 
@@ -53,7 +52,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class BugReportInPowerPreferenceControllerV2Test {
+public class BugReportInPowerPreferenceControllerTest {
 
     @Mock
     private PreferenceScreen mScreen;
@@ -67,7 +66,7 @@
     private SwitchPreference mPreference;
 
     private ContentResolver mContentResolver;
-    private BugReportInPowerPreferenceControllerV2 mController;
+    private BugReportInPowerPreferenceController mController;
 
     @Before
     public void setUp() {
@@ -75,7 +74,7 @@
         mContentResolver = RuntimeEnvironment.application.getContentResolver();
         when(mContext.getContentResolver()).thenReturn(mContentResolver);
         when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        mController = new BugReportInPowerPreferenceControllerV2(mContext);
+        mController = new BugReportInPowerPreferenceController(mContext);
         when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
         ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
     }
diff --git a/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
similarity index 91%
rename from tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
index 9b4cde6..908c519 100644
--- a/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/BugReportPreferenceControllerTest.java
@@ -36,20 +36,20 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class BugReportPreferenceControllerV2Test {
+public class BugReportPreferenceControllerTest {
 
     @Mock
     private Context mContext;
     @Mock
     private UserManager mUserManager;
 
-    private BugReportPreferenceControllerV2 mController;
+    private BugReportPreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        mController = new BugReportPreferenceControllerV2(mContext);
+        mController = new BugReportPreferenceController(mContext);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
similarity index 75%
rename from tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
index 87967b9..1443d16 100644
--- a/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/CameraLaserSensorPreferenceControllerTest.java
@@ -16,18 +16,16 @@
 
 package com.android.settings.development;
 
-import static com.android.settings.development.CameraLaserSensorPreferenceControllerV2.ENG_BUILD;
-import static com.android.settings.development
-        .CameraLaserSensorPreferenceControllerV2.USERDEBUG_BUILD;
-import static com.android.settings.development.CameraLaserSensorPreferenceControllerV2.USER_BUILD;
+import static com.android.settings.development.CameraLaserSensorPreferenceController.ENG_BUILD;
+import static com.android.settings.development.CameraLaserSensorPreferenceController
+        .USERDEBUG_BUILD;
+import static com.android.settings.development.CameraLaserSensorPreferenceController.USER_BUILD;
 
 import android.content.Context;
-import android.content.res.Resources;
 import android.os.SystemProperties;
 import android.support.v14.preference.SwitchPreference;
 import android.support.v7.preference.PreferenceScreen;
 
-import com.android.settings.R;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
@@ -36,7 +34,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 +47,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
-public class CameraLaserSensorPreferenceControllerV2Test {
+public class CameraLaserSensorPreferenceControllerTest {
 
     @Mock
     private PreferenceScreen mScreen;
@@ -59,13 +56,13 @@
 
     private Context mContext;
 
-    private CameraLaserSensorPreferenceControllerV2 mController;
+    private CameraLaserSensorPreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
-        mController = new CameraLaserSensorPreferenceControllerV2(mContext);
+        mController = new CameraLaserSensorPreferenceController(mContext);
         when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
         when(mPreference.getKey()).thenReturn(mController.getPreferenceKey());
         mController.displayPreference(mScreen);
@@ -85,7 +82,7 @@
     @Test
     public void isAvailable_withUserdebugBuild_shouldReturnTrue() {
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                CameraLaserSensorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         assertThat(mController.isAvailable()).isTrue();
     }
@@ -93,7 +90,7 @@
     @Test
     public void isAvailable_withEngBuild_shouldReturnTrue() {
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.BUILD_TYPE, ENG_BUILD);
+                CameraLaserSensorPreferenceController.BUILD_TYPE, ENG_BUILD);
 
         assertThat(mController.isAvailable()).isTrue();
     }
@@ -101,7 +98,7 @@
     @Test
     public void isAvailable_withUserBuild_shouldReturnFalse() {
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.BUILD_TYPE, USER_BUILD);
+                CameraLaserSensorPreferenceController.BUILD_TYPE, USER_BUILD);
 
         assertThat(mController.isAvailable()).isFalse();
     }
@@ -109,10 +106,10 @@
     @Test
     public void updateState_cameraLaserSensorEnabled_shouldCheckedPreference() {
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.PROPERTY_CAMERA_LASER_SENSOR,
-                Integer.toString(CameraLaserSensorPreferenceControllerV2.ENABLED));
+                CameraLaserSensorPreferenceController.PROPERTY_CAMERA_LASER_SENSOR,
+                Integer.toString(CameraLaserSensorPreferenceController.ENABLED));
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                CameraLaserSensorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mScreen);
 
@@ -122,10 +119,10 @@
     @Test
     public void updateState_cameraLaserSensorEnabled_shouldUncheckedPreference() {
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.PROPERTY_CAMERA_LASER_SENSOR,
-                Integer.toString(CameraLaserSensorPreferenceControllerV2.DISABLED));
+                CameraLaserSensorPreferenceController.PROPERTY_CAMERA_LASER_SENSOR,
+                Integer.toString(CameraLaserSensorPreferenceController.DISABLED));
         SettingsShadowSystemProperties.set(
-                CameraLaserSensorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                CameraLaserSensorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mScreen);
 
@@ -136,20 +133,20 @@
     public void onPreferenceChange_preferenceChecked_shouldEnableCameraLaserSensor() {
         mController.onPreferenceChange(mPreference, true);
 
-        assertThat(Integer.toString(CameraLaserSensorPreferenceControllerV2.ENABLED)).isEqualTo(
+        assertThat(Integer.toString(CameraLaserSensorPreferenceController.ENABLED)).isEqualTo(
                 SystemProperties.get(
-                        CameraLaserSensorPreferenceControllerV2.PROPERTY_CAMERA_LASER_SENSOR,
-                        Integer.toString(CameraLaserSensorPreferenceControllerV2.ENABLED)));
+                        CameraLaserSensorPreferenceController.PROPERTY_CAMERA_LASER_SENSOR,
+                        Integer.toString(CameraLaserSensorPreferenceController.ENABLED)));
     }
 
     @Test
     public void onPreferenceChange__preferenceUnchecked_shouldDisableCameraLaserSensor() {
         mController.onPreferenceChange(mPreference, false);
 
-        assertThat(Integer.toString(CameraLaserSensorPreferenceControllerV2.DISABLED)).isEqualTo(
+        assertThat(Integer.toString(CameraLaserSensorPreferenceController.DISABLED)).isEqualTo(
                 SystemProperties.get(
-                        CameraLaserSensorPreferenceControllerV2.PROPERTY_CAMERA_LASER_SENSOR,
-                        Integer.toString(CameraLaserSensorPreferenceControllerV2.ENABLED)));
+                        CameraLaserSensorPreferenceController.PROPERTY_CAMERA_LASER_SENSOR,
+                        Integer.toString(CameraLaserSensorPreferenceController.ENABLED)));
     }
 
     @Test
@@ -165,9 +162,9 @@
 
         verify(mPreference).setEnabled(false);
         verify(mPreference).setChecked(false);
-        assertThat(Integer.toString(CameraLaserSensorPreferenceControllerV2.DISABLED)).isEqualTo(
+        assertThat(Integer.toString(CameraLaserSensorPreferenceController.DISABLED)).isEqualTo(
                 SystemProperties.get(
-                        CameraLaserSensorPreferenceControllerV2.PROPERTY_CAMERA_LASER_SENSOR,
-                        Integer.toString(CameraLaserSensorPreferenceControllerV2.ENABLED)));
+                        CameraLaserSensorPreferenceController.PROPERTY_CAMERA_LASER_SENSOR,
+                        Integer.toString(CameraLaserSensorPreferenceController.ENABLED)));
     }
 }
diff --git a/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
similarity index 66%
rename from tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
index 5b4f594..5e99ec9 100644
--- a/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/ConnectivityMonitorPreferenceControllerTest.java
@@ -16,9 +16,9 @@
 
 package com.android.settings.development;
 
-import static com.android.settings.development.ConnectivityMonitorPreferenceControllerV2.ENG_BUILD;
-import static com.android.settings.development
-        .ConnectivityMonitorPreferenceControllerV2.USERDEBUG_BUILD;
+import static com.android.settings.development.ConnectivityMonitorPreferenceController.ENG_BUILD;
+import static com.android.settings.development.ConnectivityMonitorPreferenceController
+        .USERDEBUG_BUILD;
 
 import static com.google.common.truth.Truth.assertThat;
 
@@ -45,7 +45,7 @@
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows =
         SettingsShadowSystemProperties.class)
-public class ConnectivityMonitorPreferenceControllerV2Test {
+public class ConnectivityMonitorPreferenceControllerTest {
 
     private static final String USER_BUILD = "user";
 
@@ -55,14 +55,14 @@
     private SwitchPreference mPreference;
 
     private Context mContext;
-    private ConnectivityMonitorPreferenceControllerV2 mController;
+    private ConnectivityMonitorPreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         SettingsShadowSystemProperties.clear();
         mContext = RuntimeEnvironment.application;
-        mController = new ConnectivityMonitorPreferenceControllerV2(mContext);
+        mController = new ConnectivityMonitorPreferenceController(mContext);
         when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
         mController.displayPreference(mScreen);
     }
@@ -70,7 +70,7 @@
     @Test
     public void isAvailable_trueShowFlagWithUserdebugBuild_shouldReturnTrue() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         assertThat(mController.isAvailable()).isTrue();
     }
@@ -78,7 +78,7 @@
     @Test
     public void isAvailable_trueShowFlagWithEngBuild_shouldReturnTrue() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, ENG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, ENG_BUILD);
 
         assertThat(mController.isAvailable()).isTrue();
     }
@@ -86,7 +86,7 @@
     @Test
     public void isAvailable_trueShowFlagWithUserBuild_shouldReturnFalse() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USER_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USER_BUILD);
 
         assertThat(mController.isAvailable()).isFalse();
     }
@@ -95,7 +95,7 @@
     @Config(qualifiers = "mcc999")
     public void isAvailable_falseShowFlagWithUserdebugBuild_shouldReturnFalse() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         assertThat(mController.isAvailable()).isFalse();
     }
@@ -104,7 +104,7 @@
     @Config(qualifiers = "mcc999")
     public void isAvailable_falseShowFlagWithEngBuild_shouldReturnFalse() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, ENG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, ENG_BUILD);
 
         assertThat(mController.isAvailable()).isFalse();
     }
@@ -113,7 +113,7 @@
     @Config(qualifiers = "mcc999")
     public void isAvailable_falseShowFlagWithUserBuild_shouldReturnFalse() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USER_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USER_BUILD);
 
         assertThat(mController.isAvailable()).isFalse();
     }
@@ -121,10 +121,10 @@
     @Test
     public void updateState_connectivityMonitorEnabled_shouldCheckedPreference() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.ENABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.ENABLED_STATUS);
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mPreference);
 
@@ -134,10 +134,10 @@
     @Test
     public void updateState_connectivityMonitorUserEnabled_shouldCheckedPreference() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.USER_ENABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.USER_ENABLED_STATUS);
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mPreference);
 
@@ -147,10 +147,10 @@
     @Test
     public void updateState_connectivityMonitorDisabled_shouldUncheckedPreference() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.DISABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.DISABLED_STATUS);
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mPreference);
 
@@ -160,10 +160,10 @@
     @Test
     public void updateState_connectivityMonitorUserDisabled_shouldUncheckedPreference() {
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.USER_DISABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.USER_DISABLED_STATUS);
         SettingsShadowSystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.BUILD_TYPE, USERDEBUG_BUILD);
+                ConnectivityMonitorPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
 
         mController.updateState(mPreference);
 
@@ -173,29 +173,29 @@
     @Test
     public void onPreferenceChange_preferenceChecked_shouldEnableConnectivityMonitor() {
         SystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.USER_ENABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.USER_ENABLED_STATUS);
 
         mController.handlePreferenceTreeClick(mPreference);
 
-        assertThat(ConnectivityMonitorPreferenceControllerV2.USER_ENABLED_STATUS).isEqualTo(
+        assertThat(ConnectivityMonitorPreferenceController.USER_ENABLED_STATUS).isEqualTo(
                 SystemProperties.get(
-                        ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                        ConnectivityMonitorPreferenceControllerV2.DISABLED_STATUS));
+                        ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                        ConnectivityMonitorPreferenceController.DISABLED_STATUS));
     }
 
     @Test
     public void onPreferenceChange_preferenceUnchecked_shouldDisableConnectivityMonitor() {
         SystemProperties.set(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                ConnectivityMonitorPreferenceControllerV2.USER_DISABLED_STATUS);
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.USER_DISABLED_STATUS);
 
         mController.handlePreferenceTreeClick(mPreference);
 
-        assertThat(ConnectivityMonitorPreferenceControllerV2.USER_DISABLED_STATUS).isEqualTo(
+        assertThat(ConnectivityMonitorPreferenceController.USER_DISABLED_STATUS).isEqualTo(
                 SystemProperties.get(
-                        ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
-                        ConnectivityMonitorPreferenceControllerV2.DISABLED_STATUS));
+                        ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
+                        ConnectivityMonitorPreferenceController.DISABLED_STATUS));
     }
 
     @Test
@@ -210,10 +210,10 @@
         mController.onDeveloperOptionsSwitchDisabled();
 
         String mode = SystemProperties.get(
-                ConnectivityMonitorPreferenceControllerV2.PROPERTY_CONNECTIVITY_MONITOR,
+                ConnectivityMonitorPreferenceController.PROPERTY_CONNECTIVITY_MONITOR,
                 null /* default */);
 
-        assertThat(mode).isEqualTo(ConnectivityMonitorPreferenceControllerV2.USER_DISABLED_STATUS);
+        assertThat(mode).isEqualTo(ConnectivityMonitorPreferenceController.USER_DISABLED_STATUS);
         verify(mPreference).setEnabled(false);
         verify(mPreference).setChecked(false);
     }
diff --git a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
index 5449353..881ee84 100644
--- a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java
@@ -223,10 +223,10 @@
 
     @Test
     public void onDisableLogPersistDialogConfirmed_shouldCallControllerDialogConfirmed() {
-        final LogPersistPreferenceControllerV2 controller = mock(
-                LogPersistPreferenceControllerV2.class);
+        final LogPersistPreferenceController controller = mock(
+                LogPersistPreferenceController.class);
         doReturn(controller).when(mDashboard).getDevelopmentOptionsController(
-                LogPersistPreferenceControllerV2.class);
+                LogPersistPreferenceController.class);
         mDashboard.onDisableLogPersistDialogConfirmed();
 
         verify(controller).onDisableLogPersistDialogConfirmed();
@@ -234,10 +234,10 @@
 
     @Test
     public void onDisableLogPersistDialogRejected_shouldCallControllerDialogRejected() {
-        final LogPersistPreferenceControllerV2 controller = mock(
-                LogPersistPreferenceControllerV2.class);
+        final LogPersistPreferenceController controller = mock(
+                LogPersistPreferenceController.class);
         doReturn(controller).when(mDashboard).getDevelopmentOptionsController(
-                LogPersistPreferenceControllerV2.class);
+                LogPersistPreferenceController.class);
         mDashboard.onDisableLogPersistDialogRejected();
 
         verify(controller).onDisableLogPersistDialogRejected();
diff --git a/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
similarity index 92%
rename from tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
index ddc0da5..1dc1255 100644
--- a/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/LogPersistPreferenceControllerTest.java
@@ -42,7 +42,7 @@
 @Config(manifest = TestConfig.MANIFEST_PATH,
         sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
-public class LogPersistPreferenceControllerV2Test {
+public class LogPersistPreferenceControllerTest {
 
     @Mock
     private ListPreference mPreference;
@@ -52,7 +52,7 @@
     private DevelopmentSettingsDashboardFragment mFragment;
 
     private Context mContext;
-    private LogPersistPreferenceControllerV2 mController;
+    private LogPersistPreferenceController mController;
     private Lifecycle mLifecycle;
 
     @Before
@@ -60,7 +60,7 @@
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
         mLifecycle = new Lifecycle(() -> mLifecycle);
-        mController = new LogPersistPreferenceControllerV2(mContext, mFragment, mLifecycle);
+        mController = new LogPersistPreferenceController(mContext, mFragment, mLifecycle);
         when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
         SystemProperties.set("ro.debuggable", "1");
         mController.displayPreference(mScreen);
diff --git a/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
similarity index 94%
rename from tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
index 71766c3..f7be653 100644
--- a/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/LogdSizePreferenceControllerTest.java
@@ -41,7 +41,7 @@
 @Config(manifest = TestConfig.MANIFEST_PATH,
         sdk = TestConfig.SDK_VERSION,
         shadows = {SettingsShadowSystemProperties.class})
-public class LogdSizePreferenceControllerV2Test {
+public class LogdSizePreferenceControllerTest {
 
     @Mock
     private PreferenceScreen mScreen;
@@ -61,7 +61,7 @@
     private String[] mListValues;
     private String[] mListSummaries;
     private Context mContext;
-    private LogdSizePreferenceControllerV2 mController;
+    private LogdSizePreferenceController mController;
 
     @Before
     public void setup() {
@@ -69,7 +69,7 @@
         mContext = RuntimeEnvironment.application;
         mListValues = mContext.getResources().getStringArray(R.array.select_logd_size_values);
         mListSummaries = mContext.getResources().getStringArray(R.array.select_logd_size_summaries);
-        mController = new LogdSizePreferenceControllerV2(mContext);
+        mController = new LogdSizePreferenceController(mContext);
         when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
         mController.displayPreference(mScreen);
     }
diff --git a/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
similarity index 95%
rename from tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
index 9e60295..e396ebe 100644
--- a/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/VerifyAppsOverUsbPreferenceControllerTest.java
@@ -52,7 +52,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class VerifyAppsOverUsbPreferenceControllerV2Test {
+public class VerifyAppsOverUsbPreferenceControllerTest {
 
     @Mock
     private PackageManagerWrapper mPackageManager;
@@ -62,11 +62,11 @@
     private RestrictedSwitchPreference mPreference;
 
     @Mock
-    private VerifyAppsOverUsbPreferenceControllerV2.RestrictedLockUtilsDelegate
+    private VerifyAppsOverUsbPreferenceController.RestrictedLockUtilsDelegate
             mRestrictedLockUtilsDelegate;
 
     private Context mContext;
-    private VerifyAppsOverUsbPreferenceControllerV2 mController;
+    private VerifyAppsOverUsbPreferenceController mController;
 
     /** Convenience class for setting global int settings. */
     class GlobalSetter {
@@ -83,7 +83,7 @@
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
         when(mScreen.findPreference(anyString())).thenReturn(mPreference);
-        mController = new VerifyAppsOverUsbPreferenceControllerV2(mContext);
+        mController = new VerifyAppsOverUsbPreferenceController(mContext);
         ReflectionHelpers.setField(
                 mController, "mRestrictedLockUtils", mRestrictedLockUtilsDelegate);
         ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
@@ -188,7 +188,7 @@
         final int mode = Settings.Global.getInt(mContext.getContentResolver(),
                 android.provider.Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, -1 /* default */);
 
-        assertThat(mode).isEqualTo(VerifyAppsOverUsbPreferenceControllerV2.SETTING_VALUE_ON);
+        assertThat(mode).isEqualTo(VerifyAppsOverUsbPreferenceController.SETTING_VALUE_ON);
     }
 
     @Test
@@ -198,7 +198,7 @@
         final int mode = Settings.Global.getInt(mContext.getContentResolver(),
                 android.provider.Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, -1 /* default */);
 
-        assertThat(mode).isEqualTo(VerifyAppsOverUsbPreferenceControllerV2.SETTING_VALUE_OFF);
+        assertThat(mode).isEqualTo(VerifyAppsOverUsbPreferenceController.SETTING_VALUE_OFF);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerV2Test.java b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
similarity index 94%
rename from tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerV2Test.java
rename to tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
index 4f9540f..59f6e35 100644
--- a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerV2Test.java
+++ b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
@@ -43,7 +43,7 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class WebViewAppPreferenceControllerV2Test {
+public class WebViewAppPreferenceControllerTest {
 
     @Mock
     private PreferenceScreen mPreferenceScreen;
@@ -57,13 +57,13 @@
     private DefaultAppInfo mAppInfo;
 
     private Context mContext;
-    private WebViewAppPreferenceControllerV2 mController;
+    private WebViewAppPreferenceController mController;
 
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
-        mController = spy(new WebViewAppPreferenceControllerV2(mContext));
+        mController = spy(new WebViewAppPreferenceController(mContext));
         ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
         ReflectionHelpers.setField(mController, "mWebViewUpdateServiceWrapper",
                 mWebViewUpdateServiceWrapper);
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResources.java b/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResources.java
index 183f5ad..b0cd484 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResources.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResources.java
@@ -101,6 +101,13 @@
         return directlyOn(realResources, Resources.class).getColorStateList(id, theme);
     }
 
+    /**
+     * Deprecated because SDK 24+ uses
+     * {@link SettingsShadowResourcesImpl#loadDrawable(Resources, TypedValue, int, int, Theme)}
+     *
+     * TODO: Delete when all tests have been migrated to sdk 26
+     */
+    @Deprecated
     @Implementation
     public Drawable loadDrawable(TypedValue value, int id, Theme theme)
             throws NotFoundException {
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResourcesImpl.java b/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResourcesImpl.java
new file mode 100644
index 0000000..42b02f3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/SettingsShadowResourcesImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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.testutils.shadow;
+
+import android.content.res.Resources;
+import android.content.res.ResourcesImpl;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.util.TypedValue;
+
+import com.android.settings.R;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+import org.robolectric.shadows.ShadowResourcesImpl;
+
+@Implements(
+        value = ResourcesImpl.class,
+        isInAndroidSdk = false,
+        minSdk = 26
+)
+public class SettingsShadowResourcesImpl extends ShadowResourcesImpl {
+
+    @Implementation
+    public Drawable loadDrawable(Resources wrapper, TypedValue value, int id, int density,
+            Resources.Theme theme) {
+        // The drawable item in switchbar_background.xml refers to a very recent color attribute
+        // that Robolectric isn't yet aware of.
+        // TODO: Remove this once Robolectric is updated.
+        if (id == R.drawable.switchbar_background) {
+            return new ColorDrawable();
+        } else if (id == R.drawable.ic_launcher_settings) {
+            // ic_launcher_settings uses adaptive-icon, which is not supported by robolectric,
+            // change it to a normal drawable.
+            id = R.drawable.ic_settings_wireless;
+        } else if (id == R.drawable.app_filter_spinner_background) {
+            id = R.drawable.ic_expand_more_inverse;
+        } else if (id == R.drawable.selectable_card_grey) {
+            id = R.drawable.ic_expand_more_inverse;
+        }
+        return super.loadDrawable(wrapper, value, id, density, theme);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/webview/WebViewAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/webview/WebViewAppPreferenceControllerTest.java
index 08ecc9b..9404e53 100644
--- a/tests/robotests/src/com/android/settings/webview/WebViewAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/webview/WebViewAppPreferenceControllerTest.java
@@ -31,7 +31,7 @@
 import org.robolectric.annotation.Config;
 
 /**
- * Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceControllerV2}
+ * Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceController}
  */
 @Deprecated
 @RunWith(SettingsRobolectricTestRunner.class)
diff --git a/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java b/tests/robotests/src/com/android/settings/widget/ActionBarShadowControllerTest.java
index 0f3eb31..f69012e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a080bc6..a215967 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 d489094..6481f8a 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a7c8d7c..81537a8 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 dd6138c..4a19258 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 7fcf328..47a9aa6 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 9c6ee45..af30e4f 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 static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class 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 0d9a77b..5022ceb 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 09b52c8..6ab2b17 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 1c449cc..c80c7b4 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 23aa378..d8661bf 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 8ca68ae..9fc5b2e 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 a1a2f24..0226c22 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 78afc43..1072152 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,
+    sdk = TestConfig.SDK_VERSION_O,
     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 5755015..8e91259 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 2f42550..8dbe552 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 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 59be160..ff2332c 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)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
 public class ValidatedEditTextPreferenceTest {
 
     @Mock