diff --git a/res/xml/enterprise_privacy_settings.xml b/res/xml/enterprise_privacy_settings.xml
index 4fa50e7..0aa1415 100644
--- a/res/xml/enterprise_privacy_settings.xml
+++ b/res/xml/enterprise_privacy_settings.xml
@@ -83,6 +83,9 @@
         <Preference android:key="ca_certs_managed_profile"
                     android:title="@string/enterprise_privacy_ca_certs_work"
                     android:selectable="false"/>
+        <Preference android:key="backups_enabled"
+                    android:title="@string/enterprise_privacy_backups_enabled"
+                    android:selectable="false"/>
     </PreferenceCategory>
 
     <PreferenceCategory android:key="device_access_category"
diff --git a/res/xml/network_and_internet.xml b/res/xml/network_and_internet.xml
index a28b1e6..ee99998 100644
--- a/res/xml/network_and_internet.xml
+++ b/res/xml/network_and_internet.xml
@@ -18,7 +18,8 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:key="network_and_internet_screen"
-    android:title="@string/network_dashboard_title">
+    android:title="@string/network_dashboard_title"
+    settings:initialExpandedChildrenCount="5">
 
     <com.android.settings.widget.MasterSwitchPreference
         android:fragment="com.android.settings.wifi.WifiSettings"
@@ -59,19 +60,10 @@
         settings:useAdminDisabledSummary="true" />
 
     <com.android.settingslib.RestrictedPreference
-        android:fragment="com.android.settings.vpn2.VpnSettings"
-        android:key="vpn_settings"
-        android:title="@string/vpn_settings_title"
-        android:icon="@drawable/ic_vpn_key"
-        android:order="0"
-        android:summary="@string/summary_placeholder"
-        settings:userRestriction="no_config_vpn"
-        settings:useAdminDisabledSummary="true" />
-
-    <com.android.settingslib.RestrictedPreference
         android:key="manage_mobile_plan"
         android:title="@string/manage_mobile_plan_title"
         android:persistent="false"
+        android:order="0"
         settings:userRestriction="no_config_mobile_networks"
         settings:useAdminDisabledSummary="true" />
 
@@ -88,4 +80,22 @@
         android:key="proxy_settings"
         android:title="@string/proxy_settings_title" />
 
-</PreferenceScreen>
\ No newline at end of file
+    <com.android.settingslib.RestrictedPreference
+        android:fragment="com.android.settings.vpn2.VpnSettings"
+        android:key="vpn_settings"
+        android:title="@string/vpn_settings_title"
+        android:icon="@drawable/ic_vpn_key"
+        android:order="10"
+        android:summary="@string/summary_placeholder"
+        settings:userRestriction="no_config_vpn"
+        settings:useAdminDisabledSummary="true" />
+
+    <com.android.settings.network.PrivateDnsModeDialogPreference
+        android:key="private_dns_settings"
+        android:title="@string/select_private_dns_configuration_title"
+        android:order="15"
+        android:dialogTitle="@string/select_private_dns_configuration_dialog_title"
+        android:dialogLayout="@layout/private_dns_mode_dialog"
+        android:positiveButtonText="@string/save" />
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/applications/AppStateAppOpsBridge.java b/src/com/android/settings/applications/AppStateAppOpsBridge.java
index e0c19ff..1f843b9 100755
--- a/src/com/android/settings/applications/AppStateAppOpsBridge.java
+++ b/src/com/android/settings/applications/AppStateAppOpsBridge.java
@@ -19,6 +19,7 @@
 import android.app.AppOpsManager;
 import android.app.AppOpsManager.PackageOps;
 import android.content.Context;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.os.RemoteException;
@@ -31,7 +32,6 @@
 
 import com.android.settingslib.applications.ApplicationsState;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -47,7 +47,7 @@
 
     private static final String TAG = "AppStateAppOpsBridge";
 
-    private final IPackageManagerWrapper mIPackageManager;
+    private final IPackageManager mIPackageManager;
     private final UserManager mUserManager;
     private final List<UserHandle> mProfiles;
     private final AppOpsManager mAppOpsManager;
@@ -58,12 +58,12 @@
     public AppStateAppOpsBridge(Context context, ApplicationsState appState, Callback callback,
             int appOpsOpCode, String[] permissions) {
         this(context, appState, callback, appOpsOpCode, permissions,
-            new IPackageManagerWrapper(AppGlobals.getPackageManager()));
+                AppGlobals.getPackageManager());
     }
 
     @VisibleForTesting
     AppStateAppOpsBridge(Context context, ApplicationsState appState, Callback callback,
-            int appOpsOpCode, String[] permissions, IPackageManagerWrapper packageManager) {
+            int appOpsOpCode, String[] permissions, IPackageManager packageManager) {
         super(appState, callback);
         mContext = context;
         mIPackageManager = packageManager;
@@ -210,9 +210,10 @@
                 if (entriesForProfile == null) {
                     continue;
                 }
-                @SuppressWarnings("unchecked")
-                final List<PackageInfo> packageInfos = mIPackageManager
-                        .getPackagesHoldingPermissions(mPermissions, 0, profileId).getList();
+                @SuppressWarnings("unchecked") final List<PackageInfo> packageInfos =
+                        mIPackageManager
+                                .getPackagesHoldingPermissions(mPermissions, 0,
+                                        profileId).getList();
                 final int packageInfoCount = packageInfos != null ? packageInfos.size() : 0;
                 for (int i = 0; i < packageInfoCount; i++) {
                     final PackageInfo packageInfo = packageInfos.get(i);
diff --git a/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounter.java b/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounter.java
index 77cecd2..9bb7a4b 100644
--- a/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounter.java
+++ b/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounter.java
@@ -17,12 +17,12 @@
 import android.app.admin.DevicePolicyManager;
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.os.Build;
 import android.os.RemoteException;
 import android.os.UserHandle;
 
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 /**
@@ -32,11 +32,11 @@
 public abstract class AppWithAdminGrantedPermissionsCounter extends AppCounter {
 
     private final String[] mPermissions;
-    private final IPackageManagerWrapper mPackageManagerService;
+    private final IPackageManager mPackageManagerService;
     private final DevicePolicyManager mDevicePolicyManager;
 
     public AppWithAdminGrantedPermissionsCounter(Context context, String[] permissions,
-            PackageManagerWrapper packageManager, IPackageManagerWrapper packageManagerService,
+            PackageManagerWrapper packageManager, IPackageManager packageManagerService,
             DevicePolicyManager devicePolicyManager) {
         super(context, packageManager);
         mPermissions = permissions;
@@ -52,7 +52,7 @@
 
     public static boolean includeInCount(String[] permissions,
             DevicePolicyManager devicePolicyManager, PackageManagerWrapper packageManager,
-            IPackageManagerWrapper packageManagerService, ApplicationInfo info) {
+            IPackageManager packageManagerService, ApplicationInfo info) {
         if (info.targetSdkVersion >= Build.VERSION_CODES.M) {
             // The app uses run-time permissions. Check whether one or more of the permissions were
             // granted by enterprise policy.
diff --git a/src/com/android/settings/applications/AppWithAdminGrantedPermissionsLister.java b/src/com/android/settings/applications/AppWithAdminGrantedPermissionsLister.java
index 655758a..1308620 100644
--- a/src/com/android/settings/applications/AppWithAdminGrantedPermissionsLister.java
+++ b/src/com/android/settings/applications/AppWithAdminGrantedPermissionsLister.java
@@ -18,9 +18,9 @@
 
 import android.app.admin.DevicePolicyManager;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
 import android.os.UserManager;
 
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 /**
@@ -29,11 +29,11 @@
  */
 public abstract class AppWithAdminGrantedPermissionsLister extends AppLister {
     private final String[] mPermissions;
-    private final IPackageManagerWrapper mPackageManagerService;
+    private final IPackageManager mPackageManagerService;
     private final DevicePolicyManager mDevicePolicyManager;
 
     public AppWithAdminGrantedPermissionsLister(String[] permissions,
-            PackageManagerWrapper packageManager, IPackageManagerWrapper packageManagerService,
+            PackageManagerWrapper packageManager, IPackageManager packageManagerService,
             DevicePolicyManager devicePolicyManager, UserManager userManager) {
         super(packageManager, userManager);
         mPermissions = permissions;
diff --git a/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java b/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java
index cd54f79..f592865 100644
--- a/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java
+++ b/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ComponentInfo;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.pm.UserInfo;
@@ -27,7 +28,6 @@
 import android.os.UserManager;
 import android.util.ArraySet;
 
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import java.util.ArrayList;
@@ -38,12 +38,12 @@
 
     private final Context mContext;
     private final PackageManagerWrapper mPm;
-    private final IPackageManagerWrapper mPms;
+    private final IPackageManager mPms;
     private final DevicePolicyManager mDpm;
     private final UserManager mUm;
 
     public ApplicationFeatureProviderImpl(Context context, PackageManagerWrapper pm,
-            IPackageManagerWrapper pms, DevicePolicyManager dpm) {
+            IPackageManager pms, DevicePolicyManager dpm) {
         mContext = context.getApplicationContext();
         mPm = pm;
         mPms = pms;
@@ -149,7 +149,7 @@
 
         CurrentUserAndManagedProfileAppWithAdminGrantedPermissionsCounter(Context context,
                 String[] permissions, PackageManagerWrapper packageManager,
-                IPackageManagerWrapper packageManagerService,
+                IPackageManager packageManagerService,
                 DevicePolicyManager devicePolicyManager, NumberOfAppsCallback callback) {
             super(context, permissions, packageManager, packageManagerService, devicePolicyManager);
             mCallback = callback;
@@ -181,7 +181,7 @@
         private ListOfAppsCallback mCallback;
 
         CurrentUserAppWithAdminGrantedPermissionsLister(String[] permissions,
-                PackageManagerWrapper packageManager, IPackageManagerWrapper packageManagerService,
+                PackageManagerWrapper packageManager, IPackageManager packageManagerService,
                 DevicePolicyManager devicePolicyManager, UserManager userManager,
                 ListOfAppsCallback callback) {
             super(permissions, packageManager, packageManagerService, devicePolicyManager,
diff --git a/src/com/android/settings/applications/appinfo/PictureInPictureSettings.java b/src/com/android/settings/applications/appinfo/PictureInPictureSettings.java
index e2caa41..ef2c7a9 100644
--- a/src/com/android/settings/applications/appinfo/PictureInPictureSettings.java
+++ b/src/com/android/settings/applications/appinfo/PictureInPictureSettings.java
@@ -40,7 +40,6 @@
 import com.android.settings.applications.AppInfoBase;
 import com.android.settings.notification.EmptyTextSettings;
 import com.android.settings.widget.AppPreference;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import java.text.Collator;
@@ -88,7 +87,7 @@
 
     private Context mContext;
     private PackageManagerWrapper mPackageManager;
-    private UserManagerWrapper mUserManager;
+    private UserManager mUserManager;
     private IconDrawableFactory mIconDrawableFactory;
 
     /**
@@ -119,7 +118,7 @@
         // Do nothing
     }
 
-    public PictureInPictureSettings(PackageManagerWrapper pm, UserManagerWrapper um) {
+    public PictureInPictureSettings(PackageManagerWrapper pm, UserManager um) {
         mPackageManager = pm;
         mUserManager = um;
     }
@@ -130,7 +129,7 @@
 
         mContext = getActivity();
         mPackageManager = new PackageManagerWrapper(mContext.getPackageManager());
-        mUserManager = new UserManagerWrapper(mContext.getSystemService(UserManager.class));
+        mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
         mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
     }
 
diff --git a/src/com/android/settings/connecteddevice/usb/UsbBackend.java b/src/com/android/settings/connecteddevice/usb/UsbBackend.java
index 333449f..54811c8 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbBackend.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbBackend.java
@@ -22,11 +22,10 @@
 import android.hardware.usb.UsbPort;
 import android.hardware.usb.UsbPortStatus;
 import android.net.ConnectivityManager;
+import android.os.UserHandle;
 import android.os.UserManager;
 import android.support.annotation.VisibleForTesting;
 
-import com.android.settings.wrapper.UserManagerWrapper;
-
 /**
  * Provides access to underlying system USB functionality.
  */
@@ -50,17 +49,17 @@
     private UsbPortStatus mPortStatus;
 
     public UsbBackend(Context context) {
-        this(context, new UserManagerWrapper(UserManager.get(context)));
+        this(context, (UserManager) context.getSystemService(Context.USER_SERVICE));
     }
 
     @VisibleForTesting
-    public UsbBackend(Context context, UserManagerWrapper userManagerWrapper) {
+    public UsbBackend(Context context, UserManager userManager) {
         mUsbManager = context.getSystemService(UsbManager.class);
 
-        mFileTransferRestricted = userManagerWrapper.isUsbFileTransferRestricted();
-        mFileTransferRestrictedBySystem = userManagerWrapper.isUsbFileTransferRestrictedBySystem();
-        mTetheringRestricted = userManagerWrapper.isUsbTetheringRestricted();
-        mTetheringRestrictedBySystem = userManagerWrapper.isUsbTetheringRestrictedBySystem();
+        mFileTransferRestricted = isUsbFileTransferRestricted(userManager);
+        mFileTransferRestrictedBySystem = isUsbFileTransferRestrictedBySystem(userManager);
+        mTetheringRestricted = isUsbTetheringRestricted(userManager);
+        mTetheringRestrictedBySystem = isUsbTetheringRestrictedBySystem(userManager);
 
         mMidiSupported = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_MIDI);
         ConnectivityManager cm =
@@ -172,6 +171,24 @@
         return Integer.parseInt(role);
     }
 
+    private static boolean isUsbFileTransferRestricted(UserManager userManager) {
+        return userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER);
+    }
+
+    private static boolean isUsbTetheringRestricted(UserManager userManager) {
+        return userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING);
+    }
+
+    private static boolean isUsbFileTransferRestrictedBySystem(UserManager userManager) {
+        return userManager.hasBaseUserRestriction(
+                UserManager.DISALLOW_USB_FILE_TRANSFER, UserHandle.of(UserHandle.myUserId()));
+    }
+
+    private static boolean isUsbTetheringRestrictedBySystem(UserManager userManager) {
+        return userManager.hasBaseUserRestriction(
+                UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.of(UserHandle.myUserId()));
+    }
+
     private boolean areFunctionDisallowed(long functions) {
         return (mFileTransferRestricted && ((functions & UsbManager.FUNCTION_MTP) != 0
                 || (functions & UsbManager.FUNCTION_PTP) != 0))
diff --git a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
index ead941f..8e56b12 100644
--- a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
@@ -47,7 +47,6 @@
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
 import com.android.settings.widget.EntityHeaderController;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.deviceinfo.PrivateStorageInfo;
@@ -185,8 +184,7 @@
                 mVolume, new StorageManagerVolumeProvider(sm));
         controllers.add(mPreferenceController);
 
-        UserManagerWrapper userManager =
-                new UserManagerWrapper(context.getSystemService(UserManager.class));
+        final UserManager userManager = context.getSystemService(UserManager.class);
         mSecondaryUsers = SecondaryUserController.getSecondaryUserControllers(context, userManager);
         controllers.addAll(mSecondaryUsers);
 
@@ -235,8 +233,7 @@
                 public List<AbstractPreferenceController> createPreferenceControllers(
                         Context context) {
                     final StorageManager sm = context.getSystemService(StorageManager.class);
-                    final UserManagerWrapper userManager =
-                            new UserManagerWrapper(context.getSystemService(UserManager.class));
+                    final UserManager userManager = context.getSystemService(UserManager.class);
                     final List<AbstractPreferenceController> controllers = new ArrayList<>();
                     controllers.add(new StorageSummaryDonutPreferenceController(context));
                     controllers.add(new StorageItemPreferenceController(context, null /* host */,
@@ -251,9 +248,8 @@
     @Override
     public Loader<SparseArray<StorageAsyncLoader.AppsStorageResult>> onCreateLoader(int id,
             Bundle args) {
-        Context context = getContext();
-        return new StorageAsyncLoader(context,
-                new UserManagerWrapper(context.getSystemService(UserManager.class)),
+        final Context context = getContext();
+        return new StorageAsyncLoader(context, context.getSystemService(UserManager.class),
                 mVolume.fsUuid,
                 new StorageStatsSource(context),
                 new PackageManagerWrapper(context.getPackageManager()));
diff --git a/src/com/android/settings/deviceinfo/StorageProfileFragment.java b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
index 3f75f5c..a312a81 100644
--- a/src/com/android/settings/deviceinfo/StorageProfileFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
@@ -34,7 +34,6 @@
 import com.android.settings.deviceinfo.storage.StorageAsyncLoader;
 import com.android.settings.deviceinfo.storage.StorageAsyncLoader.AppsStorageResult;
 import com.android.settings.deviceinfo.storage.StorageItemPreferenceController;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.deviceinfo.StorageManagerVolumeProvider;
@@ -114,9 +113,9 @@
 
     @Override
     public Loader<SparseArray<AppsStorageResult>> onCreateLoader(int id, Bundle args) {
-        Context context = getContext();
+        final Context context = getContext();
         return new StorageAsyncLoader(context,
-                new UserManagerWrapper(context.getSystemService(UserManager.class)),
+                context.getSystemService(UserManager.class),
                 mVolume.fsUuid,
                 new StorageStatsSource(context),
                 new PackageManagerWrapper(context.getPackageManager()));
diff --git a/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java b/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
index 4aeb782..d63436f 100644
--- a/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
+++ b/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.content.pm.UserInfo;
 import android.graphics.drawable.Drawable;
+import android.os.UserManager;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.annotation.VisibleForTesting;
@@ -29,7 +30,6 @@
 import com.android.settings.Utils;
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settings.deviceinfo.StorageItemPreference;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import java.util.ArrayList;
@@ -61,7 +61,7 @@
      * @param userManager UserManagerWrapper for figuring out which controllers to add.
      */
     public static List<AbstractPreferenceController> getSecondaryUserControllers(
-            Context context, UserManagerWrapper userManager) {
+            Context context, UserManager userManager) {
         List<AbstractPreferenceController> controllers = new ArrayList<>();
         UserInfo primaryUser = userManager.getPrimaryUser();
         boolean addedUser = false;
@@ -74,8 +74,7 @@
 
             if (info == null || Utils.isProfileOf(primaryUser, info)) {
                 controllers.add(
-                        new UserProfileController(
-                                context, info, userManager, USER_PROFILE_INSERTION_LOCATION));
+                        new UserProfileController(context, info, USER_PROFILE_INSERTION_LOCATION));
                 continue;
             }
 
diff --git a/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java b/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
index 0b9b697..affcbc9 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
@@ -26,11 +26,11 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.UserInfo;
 import android.os.UserHandle;
+import android.os.UserManager;
 import android.util.ArraySet;
 import android.util.Log;
 import android.util.SparseArray;
 
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.utils.AsyncLoader;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
@@ -46,7 +46,7 @@
  */
 public class StorageAsyncLoader
         extends AsyncLoader<SparseArray<StorageAsyncLoader.AppsStorageResult>> {
-    private UserManagerWrapper mUserManager;
+    private UserManager mUserManager;
     private static final String TAG = "StorageAsyncLoader";
 
     private String mUuid;
@@ -54,7 +54,7 @@
     private PackageManagerWrapper mPackageManager;
     private ArraySet<String> mSeenPackages;
 
-    public StorageAsyncLoader(Context context, UserManagerWrapper userManager,
+    public StorageAsyncLoader(Context context, UserManager userManager,
             String uuid, StorageStatsSource source, PackageManagerWrapper pm) {
         super(context);
         mUserManager = userManager;
diff --git a/src/com/android/settings/deviceinfo/storage/UserProfileController.java b/src/com/android/settings/deviceinfo/storage/UserProfileController.java
index 081a0be..510b0c0 100644
--- a/src/com/android/settings/deviceinfo/storage/UserProfileController.java
+++ b/src/com/android/settings/deviceinfo/storage/UserProfileController.java
@@ -32,7 +32,6 @@
 import com.android.settings.core.SubSettingLauncher;
 import com.android.settings.deviceinfo.StorageItemPreference;
 import com.android.settings.deviceinfo.StorageProfileFragment;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.core.AbstractPreferenceController;
 
 /**
@@ -44,16 +43,13 @@
         UserIconLoader.UserIconHandler {
     private static final String PREFERENCE_KEY_BASE = "pref_profile_";
     private StorageItemPreference mStoragePreference;
-    private UserManagerWrapper mUserManager;
     private UserInfo mUser;
     private long mTotalSizeBytes;
     private final int mPreferenceOrder;
 
-    public UserProfileController(
-            Context context, UserInfo info, UserManagerWrapper userManager, int preferenceOrder) {
+    public UserProfileController(Context context, UserInfo info, int preferenceOrder) {
         super(context);
         mUser = Preconditions.checkNotNull(info);
-        mUserManager = userManager;
         mPreferenceOrder = preferenceOrder;
     }
 
diff --git a/src/com/android/settings/enterprise/BackupsEnabledPreferenceController.java b/src/com/android/settings/enterprise/BackupsEnabledPreferenceController.java
new file mode 100644
index 0000000..b24f8dc
--- /dev/null
+++ b/src/com/android/settings/enterprise/BackupsEnabledPreferenceController.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2018 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.enterprise;
+
+import android.content.Context;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.overlay.FeatureFactory;
+
+public class BackupsEnabledPreferenceController extends BasePreferenceController {
+
+    private static final String KEY_BACKUPS_ENABLED = "backups_enabled";
+    private final EnterprisePrivacyFeatureProvider mFeatureProvider;
+
+    public BackupsEnabledPreferenceController(Context context) {
+        super(context, KEY_BACKUPS_ENABLED);
+        mFeatureProvider = FeatureFactory.getFactory(context)
+                .getEnterprisePrivacyFeatureProvider(context);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mFeatureProvider.areBackupsMandatory() ? AVAILABLE : DISABLED_FOR_USER;
+    }
+}
+
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProvider.java b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProvider.java
index 048782e..51d125d 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProvider.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProvider.java
@@ -124,4 +124,9 @@
      * profile (if any).
      */
     int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile();
+
+    /*
+     * Returns whether backups are mandatory.
+     */
+    boolean areBackupsMandatory();
 }
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
index 17d7f0d..eead69f 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
@@ -23,6 +23,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
+import android.net.ConnectivityManager;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
@@ -32,7 +33,6 @@
 
 import com.android.settings.R;
 import com.android.settings.vpn2.VpnUtils;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import java.util.Date;
@@ -44,13 +44,13 @@
     private final DevicePolicyManager mDpm;
     private final PackageManagerWrapper mPm;
     private final UserManager mUm;
-    private final ConnectivityManagerWrapper mCm;
+    private final ConnectivityManager mCm;
     private final Resources mResources;
 
     private static final int MY_USER_ID = UserHandle.myUserId();
 
     public EnterprisePrivacyFeatureProviderImpl(Context context, DevicePolicyManager dpm,
-            PackageManagerWrapper pm, UserManager um, ConnectivityManagerWrapper cm,
+            PackageManagerWrapper pm, UserManager um, ConnectivityManager cm,
             Resources resources) {
         mContext = context.getApplicationContext();
         mDpm = dpm;
@@ -235,6 +235,11 @@
         return activeAdmins;
     }
 
+    @Override
+    public boolean areBackupsMandatory() {
+        return null != mDpm.getMandatoryBackupTransport();
+    }
+
     protected static class EnterprisePrivacySpan extends ClickableSpan {
         private final Context mContext;
 
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
index b426d28..92ae38d 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
@@ -82,6 +82,7 @@
         exposureChangesCategoryControllers.add(new CaCertsCurrentUserPreferenceController(context));
         exposureChangesCategoryControllers.add(new CaCertsManagedProfilePreferenceController(
                 context));
+        exposureChangesCategoryControllers.add(new BackupsEnabledPreferenceController(context));
         controllers.addAll(exposureChangesCategoryControllers);
         controllers.add(new PreferenceCategoryController(context, "exposure_changes_category")
                 .setChildren(exposureChangesCategoryControllers));
diff --git a/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetector.java b/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetector.java
index fd150e4..1b6e2f0 100644
--- a/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetector.java
+++ b/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetector.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.os.BatteryStats;
 import android.support.annotation.VisibleForTesting;
+import android.text.format.DateUtils;
 
 import com.android.internal.os.BatterySipper;
 import com.android.internal.os.BatteryStatsHelper;
@@ -72,18 +73,20 @@
                         final long foregroundTimeMs = mBatteryUtils.getProcessTimeMs(
                                 BatteryUtils.StatusType.FOREGROUND, batterySipper.uidObj,
                                 BatteryStats.STATS_SINCE_CHARGED);
-                        mHighUsageAppList.add(new AppInfo.Builder()
-                                .setUid(batterySipper.getUid())
-                                .setPackageName(
-                                        mBatteryUtils.getPackageName(batterySipper.getUid()))
-                                .setScreenOnTimeMs(foregroundTimeMs)
-                                .build());
+                        if (foregroundTimeMs >= DateUtils.MINUTE_IN_MILLIS) {
+                            mHighUsageAppList.add(new AppInfo.Builder()
+                                    .setUid(batterySipper.getUid())
+                                    .setPackageName(
+                                            mBatteryUtils.getPackageName(batterySipper.getUid()))
+                                    .setScreenOnTimeMs(foregroundTimeMs)
+                                    .build());
+                        }
                     }
                 }
 
+                Collections.sort(mHighUsageAppList, Collections.reverseOrder());
                 mHighUsageAppList = mHighUsageAppList.subList(0,
                         Math.min(mPolicy.highUsageAppCount, mHighUsageAppList.size()));
-                Collections.sort(mHighUsageAppList, Collections.reverseOrder());
             }
         }
 
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index 7d8ea18..955c503 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -49,10 +49,8 @@
 
     private static final String TAG = "NetworkDashboardFrag";
     private static final int MENU_NETWORK_RESET = Menu.FIRST;
-    private static final int MENU_PRIVATE_DNS = Menu.FIRST + 1;
 
     private NetworkResetActionMenuController mNetworkResetController;
-    private PrivateDnsMenuController mPrivateDnsMenuController;
 
     @Override
     public int getMetricsCategory() {
@@ -73,8 +71,6 @@
     public void onAttach(Context context) {
         super.onAttach(context);
         mNetworkResetController = new NetworkResetActionMenuController(context, MENU_NETWORK_RESET);
-        mPrivateDnsMenuController = new PrivateDnsMenuController(getFragmentManager(),
-                MENU_PRIVATE_DNS);
     }
 
     @Override
@@ -86,7 +82,6 @@
     public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
         super.onCreateOptionsMenu(menu, inflater);
         mNetworkResetController.buildMenuItem(menu);
-        mPrivateDnsMenuController.buildMenuItem(menu);
     }
 
     @Override
@@ -109,6 +104,8 @@
                 new MobileNetworkPreferenceController(context);
         final VpnPreferenceController vpnPreferenceController =
                 new VpnPreferenceController(context);
+        final PrivateDnsPreferenceController privateDnsPreferenceController =
+                new PrivateDnsPreferenceController(context);
 
         if (lifecycle != null) {
             lifecycle.addObserver(airplaneModePreferenceController);
@@ -116,6 +113,7 @@
             lifecycle.addObserver(wifiPreferenceController);
             lifecycle.addObserver(mobileNetworkPreferenceController);
             lifecycle.addObserver(vpnPreferenceController);
+            lifecycle.addObserver(privateDnsPreferenceController);
         }
 
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
@@ -126,6 +124,7 @@
         controllers.add(new ProxyPreferenceController(context));
         controllers.add(mobilePlanPreferenceController);
         controllers.add(wifiPreferenceController);
+        controllers.add(privateDnsPreferenceController);
         return controllers;
     }
 
diff --git a/src/com/android/settings/network/PrivateDnsMenuController.java b/src/com/android/settings/network/PrivateDnsMenuController.java
deleted file mode 100644
index a811775..0000000
--- a/src/com/android/settings/network/PrivateDnsMenuController.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.network;
-
-import android.app.FragmentManager;
-import android.view.Menu;
-import android.view.MenuItem;
-
-import com.android.settings.R;
-
-public class PrivateDnsMenuController {
-    private final FragmentManager mFragmentManager;
-    private final int mMenuId;
-
-    public PrivateDnsMenuController(FragmentManager fragmentManager, int menuId) {
-        mFragmentManager = fragmentManager;
-        mMenuId = menuId;
-    }
-
-    public void buildMenuItem(Menu menu) {
-        if (menu != null) {
-            MenuItem item = menu.add(0 /* groupId */, mMenuId, 0 /* order */,
-                    R.string.select_private_dns_configuration_title);
-            item.setOnMenuItemClickListener(target -> {
-                PrivateDnsModeDialogFragment.show(mFragmentManager);
-                return true;
-            });
-        }
-    }
-}
diff --git a/src/com/android/settings/network/PrivateDnsModeDialogFragment.java b/src/com/android/settings/network/PrivateDnsModeDialogPreference.java
similarity index 71%
rename from src/com/android/settings/network/PrivateDnsModeDialogFragment.java
rename to src/com/android/settings/network/PrivateDnsModeDialogPreference.java
index 00950c3..3b09cc2 100644
--- a/src/com/android/settings/network/PrivateDnsModeDialogFragment.java
+++ b/src/com/android/settings/network/PrivateDnsModeDialogPreference.java
@@ -20,19 +20,18 @@
 import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
 
 import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.FragmentManager;
+import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.os.Bundle;
 import android.provider.Settings;
 import android.support.annotation.VisibleForTesting;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.text.method.LinkMovementMethod;
-import android.view.LayoutInflater;
+import android.util.AttributeSet;
+import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
@@ -41,8 +40,9 @@
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
-import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.utils.AnnotationSpan;
+import com.android.settingslib.CustomDialogPreference;
 import com.android.settingslib.HelpUtils;
 
 import java.util.HashMap;
@@ -51,7 +51,7 @@
 /**
  * Dialog to set the private dns
  */
-public class PrivateDnsModeDialogFragment extends InstrumentedDialogFragment implements
+public class PrivateDnsModeDialogPreference extends CustomDialogPreference implements
         DialogInterface.OnClickListener, RadioGroup.OnCheckedChangeListener, TextWatcher {
 
     public static final String ANNOTATION_URL = "url";
@@ -77,41 +77,44 @@
     @VisibleForTesting
     RadioGroup mRadioGroup;
     @VisibleForTesting
-    Button mSaveButton;
-    @VisibleForTesting
     String mMode;
 
-    public static void show(FragmentManager fragmentManager) {
-        if (fragmentManager.findFragmentByTag(TAG) == null) {
-            final PrivateDnsModeDialogFragment fragment = new PrivateDnsModeDialogFragment();
-            fragment.show(fragmentManager, TAG);
-        }
+    public PrivateDnsModeDialogPreference(Context context) {
+        super(context);
     }
 
+    public PrivateDnsModeDialogPreference(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public PrivateDnsModeDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public PrivateDnsModeDialogPreference(Context context, AttributeSet attrs, int defStyleAttr,
+            int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    private final AnnotationSpan.LinkInfo mUrlLinkInfo = new AnnotationSpan.LinkInfo(
+            ANNOTATION_URL, (widget) -> {
+        final Context context = widget.getContext();
+        final Intent intent = HelpUtils.getHelpIntent(context,
+                context.getString(R.string.help_uri_private_dns),
+                context.getClass().getName());
+        if (intent != null) {
+            try {
+                widget.startActivityForResult(intent, 0);
+            } catch (ActivityNotFoundException e) {
+                Log.w(TAG, "Activity was not found for intent, " + intent.toString());
+            }
+        }
+    });
+
     @Override
-    public Dialog onCreateDialog(Bundle savedInstanceState) {
+    protected void onBindDialogView(View view) {
         final Context context = getContext();
-
-        final AlertDialog dialog = new AlertDialog.Builder(context)
-                .setTitle(R.string.select_private_dns_configuration_title)
-                .setView(buildPrivateDnsView(context))
-                .setPositiveButton(R.string.save, this)
-                .setNegativeButton(R.string.dlg_cancel, null)
-                .create();
-
-        dialog.setOnShowListener(dialogInterface -> {
-            mSaveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
-            updateDialogInfo();
-        });
-        return dialog;
-    }
-
-    private View buildPrivateDnsView(final Context context) {
         final ContentResolver contentResolver = context.getContentResolver();
-        mMode = Settings.Global.getString(contentResolver, MODE_KEY);
-        final View view = LayoutInflater.from(context).inflate(R.layout.private_dns_mode_dialog,
-                null);
-
         mEditText = view.findViewById(R.id.private_dns_mode_provider_hostname);
         mEditText.addTextChangedListener(this);
         mEditText.setText(Settings.Global.getString(contentResolver, HOSTNAME_KEY));
@@ -131,26 +134,20 @@
             helpTextView.setText(AnnotationSpan.linkify(
                     context.getText(R.string.private_dns_help_message), linkInfo));
         }
-
-        return view;
     }
 
     @Override
     public void onClick(DialogInterface dialog, int which) {
+        final Context context = getContext();
         if (mMode.equals(PRIVATE_DNS_MODE_PROVIDER_HOSTNAME)) {
             // Only clickable if hostname is valid, so we could save it safely
-            Settings.Global.putString(getContext().getContentResolver(), HOSTNAME_KEY,
+            Settings.Global.putString(context.getContentResolver(), HOSTNAME_KEY,
                     mEditText.getText().toString());
         }
 
-        mMetricsFeatureProvider.action(getContext(),
+        FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context,
                 MetricsProto.MetricsEvent.ACTION_PRIVATE_DNS_MODE, mMode);
-        Settings.Global.putString(getContext().getContentResolver(), MODE_KEY, mMode);
-    }
-
-    @Override
-    public int getMetricsCategory() {
-        return MetricsProto.MetricsEvent.DIALOG_PRIVATE_DNS;
+        Settings.Global.putString(context.getContentResolver(), MODE_KEY, mMode);
     }
 
     @Override
@@ -179,9 +176,7 @@
 
     @Override
     public void afterTextChanged(Editable s) {
-        if (mSaveButton != null) {
-            mSaveButton.setEnabled(isWeaklyValidatedHostname(mEditText.getText().toString()));
-        }
+        updateDialogInfo();
     }
 
     private boolean isWeaklyValidatedHostname(String hostname) {
@@ -193,17 +188,24 @@
         return hostname.matches(WEAK_HOSTNAME_REGEX);
     }
 
+    private Button getSaveButton() {
+        final AlertDialog dialog = (AlertDialog) getDialog();
+        if (dialog == null) {
+            return null;
+        }
+        return dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+    }
+
     private void updateDialogInfo() {
         final boolean modeProvider = PRIVATE_DNS_MODE_PROVIDER_HOSTNAME.equals(mMode);
         if (mEditText != null) {
             mEditText.setEnabled(modeProvider);
         }
-        if (mSaveButton != null) {
-            mSaveButton.setEnabled(
-                    modeProvider
-                            ? isWeaklyValidatedHostname(mEditText.getText().toString())
-                            : true);
+        final Button saveButton = getSaveButton();
+        if (saveButton != null) {
+            saveButton.setEnabled(modeProvider
+                    ? isWeaklyValidatedHostname(mEditText.getText().toString())
+                    : true);
         }
     }
-
 }
diff --git a/src/com/android/settings/network/PrivateDnsPreferenceController.java b/src/com/android/settings/network/PrivateDnsPreferenceController.java
new file mode 100644
index 0000000..e317530
--- /dev/null
+++ b/src/com/android/settings/network/PrivateDnsPreferenceController.java
@@ -0,0 +1,43 @@
+/*
+ * 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.network;
+
+import android.content.Context;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.core.lifecycle.LifecycleObserver;
+
+public class PrivateDnsPreferenceController extends BasePreferenceController
+        implements PreferenceControllerMixin, LifecycleObserver {
+    private static final String KEY_PRIVATE_DNS_SETTINGS = "private_dns_settings";
+
+    public PrivateDnsPreferenceController(Context context) {
+        super(context, KEY_PRIVATE_DNS_SETTINGS);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY_PRIVATE_DNS_SETTINGS;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+}
diff --git a/src/com/android/settings/network/VpnPreferenceController.java b/src/com/android/settings/network/VpnPreferenceController.java
index 95513e0..c4ecf4f 100644
--- a/src/com/android/settings/network/VpnPreferenceController.java
+++ b/src/com/android/settings/network/VpnPreferenceController.java
@@ -180,13 +180,11 @@
             mNetworkCallback = new ConnectivityManager.NetworkCallback() {
         @Override
         public void onAvailable(Network network) {
-            Log.d(TAG, "onAvailable " + network.netId);
             updateSummary();
         }
 
         @Override
         public void onLost(Network network) {
-            Log.d(TAG, "onLost " + network.netId);
             updateSummary();
         }
     };
diff --git a/src/com/android/settings/notification/VolumeSeekBarPreference.java b/src/com/android/settings/notification/VolumeSeekBarPreference.java
index 89f1e27..478a7d6 100644
--- a/src/com/android/settings/notification/VolumeSeekBarPreference.java
+++ b/src/com/android/settings/notification/VolumeSeekBarPreference.java
@@ -83,6 +83,7 @@
     public void setStream(int stream) {
         mStream = stream;
         setMax(mAudioManager.getStreamMaxVolume(mStream));
+        setMin(mAudioManager.getStreamMinVolume(mStream));
         setProgress(mAudioManager.getStreamVolume(mStream));
     }
 
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index f0bbe2e..b652c66 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -51,8 +51,6 @@
 import com.android.settings.slices.SlicesFeatureProviderImpl;
 import com.android.settings.users.UserFeatureProvider;
 import com.android.settings.users.UserFeatureProviderImpl;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
@@ -112,7 +110,7 @@
         if (mApplicationFeatureProvider == null) {
             mApplicationFeatureProvider = new ApplicationFeatureProviderImpl(context,
                     new PackageManagerWrapper(context.getPackageManager()),
-                    new IPackageManagerWrapper(AppGlobals.getPackageManager()),
+                    AppGlobals.getPackageManager(),
                     (DevicePolicyManager) context
                             .getSystemService(Context.DEVICE_POLICY_SERVICE));
         }
@@ -134,8 +132,7 @@
                     (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE),
                     new PackageManagerWrapper(context.getPackageManager()),
                     UserManager.get(context),
-                    new ConnectivityManagerWrapper((ConnectivityManager) context
-                            .getSystemService(Context.CONNECTIVITY_SERVICE)),
+                    (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE),
                     context.getResources());
         }
         return mEnterprisePrivacyFeatureProvider;
diff --git a/src/com/android/settings/vpn2/VpnUtils.java b/src/com/android/settings/vpn2/VpnUtils.java
index 1aa4ada..4528180 100644
--- a/src/com/android/settings/vpn2/VpnUtils.java
+++ b/src/com/android/settings/vpn2/VpnUtils.java
@@ -27,7 +27,6 @@
 
 import com.android.internal.net.LegacyVpnInfo;
 import com.android.internal.net.VpnConfig;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 
 /**
  * Utility functions for vpn.
@@ -89,7 +88,7 @@
                 ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
     }
 
-    public static boolean isAlwaysOnVpnSet(ConnectivityManagerWrapper cm, final int userId) {
+    public static boolean isAlwaysOnVpnSet(ConnectivityManager cm, final int userId) {
         return cm.getAlwaysOnVpnPackageForUser(userId) != null;
     }
 
diff --git a/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java b/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
index 0874cea..22835f3 100644
--- a/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
+++ b/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
@@ -27,7 +27,6 @@
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.core.SubSettingLauncher;
-import com.android.settings.wrapper.WallpaperManagerWrapper;
 
 public class WallpaperSuggestionActivity extends Activity {
 
@@ -61,9 +60,16 @@
 
     @VisibleForTesting
     public static boolean isSuggestionComplete(Context context) {
-        final WallpaperManagerWrapper manager = new WallpaperManagerWrapper(context);
-        return manager.isWallpaperServiceEnabled() ? manager.getWallpaperId(
-                WallpaperManager.FLAG_SYSTEM) > 0 : false;
+        if (!isWallpaperServiceEnabled(context)) {
+            return true;
+        }
+        final WallpaperManager manager = (WallpaperManager) context.getSystemService(
+                WALLPAPER_SERVICE);
+        return manager.getWallpaperId(WallpaperManager.FLAG_SYSTEM) > 0;
     }
 
+    private static boolean isWallpaperServiceEnabled(Context context) {
+        return context.getResources().getBoolean(
+                com.android.internal.R.bool.config_enableWallpaperService);
+    }
 }
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index c5e79b2..cdb9292 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -34,11 +34,10 @@
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.widget.SwitchWidgetController;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
-import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 import com.android.settingslib.WirelessUtils;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -46,7 +45,7 @@
 
     private final SwitchWidgetController mSwitchWidget;
     private final WifiManager mWifiManager;
-    private final ConnectivityManagerWrapper mConnectivityManager;
+    private final ConnectivityManager mConnectivityManager;
     private final MetricsFeatureProvider mMetricsFeatureProvider;
 
     private Context mContext;
@@ -81,20 +80,20 @@
 
     public WifiEnabler(Context context, SwitchWidgetController switchWidget,
         MetricsFeatureProvider metricsFeatureProvider) {
-        this(context, switchWidget, metricsFeatureProvider, new ConnectivityManagerWrapper(
-            (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)));
+        this(context, switchWidget, metricsFeatureProvider,
+            (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE));
     }
 
     @VisibleForTesting
     WifiEnabler(Context context, SwitchWidgetController switchWidget,
             MetricsFeatureProvider metricsFeatureProvider,
-            ConnectivityManagerWrapper connectivityManagerWrapper) {
+            ConnectivityManager connectivityManager) {
         mContext = context;
         mSwitchWidget = switchWidget;
         mSwitchWidget.setListener(this);
         mMetricsFeatureProvider = metricsFeatureProvider;
         mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
-        mConnectivityManager = connectivityManagerWrapper;
+        mConnectivityManager = connectivityManager;
 
         mIntentFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
         // The order matters! We really should not depend on this. :(
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 5f29922..4f1c832 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -64,7 +64,6 @@
 import com.android.settings.widget.SummaryUpdater.OnSummaryChangeListener;
 import com.android.settings.widget.SwitchBarController;
 import com.android.settings.wifi.details.WifiNetworkDetailsFragment;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.wifi.AccessPoint;
 import com.android.settingslib.wifi.AccessPoint.AccessPointListener;
@@ -852,9 +851,7 @@
                     pref.getAccessPoint().saveWifiState(pref.getExtras());
                     if (mCaptivePortalNetworkCallback != null
                             && mCaptivePortalNetworkCallback.isCaptivePortal()) {
-                        ConnectivityManagerWrapper connectivityManagerWrapper =
-                                new ConnectivityManagerWrapper(mConnectivityManager);
-                        connectivityManagerWrapper.startCaptivePortalApp(
+                        mConnectivityManager.startCaptivePortalApp(
                                 mCaptivePortalNetworkCallback.getNetwork());
                     } else {
                         launchNetworkDetailsFragment(pref);
diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
index e7f0fdd..2339e38 100644
--- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
@@ -48,6 +48,7 @@
 import android.util.Log;
 import android.widget.ImageView;
 import android.widget.Toast;
+
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
@@ -60,7 +61,6 @@
 import com.android.settings.wifi.WifiDialog;
 import com.android.settings.wifi.WifiDialog.WifiDialogListener;
 import com.android.settings.wifi.WifiUtils;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -68,6 +68,7 @@
 import com.android.settingslib.core.lifecycle.events.OnPause;
 import com.android.settingslib.core.lifecycle.events.OnResume;
 import com.android.settingslib.wifi.AccessPoint;
+
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
@@ -114,7 +115,6 @@
     static final String KEY_IPV6_ADDRESSES_PREF = "ipv6_addresses";
 
     private AccessPoint mAccessPoint;
-    private final ConnectivityManagerWrapper mConnectivityManagerWrapper;
     private final ConnectivityManager mConnectivityManager;
     private final Fragment mFragment;
     private final Handler mHandler;
@@ -152,10 +152,10 @@
             switch (intent.getAction()) {
                 case WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION:
                     if (!intent.getBooleanExtra(WifiManager.EXTRA_MULTIPLE_NETWORKS_CHANGED,
-                        false /* defaultValue */)) {
+                            false /* defaultValue */)) {
                         // only one network changed
                         WifiConfiguration wifiConfiguration = intent
-                            .getParcelableExtra(WifiManager.EXTRA_WIFI_CONFIGURATION);
+                                .getParcelableExtra(WifiManager.EXTRA_WIFI_CONFIGURATION);
                         if (mAccessPoint.matches(wifiConfiguration)) {
                             mWifiConfig = wifiConfiguration;
                         }
@@ -215,7 +215,7 @@
 
     public static WifiDetailPreferenceController newInstance(
             AccessPoint accessPoint,
-            ConnectivityManagerWrapper connectivityManagerWrapper,
+            ConnectivityManager connectivityManager,
             Context context,
             Fragment fragment,
             Handler handler,
@@ -223,14 +223,14 @@
             WifiManager wifiManager,
             MetricsFeatureProvider metricsFeatureProvider) {
         return new WifiDetailPreferenceController(
-                accessPoint, connectivityManagerWrapper, context, fragment, handler, lifecycle,
+                accessPoint, connectivityManager, context, fragment, handler, lifecycle,
                 wifiManager, metricsFeatureProvider, new IconInjector(context));
     }
 
     @VisibleForTesting
-    /* package */ WifiDetailPreferenceController(
+        /* package */ WifiDetailPreferenceController(
             AccessPoint accessPoint,
-            ConnectivityManagerWrapper connectivityManagerWrapper,
+            ConnectivityManager connectivityManager,
             Context context,
             Fragment fragment,
             Handler handler,
@@ -241,8 +241,7 @@
         super(context);
 
         mAccessPoint = accessPoint;
-        mConnectivityManager = connectivityManagerWrapper.getConnectivityManager();
-        mConnectivityManagerWrapper = connectivityManagerWrapper;
+        mConnectivityManager = connectivityManager;
         mFragment = fragment;
         mHandler = handler;
         mSignalStr = context.getResources().getStringArray(R.array.wifi_signal);
@@ -326,7 +325,7 @@
         mNetworkCapabilities = mConnectivityManager.getNetworkCapabilities(mNetwork);
         updateInfo();
         mContext.registerReceiver(mReceiver, mFilter);
-        mConnectivityManagerWrapper.registerNetworkCallback(mNetworkRequest, mNetworkCallback,
+        mConnectivityManager.registerNetworkCallback(mNetworkRequest, mNetworkCallback,
                 mHandler);
     }
 
@@ -486,7 +485,7 @@
     private static String ipv4PrefixLengthToSubnetMask(int prefixLength) {
         try {
             InetAddress all = InetAddress.getByAddress(
-                    new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 255});
+                    new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255});
             return NetworkUtils.getNetworkPart(all, prefixLength).getHostAddress();
         } catch (UnknownHostException e) {
             return null;
@@ -538,7 +537,7 @@
     private void signIntoNetwork() {
         mMetricsFeatureProvider.action(
                 mFragment.getActivity(), MetricsProto.MetricsEvent.ACTION_WIFI_SIGNIN);
-        mConnectivityManagerWrapper.startCaptivePortalApp(mNetwork);
+        mConnectivityManager.startCaptivePortalApp(mNetwork);
     }
 
     @Override
diff --git a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
index b2e56b9..3438035 100644
--- a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
+++ b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
@@ -20,13 +20,10 @@
 import android.app.Dialog;
 import android.content.Context;
 import android.net.ConnectivityManager;
-import android.net.NetworkPolicyManager;
-import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
-import android.support.v7.preference.DropDownPreference;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -37,13 +34,11 @@
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.wifi.WifiConfigUiBase;
 import com.android.settings.wifi.WifiDialog;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.wifi.AccessPoint;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 /**
@@ -126,10 +121,10 @@
     @Override
     protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
-        ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
+        final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
         mWifiDetailPreferenceController = WifiDetailPreferenceController.newInstance(
                 mAccessPoint,
-                new ConnectivityManagerWrapper(cm),
+                cm,
                 context,
                 this,
                 new Handler(Looper.getMainLooper()),  // UI thread.
diff --git a/src/com/android/settings/wrapper/ConnectivityManagerWrapper.java b/src/com/android/settings/wrapper/ConnectivityManagerWrapper.java
deleted file mode 100644
index c80a97b..0000000
--- a/src/com/android/settings/wrapper/ConnectivityManagerWrapper.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.wrapper;
-
-import android.net.ConnectivityManager;
-import android.net.ConnectivityManager.NetworkCallback;
-import android.net.Network;
-import android.net.NetworkRequest;
-import android.os.Handler;
-import android.net.ProxyInfo;
-
-/**
- * This class replicates a subset of the android.net.ConnectivityManager (CM). The class
- * exists so that we can use a thin wrapper around the CM in production code and a mock in tests.
- * We cannot directly mock or shadow the CM, because some of the methods we rely on are marked as
- * hidden and are thus invisible to Robolectric.
- */
-public class ConnectivityManagerWrapper {
-
-    private final ConnectivityManager mCm;
-
-    public ConnectivityManagerWrapper(ConnectivityManager cm) {
-        mCm = cm;
-    }
-
-    /**
-     * Returns the real ConnectivityManager object wrapped by this wrapper.
-     */
-    public ConnectivityManager getConnectivityManager() {
-        return mCm;
-    }
-
-    /**
-     * Calls {@code ConnectivityManager.getAlwaysOnVpnPackageForUser()}.
-     *
-     * @see android.net.ConnectivityManager#getAlwaysOnVpnPackageForUser
-     */
-    public String getAlwaysOnVpnPackageForUser(int userId) {
-        return mCm.getAlwaysOnVpnPackageForUser(userId);
-    }
-
-    /**
-     * Calls {@code ConnectivityManager.getGlobalProxy()}.
-     *
-     * @see android.net.ConnectivityManager#getGlobalProxy
-     */
-    public ProxyInfo getGlobalProxy() {
-        return mCm.getGlobalProxy();
-    }
-
-    /**
-     * Calls {@code ConnectivityManager.registerNetworkCallback()}.
-     *
-     * This is part of the ConnectivityManager public API in SDK 26 or above, but is not yet visible
-     * to the robolectric tests, which currently build with SDK 23.
-     * TODO: delete this once the robolectric tests build with SDK 26 or above.
-     *
-     * @see android.net.ConnectivityManager#registerNetworkCallback(NetworkRequest,NetworkCallback,Handler)
-     */
-    public void registerNetworkCallback(NetworkRequest request, NetworkCallback callback,
-            Handler handler) {
-        mCm.registerNetworkCallback(request, callback, handler);
-    }
-
-    /**
-     * Calls {@code ConnectivityManager.startCaptivePortalApp()}.
-     *
-     * This is part of the ConnectivityManager public API in SDK 26 or above, but is not yet visible
-     * to the robolectric tests, which currently build with SDK 23.
-     * TODO: delete this once the robolectric tests build with SDK 26 or above.
-     *
-     * @see android.net.ConnectivityManager#startCaptivePortalApp(Network)
-     */
-    public void startCaptivePortalApp(Network network) {
-        mCm.startCaptivePortalApp(network);
-    }
-
-    /**
-     * {@link ConnectivityManager#stopTethering}
-     */
-    public void stopTethering(int type) {
-        mCm.stopTethering(type);
-    }
-}
diff --git a/src/com/android/settings/wrapper/IPackageManagerWrapper.java b/src/com/android/settings/wrapper/IPackageManagerWrapper.java
deleted file mode 100644
index 9bb2df7..0000000
--- a/src/com/android/settings/wrapper/IPackageManagerWrapper.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.wrapper;
-
-import android.content.Intent;
-import android.content.pm.IPackageManager;
-import android.content.pm.PackageInfo;
-import android.content.pm.ParceledListSlice;
-import android.content.pm.ResolveInfo;
-import android.os.RemoteException;
-
-/**
- * This class replicates a subset of the android.content.pm.IPackageManager (PMS). The class
- * exists so that we can use a thin wrapper around the PMS in production code and a mock in tests.
- * We cannot directly mock or shadow the PMS, because some of the methods we rely on are newer than
- * the API version supported by Robolectric.
- */
-public class IPackageManagerWrapper {
-
-    private final IPackageManager mPms;
-
-    public IPackageManagerWrapper(IPackageManager pms) {
-        mPms = pms;
-    }
-
-    /**
-     * Calls {@code IPackageManager.checkUidPermission()}.
-     *
-     * @see android.content.pm.IPackageManager#checkUidPermission
-     */
-    public int checkUidPermission(String permName, int uid) throws RemoteException {
-        return mPms.checkUidPermission(permName, uid);
-    }
-
-    /**
-     * Calls {@code IPackageManager.findPersistentPreferredActivity()}.
-     *
-     * @see android.content.pm.IPackageManager#findPersistentPreferredActivity
-     */
-    public ResolveInfo findPersistentPreferredActivity(Intent intent, int userId)
-            throws RemoteException {
-        return mPms.findPersistentPreferredActivity(intent, userId);
-    }
-
-    /**
-     * Calls {@code IPackageManager.getPackageInfo()}.
-     *
-     * @see android.content.pm.IPackageManager#getPackageInfo
-     */
-    public PackageInfo getPackageInfo(String packageName, int flags, int userId)
-            throws RemoteException {
-        return mPms.getPackageInfo(packageName, flags, userId);
-    }
-
-    /**
-     * Calls {@code IPackageManager.getAppOpPermissionPackages()}.
-     *
-     * @see android.content.pm.IPackageManager#getAppOpPermissionPackages
-     */
-    public String[] getAppOpPermissionPackages(String permissionName) throws RemoteException {
-        return mPms.getAppOpPermissionPackages(permissionName);
-    }
-
-    /**
-     * Calls {@code IPackageManager.isPackageAvailable()}.
-     *
-     * @see android.content.pm.IPackageManager#isPackageAvailable
-     */
-    public boolean isPackageAvailable(String packageName, int userId) throws RemoteException {
-        return mPms.isPackageAvailable(packageName, userId);
-    }
-
-    /**
-     * Calls {@code IPackageManager.getPackagesHoldingPermissions()}.
-     *
-     * @see android.content.pm.IPackageManager#getPackagesHoldingPermissions
-     */
-    public ParceledListSlice<PackageInfo> getPackagesHoldingPermissions(
-        String[] permissions, int flags, int userId) throws RemoteException {
-        return mPms.getPackagesHoldingPermissions(permissions, flags, userId);
-    }
-
-}
diff --git a/src/com/android/settings/wrapper/UserManagerWrapper.java b/src/com/android/settings/wrapper/UserManagerWrapper.java
deleted file mode 100644
index 8c3a01d..0000000
--- a/src/com/android/settings/wrapper/UserManagerWrapper.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.wrapper;
-
-import android.content.pm.UserInfo;
-import android.os.UserHandle;
-import android.os.UserManager;
-
-import java.util.List;
-
-/**
- * This class replicates a subset of the android.os.UserManager. The class
- * exists so that we can use a thin wrapper around the UserManager in production code and a mock in
- * tests. We cannot directly mock or shadow the UserManager, because some of the methods we rely on
- * are newer than the API version supported by Robolectric or are hidden.
- */
-public class UserManagerWrapper {
-    private UserManager mUserManager;
-
-    public UserManagerWrapper(UserManager userManager) {
-        mUserManager = userManager;
-    }
-
-    public UserInfo getPrimaryUser() {
-        return mUserManager.getPrimaryUser();
-    }
-
-    public List<UserInfo> getUsers() {
-        return mUserManager.getUsers();
-    }
-
-    public List<UserInfo> getProfiles(int userHandle) {
-        return mUserManager.getProfiles(userHandle);
-    }
-
-    public boolean isUsbFileTransferRestricted() {
-        return mUserManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER);
-    }
-
-    public boolean isUsbTetheringRestricted() {
-        return mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING);
-    }
-
-    public boolean isUsbFileTransferRestrictedBySystem() {
-        return mUserManager.hasBaseUserRestriction(
-                UserManager.DISALLOW_USB_FILE_TRANSFER, UserHandle.of(UserHandle.myUserId()));
-    }
-
-    public boolean isUsbTetheringRestrictedBySystem() {
-        return mUserManager.hasBaseUserRestriction(
-                UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.of(UserHandle.myUserId()));
-    }
-}
diff --git a/src/com/android/settings/wrapper/WallpaperManagerWrapper.java b/src/com/android/settings/wrapper/WallpaperManagerWrapper.java
deleted file mode 100644
index eabc5bb..0000000
--- a/src/com/android/settings/wrapper/WallpaperManagerWrapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.wrapper;
-
-import android.app.WallpaperManager;
-import android.content.Context;
-
-public class WallpaperManagerWrapper {
-
-    private final WallpaperManager mWallpaperManager;
-    private final boolean mWallpaperServiceEnabled;
-
-    public WallpaperManagerWrapper(Context context) {
-        mWallpaperServiceEnabled = context.getResources().getBoolean(
-                com.android.internal.R.bool.config_enableWallpaperService);
-        mWallpaperManager = mWallpaperServiceEnabled ? (WallpaperManager) context.getSystemService(
-                Context.WALLPAPER_SERVICE) : null;
-    }
-
-    public boolean isWallpaperServiceEnabled() {
-        return mWallpaperServiceEnabled;
-    }
-
-    public int getWallpaperId(int which) {
-        if (!mWallpaperServiceEnabled) {
-            throw new RuntimeException("This device does not have wallpaper service enabled.");
-        }
-        return mWallpaperManager.getWallpaperId(which);
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java b/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
index 2df0117..a4eeacd 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStateAppOpsBridgeTest.java
@@ -23,11 +23,11 @@
 import android.Manifest;
 import android.app.AppOpsManager;
 import android.content.Context;
+import android.content.pm.IPackageManager;
 import android.os.RemoteException;
 import android.os.UserManager;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
 
 import org.junit.Before;
@@ -41,7 +41,7 @@
 
     @Mock private Context mContext;
     @Mock private UserManager mUserManager;
-    @Mock private IPackageManagerWrapper mPackageManagerService;
+    @Mock private IPackageManager mPackageManagerService;
     @Mock private AppOpsManager mAppOpsManager;
 
     @Before
diff --git a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
index a0bae85..dcc6a1e 100644
--- a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsCounterTest.java
@@ -29,6 +29,7 @@
 import android.app.admin.DevicePolicyManager;
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.os.Build;
@@ -37,7 +38,6 @@
 import android.os.UserManager;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import org.junit.Before;
@@ -81,7 +81,7 @@
     @Mock
     private PackageManagerWrapper mPackageManager;
     @Mock
-    private IPackageManagerWrapper mPackageManagerService;
+    private IPackageManager mPackageManagerService;
     @Mock
     private DevicePolicyManager mDevicePolicyManager;
 
diff --git a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
index 940fd4b..8365db2 100644
--- a/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppWithAdminGrantedPermissionsListerTest.java
@@ -27,6 +27,7 @@
 import static org.mockito.Mockito.when;
 
 import android.app.admin.DevicePolicyManager;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.os.Build;
@@ -34,7 +35,6 @@
 import android.os.UserManager;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import org.junit.Before;
@@ -78,7 +78,7 @@
     @Mock
     private PackageManagerWrapper mPackageManager;
     @Mock
-    private IPackageManagerWrapper mPackageManagerService;
+    private IPackageManager mPackageManagerService;
     @Mock
     private DevicePolicyManager mDevicePolicyManager;
 
diff --git a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
index 8afb798..a457ba2 100644
--- a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java
@@ -24,6 +24,7 @@
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.pm.UserInfo;
@@ -33,7 +34,6 @@
 
 import com.android.settings.testutils.ApplicationTestUtils;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.IPackageManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import org.junit.Before;
@@ -72,7 +72,7 @@
     @Mock
     private PackageManagerWrapper mPackageManager;
     @Mock
-    private IPackageManagerWrapper mPackageManagerService;
+    private IPackageManager mPackageManagerService;
     @Mock
     private DevicePolicyManager mDevicePolicyManager;
 
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
index 3ea2a16..87dedad 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
@@ -25,12 +25,13 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInfo;
 import android.content.pm.UserInfo;
+import android.os.UserManager;
 import android.util.Pair;
 
 import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
+
 import com.google.common.collect.ImmutableList;
 
 import org.junit.Before;
@@ -52,7 +53,7 @@
     @Mock
     private PackageManagerWrapper mPackageManager;
     @Mock
-    private UserManagerWrapper mUserManager;
+    private UserManager mUserManager;
     private ArrayList<PackageInfo> mPrimaryUserPackages;
     private ArrayList<PackageInfo> mProfileUserPackages;
 
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/usb/UsbBackendTest.java b/tests/robotests/src/com/android/settings/connecteddevice/usb/UsbBackendTest.java
index 0823fe0..567b072 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/usb/UsbBackendTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/usb/UsbBackendTest.java
@@ -18,6 +18,8 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Answers.RETURNS_DEEP_STUBS;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -27,9 +29,10 @@
 import android.hardware.usb.UsbPort;
 import android.hardware.usb.UsbPortStatus;
 import android.net.ConnectivityManager;
+import android.os.UserHandle;
+import android.os.UserManager;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.UserManagerWrapper;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -45,7 +48,7 @@
     @Mock
     private UsbManager mUsbManager;
     @Mock
-    private UserManagerWrapper mUserManagerWrapper;
+    private UserManager mUserManager;
     @Mock
     private ConnectivityManager mConnectivityManager;
     @Mock
@@ -68,7 +71,7 @@
 
     @Test
     public void setDataRole_allRolesSupported_shouldSetDataRole() {
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         when(mUsbPortStatus
                 .isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, UsbPort.DATA_ROLE_DEVICE))
@@ -91,7 +94,7 @@
 
     @Test
     public void setDataRole_notAllRolesSupported_shouldSetDataAndPowerRole() {
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         when(mUsbPortStatus
                 .isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, UsbPort.DATA_ROLE_DEVICE))
@@ -109,7 +112,7 @@
 
     @Test
     public void setPowerRole_allRolesSupported_shouldSetPowerRole() {
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         when(mUsbPortStatus
                 .isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, UsbPort.DATA_ROLE_DEVICE))
@@ -133,7 +136,7 @@
 
     @Test
     public void setPowerRole_notAllRolesSupported_shouldSetDataAndPowerRole() {
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         when(mUsbPortStatus
                 .isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, UsbPort.DATA_ROLE_DEVICE))
@@ -151,20 +154,26 @@
 
     @Test
     public void areFunctionsSupported_fileTransferDisallowed_shouldReturnFalse() {
-        when(mUserManagerWrapper.isUsbFileTransferRestricted()).thenReturn(true);
-        when(mUserManagerWrapper.isUsbFileTransferRestrictedBySystem()).thenReturn(true);
+        when(mUserManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER))
+                .thenReturn(true);
+        when(mUserManager.hasBaseUserRestriction(
+                eq(UserManager.DISALLOW_USB_FILE_TRANSFER), any(UserHandle.class)))
+                .thenReturn(true);
 
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         assertThat(usbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP)).isFalse();
     }
 
     @Test
     public void areFunctionsSupported_fileTransferAllowed_shouldReturnTrue() {
-        when(mUserManagerWrapper.isUsbFileTransferRestricted()).thenReturn(false);
-        when(mUserManagerWrapper.isUsbFileTransferRestrictedBySystem()).thenReturn(false);
+        when(mUserManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER))
+                .thenReturn(false);
+        when(mUserManager.hasBaseUserRestriction(
+                eq(UserManager.DISALLOW_USB_FILE_TRANSFER), any(UserHandle.class)))
+                .thenReturn(false);
 
-        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManagerWrapper);
+        final UsbBackend usbBackend = new UsbBackend(mContext, mUserManager);
 
         assertThat(usbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP)).isTrue();
     }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
index 49f0312..bbe92ad 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/SecondaryUserControllerTest.java
@@ -26,13 +26,13 @@
 import android.content.Context;
 import android.content.pm.UserInfo;
 import android.graphics.drawable.Drawable;
+import android.os.UserManager;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceGroup;
 import android.support.v7.preference.PreferenceScreen;
 import android.util.SparseArray;
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.drawable.UserIconDrawable;
@@ -54,7 +54,7 @@
     private static final String TEST_NAME = "Fred";
     private static final String TARGET_PREFERENCE_GROUP_KEY = "pref_secondary_users";
     @Mock
-    private UserManagerWrapper mUserManager;
+    private UserManager mUserManager;
     @Mock
     private PreferenceScreen mScreen;
     @Mock
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
index 84456ec..7ee6216 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
@@ -35,7 +35,6 @@
 import com.android.settings.SubSettings;
 import com.android.settings.deviceinfo.StorageProfileFragment;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.drawable.UserIconDrawable;
 
@@ -53,8 +52,6 @@
     private static final String TEST_NAME = "Fred";
 
     @Mock
-    private UserManagerWrapper mUserManager;
-    @Mock
     private PreferenceScreen mScreen;
 
     private Context mContext;
@@ -66,7 +63,7 @@
         MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
         mPrimaryProfile = new UserInfo();
-        mController = new UserProfileController(mContext, mPrimaryProfile, mUserManager, 0);
+        mController = new UserProfileController(mContext, mPrimaryProfile, 0);
         when(mScreen.getContext()).thenReturn(mContext);
         mPrimaryProfile.name = TEST_NAME;
         mPrimaryProfile.id = 10;
@@ -96,7 +93,7 @@
         final Intent intent = intentCaptor.getValue();
         assertThat(intent.getComponent().getClassName()).isEqualTo(SubSettings.class.getName());
         assertThat(intent.getStringExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT))
-            .isEqualTo(StorageProfileFragment.class.getName());
+                .isEqualTo(StorageProfileFragment.class.getName());
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/enterprise/BackupsEnabledPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/BackupsEnabledPreferenceControllerTest.java
new file mode 100644
index 0000000..a836fa2
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/enterprise/BackupsEnabledPreferenceControllerTest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2018 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.enterprise;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.support.v7.preference.Preference;
+
+import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+public class BackupsEnabledPreferenceControllerTest {
+
+    private static final String KEY_BACKUPS_ENABLED = "backups_enabled";
+
+    private Context mContext;
+    private FakeFeatureFactory mFeatureFactory;
+
+    private BackupsEnabledPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mFeatureFactory = FakeFeatureFactory.setupForTest();
+        mController = new BackupsEnabledPreferenceController(mContext);
+    }
+
+    @Test
+    public void testIsAvailable() {
+        when(mFeatureFactory.enterprisePrivacyFeatureProvider.areBackupsMandatory())
+                .thenReturn(false);
+        assertThat(mController.isAvailable()).isFalse();
+
+        when(mFeatureFactory.enterprisePrivacyFeatureProvider.areBackupsMandatory())
+                .thenReturn(true);
+        assertThat(mController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void testHandlePreferenceTreeClick() {
+        assertThat(mController.handlePreferenceTreeClick(new Preference(mContext, null, 0, 0)))
+                .isFalse();
+    }
+
+    @Test
+    public void testGetPreferenceKey() {
+        assertThat(mController.getPreferenceKey()).isEqualTo(KEY_BACKUPS_ENABLED);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
index b71a35e..40371d7 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
@@ -28,6 +28,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
+import android.net.ConnectivityManager;
 import android.net.ProxyInfo;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -36,7 +37,6 @@
 
 import com.android.settings.R;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
 import org.junit.Before;
@@ -72,7 +72,7 @@
     private @Mock PackageManagerWrapper mPackageManagerWrapper;
     private @Mock PackageManager mPackageManager;
     private @Mock UserManager mUserManager;
-    private @Mock ConnectivityManagerWrapper mConnectivityManger;
+    private @Mock ConnectivityManager mConnectivityManger;
     private Resources mResources;
 
     private EnterprisePrivacyFeatureProvider mProvider;
@@ -347,6 +347,15 @@
                 .isEqualTo(3);
     }
 
+    @Test
+    public void testAreBackupsMandatory() {
+        assertThat(mProvider.areBackupsMandatory()).isFalse();
+        ComponentName transportComponent = new ComponentName("test", "test");
+        when(mDevicePolicyManager.getMandatoryBackupTransport())
+                .thenReturn(transportComponent);
+        assertThat(mProvider.areBackupsMandatory()).isTrue();
+    }
+
     private void resetAndInitializePackageManagerWrapper() {
         reset(mPackageManagerWrapper);
         when(mPackageManagerWrapper.hasSystemFeature(PackageManager.FEATURE_DEVICE_ADMIN))
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
index 5266fde..7bbe9bc 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
@@ -98,7 +98,7 @@
 
     private void verifyPreferenceControllers(List<AbstractPreferenceController> controllers) {
         assertThat(controllers).isNotNull();
-        assertThat(controllers.size()).isEqualTo(17);
+        assertThat(controllers.size()).isEqualTo(18);
         int position = 0;
         assertThat(controllers.get(position++)).isInstanceOf(NetworkLogsPreferenceController.class);
         assertThat(controllers.get(position++)).isInstanceOf(BugReportsPreferenceController.class);
@@ -126,6 +126,8 @@
         assertThat(controllers.get(position++)).isInstanceOf(
                 CaCertsManagedProfilePreferenceController.class);
         assertThat(controllers.get(position++)).isInstanceOf(
+                BackupsEnabledPreferenceController.class);
+        assertThat(controllers.get(position++)).isInstanceOf(
                 PreferenceCategoryController.class);
         assertThat(controllers.get(position++)).isInstanceOf(
                 FailedPasswordWipeCurrentUserPreferenceController.class);
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetectorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetectorTest.java
index 14627c5..d983dfc 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetectorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/HighUsageDetectorTest.java
@@ -17,8 +17,10 @@
 package com.android.settings.fuelgauge.batterytip.detectors;
 
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
@@ -48,7 +50,8 @@
 
 @RunWith(SettingsRobolectricTestRunner.class)
 public class HighUsageDetectorTest {
-    private static final int UID = 123;
+    private static final int UID_HIGH = 123;
+    private static final int UID_ZERO = 345;
     private static final long SCREEN_ON_TIME_MS = DateUtils.HOUR_IN_MILLIS;
     private Context mContext;
     @Mock
@@ -56,7 +59,9 @@
     @Mock
     private BatteryUtils mBatteryUtils;
     @Mock
-    private BatterySipper mBatterySipper;
+    private BatterySipper mHighBatterySipper;
+    @Mock
+    private BatterySipper mZeroBatterySipper;
     @Mock
     private HighUsageDataParser mDataParser;
 
@@ -75,14 +80,25 @@
         mHighUsageDetector.mBatteryUtils = mBatteryUtils;
         mHighUsageDetector.mDataParser = mDataParser;
         doNothing().when(mHighUsageDetector).parseBatteryData();
-        doReturn(UID).when(mBatterySipper).getUid();
+        doReturn(UID_HIGH).when(mHighBatterySipper).getUid();
+        mHighBatterySipper.uidObj = mock(BatteryStats.Uid.class);
+        mZeroBatterySipper.uidObj = mock(BatteryStats.Uid.class);
+        doReturn(UID_ZERO).when(mZeroBatterySipper).getUid();
         mAppInfo = new AppInfo.Builder()
-                .setUid(UID)
+                .setUid(UID_HIGH)
                 .setScreenOnTimeMs(SCREEN_ON_TIME_MS)
                 .build();
 
+        doReturn(SCREEN_ON_TIME_MS).when(mBatteryUtils).getProcessTimeMs(
+                BatteryUtils.StatusType.FOREGROUND, mHighBatterySipper.uidObj,
+                BatteryStats.STATS_SINCE_CHARGED);
+        doReturn(0L).when(mBatteryUtils).getProcessTimeMs(
+                BatteryUtils.StatusType.FOREGROUND, mZeroBatterySipper.uidObj,
+                BatteryStats.STATS_SINCE_CHARGED);
+
         mUsageList = new ArrayList<>();
-        mUsageList.add(mBatterySipper);
+        mUsageList.add(mHighBatterySipper);
+        when(mBatteryStatsHelper.getUsageList()).thenReturn(mUsageList);
     }
 
     @Test
@@ -95,10 +111,16 @@
     @Test
     public void testDetect_containsHighUsageApp_tipVisible() {
         doReturn(true).when(mDataParser).isDeviceHeavilyUsed();
-        when(mBatteryStatsHelper.getUsageList()).thenReturn(mUsageList);
-        doReturn(SCREEN_ON_TIME_MS).when(mBatteryUtils).getProcessTimeMs(
-                BatteryUtils.StatusType.FOREGROUND, mBatterySipper.uidObj,
-                BatteryStats.STATS_SINCE_CHARGED);
+
+        final HighUsageTip highUsageTip = (HighUsageTip) mHighUsageDetector.detect();
+        assertThat(highUsageTip.isVisible()).isTrue();
+        assertThat(highUsageTip.getHighUsageAppList()).containsExactly(mAppInfo);
+    }
+
+    @Test
+    public void testDetect_containsHighUsageApp_removeZeroOne() {
+        doReturn(true).when(mDataParser).isDeviceHeavilyUsed();
+        mUsageList.add(mZeroBatterySipper);
 
         final HighUsageTip highUsageTip = (HighUsageTip) mHighUsageDetector.detect();
         assertThat(highUsageTip.isVisible()).isTrue();
diff --git a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
index 19c9f87..51722e5 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
@@ -76,9 +76,7 @@
     public void testPrepareActionBar_networkResetShouldBeCreated() {
         final NetworkResetActionMenuController resetController =
                 mock(NetworkResetActionMenuController.class);
-        final PrivateDnsMenuController privateDnsController = mock(PrivateDnsMenuController.class);
         ReflectionHelpers.setField(mFragment, "mNetworkResetController", resetController);
-        ReflectionHelpers.setField(mFragment, "mPrivateDnsMenuController", privateDnsController);
 
         mFragment.onCreateOptionsMenu(null, null);
 
diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java
deleted file mode 100644
index fa824d6..0000000
--- a/tests/robotests/src/com/android/settings/network/PrivateDnsMenuControllerTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.network;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.FragmentManager;
-import android.view.Menu;
-import android.view.MenuItem;
-
-import com.android.settings.R;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-@RunWith(SettingsRobolectricTestRunner.class)
-public class PrivateDnsMenuControllerTest {
-    private static final int MENU_ID = 0;
-
-    private PrivateDnsMenuController mController;
-    @Mock
-    private Menu mMenu;
-    @Mock
-    private MenuItem mMenuItem;
-    @Mock
-    private FragmentManager mFragmentManager;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-
-        mController = new PrivateDnsMenuController(mFragmentManager, MENU_ID);
-        when(mMenu.add(anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mMenuItem);
-    }
-
-    @Test
-    public void buildMenuItem_available_shouldAddToMenu() {
-        mController.buildMenuItem(mMenu);
-
-        verify(mMenu).add(0 /* groupId */, MENU_ID, 0 /* order */,
-                R.string.select_private_dns_configuration_title);
-        verify(mMenuItem).setOnMenuItemClickListener(any(MenuItem.OnMenuItemClickListener.class));
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java
deleted file mode 100644
index d490968..0000000
--- a/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogFragmentTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.network;
-
-import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OFF;
-import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OPPORTUNISTIC;
-import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-
-import android.content.Context;
-import android.provider.Settings;
-import android.widget.Button;
-
-import com.android.settings.R;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.testutils.shadow.ShadowHelpUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
-
-@RunWith(SettingsRobolectricTestRunner.class)
-@Config(shadows = ShadowHelpUtils.class)
-public class PrivateDnsModeDialogFragmentTest {
-
-    private static final String HOST_NAME = "192.168.1.1";
-    private static final String INVALID_HOST_NAME = "...,";
-
-    private Context mContext;
-    private PrivateDnsModeDialogFragment mFragment;
-    private Button mSaveButton;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-
-        mContext = RuntimeEnvironment.application;
-        mSaveButton = new Button(mContext);
-
-        mFragment = spy(new PrivateDnsModeDialogFragment());
-        doReturn(mContext).when(mFragment).getContext();
-        mFragment.onCreateDialog(null);
-        mFragment.mSaveButton = mSaveButton;
-    }
-
-    @Test
-    public void testOnCheckedChanged_dnsModeOff_disableEditText() {
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_off);
-
-        assertThat(mFragment.mMode).isEqualTo(PRIVATE_DNS_MODE_OFF);
-        assertThat(mFragment.mEditText.isEnabled()).isFalse();
-    }
-
-    @Test
-    public void testOnCheckedChanged_dnsModeOpportunistic_disableEditText() {
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_opportunistic);
-
-        assertThat(mFragment.mMode).isEqualTo(PRIVATE_DNS_MODE_OPPORTUNISTIC);
-        assertThat(mFragment.mEditText.isEnabled()).isFalse();
-    }
-
-    @Test
-    public void testOnCheckedChanged_dnsModeProvider_enableEditText() {
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_provider);
-
-        assertThat(mFragment.mMode).isEqualTo(PRIVATE_DNS_MODE_PROVIDER_HOSTNAME);
-        assertThat(mFragment.mEditText.isEnabled()).isTrue();
-    }
-
-    @Test
-    public void testOnCreateDialog_containsCorrectData() {
-        Settings.Global.putString(mContext.getContentResolver(),
-                PrivateDnsModeDialogFragment.MODE_KEY, PRIVATE_DNS_MODE_OPPORTUNISTIC);
-        Settings.Global.putString(mContext.getContentResolver(),
-                PrivateDnsModeDialogFragment.HOSTNAME_KEY, HOST_NAME);
-
-        mFragment.onCreateDialog(null);
-
-        assertThat(mFragment.mEditText.getText().toString()).isEqualTo(HOST_NAME);
-        assertThat(mFragment.mRadioGroup.getCheckedRadioButtonId()).isEqualTo(
-                R.id.private_dns_mode_opportunistic);
-    }
-
-    @Test
-    public void testOnCheckedChanged_switchMode_saveButtonHasCorrectState() {
-        // Set invalid hostname
-        mFragment.mEditText.setText(INVALID_HOST_NAME);
-
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_opportunistic);
-        assertThat(mSaveButton.isEnabled()).isTrue();
-
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_provider);
-        assertThat(mSaveButton.isEnabled()).isFalse();
-
-        mFragment.onCheckedChanged(null, R.id.private_dns_mode_off);
-        assertThat(mSaveButton.isEnabled()).isTrue();
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogPreferenceTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogPreferenceTest.java
new file mode 100644
index 0000000..8a60cf3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/PrivateDnsModeDialogPreferenceTest.java
@@ -0,0 +1,137 @@
+/*
+ * 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.network;
+
+import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OFF;
+import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OPPORTUNISTIC;
+import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.app.AlertDialog;
+import android.app.Fragment;
+import android.content.Context;
+import android.provider.Settings;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.Button;
+import android.widget.LinearLayout;
+
+import com.android.settings.R;
+import com.android.settingslib.CustomDialogPreference.CustomPreferenceDialogFragment;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.util.ReflectionHelpers;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+public class PrivateDnsModeDialogPreferenceTest {
+
+    private static final String HOST_NAME = "dns.example.com";
+    private static final String INVALID_HOST_NAME = "...,";
+
+    private PrivateDnsModeDialogPreference mPreference;
+
+    private Context mContext;
+    private Button mSaveButton;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = RuntimeEnvironment.application;
+        mSaveButton = new Button(mContext);
+
+        final CustomPreferenceDialogFragment fragment = mock(CustomPreferenceDialogFragment.class);
+        final AlertDialog dialog = mock(AlertDialog.class);
+        when(fragment.getDialog()).thenReturn(dialog);
+        when(dialog.getButton(anyInt())).thenReturn(mSaveButton);
+
+        mPreference = new PrivateDnsModeDialogPreference(mContext);
+        ReflectionHelpers.setField(mPreference, "mFragment", fragment);
+
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final View view = inflater.inflate(R.layout.private_dns_mode_dialog,
+                new LinearLayout(mContext), false);
+
+        mPreference.onBindDialogView(view);
+    }
+
+    @Test
+    public void testOnCheckedChanged_dnsModeOff_disableEditText() {
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_off);
+
+        assertThat(mPreference.mMode).isEqualTo(PRIVATE_DNS_MODE_OFF);
+        assertThat(mPreference.mEditText.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void testOnCheckedChanged_dnsModeOpportunistic_disableEditText() {
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_opportunistic);
+
+        assertThat(mPreference.mMode).isEqualTo(PRIVATE_DNS_MODE_OPPORTUNISTIC);
+        assertThat(mPreference.mEditText.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void testOnCheckedChanged_dnsModeProvider_enableEditText() {
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_provider);
+
+        assertThat(mPreference.mMode).isEqualTo(PRIVATE_DNS_MODE_PROVIDER_HOSTNAME);
+        assertThat(mPreference.mEditText.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void testOnBindDialogView_containsCorrectData() {
+        Settings.Global.putString(mContext.getContentResolver(),
+                PrivateDnsModeDialogPreference.MODE_KEY, PRIVATE_DNS_MODE_OPPORTUNISTIC);
+        Settings.Global.putString(mContext.getContentResolver(),
+                PrivateDnsModeDialogPreference.HOSTNAME_KEY, HOST_NAME);
+
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final View view = inflater.inflate(R.layout.private_dns_mode_dialog,
+                new LinearLayout(mContext), false);
+        mPreference.onBindDialogView(view);
+
+        assertThat(mPreference.mEditText.getText().toString()).isEqualTo(HOST_NAME);
+        assertThat(mPreference.mRadioGroup.getCheckedRadioButtonId()).isEqualTo(
+                R.id.private_dns_mode_opportunistic);
+    }
+
+    @Test
+    public void testOnCheckedChanged_switchMode_saveButtonHasCorrectState() {
+        // Set invalid hostname
+        mPreference.mEditText.setText(INVALID_HOST_NAME);
+
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_opportunistic);
+        assertThat(mSaveButton.isEnabled()).isTrue();
+
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_provider);
+        assertThat(mSaveButton.isEnabled()).isFalse();
+
+        mPreference.onCheckedChanged(null, R.id.private_dns_mode_off);
+        assertThat(mSaveButton.isEnabled()).isTrue();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java b/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
index f354c43..fd41c36 100644
--- a/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/vpn2/VpnUtilsTest.java
@@ -20,8 +20,9 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import android.net.ConnectivityManager;
+
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -30,7 +31,7 @@
 public final class VpnUtilsTest {
     @Test
     public void testIsAlwaysOnVpnSet() {
-        final ConnectivityManagerWrapper cm = mock(ConnectivityManagerWrapper.class);
+        final ConnectivityManager cm = mock(ConnectivityManager.class);
         when(cm.getAlwaysOnVpnPackageForUser(0)).thenReturn("com.example.vpn");
         assertThat(VpnUtils.isAlwaysOnVpnSet(cm, 0)).isTrue();
 
diff --git a/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java b/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
index 6ebbef3..fc708ef 100644
--- a/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wallpaper/WallpaperSuggestionActivityTest.java
@@ -20,15 +20,15 @@
 import static org.mockito.Mockito.when;
 import static org.robolectric.Shadows.shadowOf;
 
+import android.app.WallpaperManager;
 import android.content.Context;
 import android.content.Intent;
-import android.content.pm.PackageManager;
 import android.content.res.Resources;
 
 import com.android.settings.SubSettings;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.wrapper.WallpaperManagerWrapper;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -40,6 +40,7 @@
 import org.robolectric.annotation.Config;
 import org.robolectric.annotation.Implementation;
 import org.robolectric.annotation.Implements;
+import org.robolectric.annotation.Resetter;
 import org.robolectric.shadows.ShadowActivity;
 import org.robolectric.shadows.ShadowPackageManager;
 
@@ -59,10 +60,15 @@
         mController = Robolectric.buildActivity(WallpaperSuggestionActivity.class);
     }
 
+    @After
+    public void tearDown() {
+        ShadowWallpaperManager.reset();
+    }
+
     @Test
     public void launch_primarySuggestionActivityDoesNotExist_shouldFallback() {
         ShadowPackageManager packageManager =
-            shadowOf(RuntimeEnvironment.application.getPackageManager());
+                shadowOf(RuntimeEnvironment.application.getPackageManager());
         packageManager.removePackage("com.android.settings");
 
         ShadowActivity activity = shadowOf(mController.setup().get());
@@ -74,32 +80,34 @@
     }
 
     @Test
-    public void wallpaperServiceEnabled_no_shouldReturnFalse() {
+    public void wallpaperServiceEnabled_no_shouldReturnTrue() {
         when(mContext.getResources()).thenReturn(mResources);
         when(mResources.getBoolean(com.android.internal.R.bool.config_enableWallpaperService))
-            .thenReturn(false);
-
-        assertThat(WallpaperSuggestionActivity.isSuggestionComplete(mContext)).isFalse();
-    }
-
-    @Test
-    @Config(shadows = WallpaperSuggestionActivityTest.ShadowWallpaperManagerWrapper.class)
-    public void hasWallpaperSet_no_shouldReturnFalse() {
-        ShadowWallpaperManagerWrapper.setWallpaperId(0);
-
-        assertThat(WallpaperSuggestionActivity.isSuggestionComplete(mContext)).isFalse();
-    }
-
-    @Test
-    @Config(shadows = WallpaperSuggestionActivityTest.ShadowWallpaperManagerWrapper.class)
-    public void hasWallpaperSet_yes_shouldReturnTrue() {
-        ShadowWallpaperManagerWrapper.setWallpaperId(100);
+                .thenReturn(false);
 
         assertThat(WallpaperSuggestionActivity.isSuggestionComplete(mContext)).isTrue();
     }
 
-    @Implements(WallpaperManagerWrapper.class)
-    public static class ShadowWallpaperManagerWrapper {
+    @Test
+    @Config(shadows = ShadowWallpaperManager.class)
+    public void hasWallpaperSet_no_shouldReturnFalse() {
+        ShadowWallpaperManager.setWallpaperId(0);
+
+        assertThat(WallpaperSuggestionActivity.isSuggestionComplete(RuntimeEnvironment.application))
+                .isFalse();
+    }
+
+    @Test
+    @Config(shadows = ShadowWallpaperManager.class)
+    public void hasWallpaperSet_yes_shouldReturnTrue() {
+        ShadowWallpaperManager.setWallpaperId(100);
+
+        assertThat(WallpaperSuggestionActivity.isSuggestionComplete(RuntimeEnvironment.application))
+                .isTrue();
+    }
+
+    @Implements(WallpaperManager.class)
+    public static class ShadowWallpaperManager {
 
         private static int sWallpaperId;
 
@@ -107,13 +115,11 @@
             sWallpaperId = id;
         }
 
+        @Resetter
         public static void reset() {
             sWallpaperId = 0;
         }
 
-        public void __constructor__(Context context) {
-        }
-
         @Implementation
         public boolean isWallpaperServiceEnabled() {
             return true;
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
index b7bc33e..66cbd30 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiEnablerTest.java
@@ -26,7 +26,6 @@
 
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.widget.SwitchWidgetController;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 import org.junit.Before;
@@ -43,7 +42,7 @@
     @Mock
     private WifiManager mWifiManager;
     @Mock
-    private ConnectivityManagerWrapper mConnectivityManager;
+    private ConnectivityManager mConnectivityManager;
 
     private WifiEnabler mEnabler;
 
@@ -52,7 +51,7 @@
         MockitoAnnotations.initMocks(this);
         when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
         mEnabler = new WifiEnabler(mContext, mock(SwitchWidgetController.class),
-            mock(MetricsFeatureProvider.class), mConnectivityManager);
+                mock(MetricsFeatureProvider.class), mConnectivityManager);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
index 9c20d18..d08f922 100644
--- a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
@@ -51,7 +51,6 @@
 import android.net.wifi.WifiManager;
 import android.os.Handler;
 import android.provider.Settings;
-import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceCategory;
 import android.support.v7.preference.PreferenceScreen;
 import android.view.View;
@@ -70,7 +69,6 @@
 import com.android.settings.widget.ActionButtonPreferenceTest;
 import com.android.settings.widget.EntityHeaderController;
 import com.android.settings.wifi.WifiDetailPreference;
-import com.android.settings.wrapper.ConnectivityManagerWrapper;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.wifi.AccessPoint;
@@ -91,7 +89,6 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Arrays;
-import java.util.List;
 import java.util.stream.Collectors;
 
 @RunWith(SettingsRobolectricTestRunner.class)
@@ -119,8 +116,6 @@
     @Mock
     private ConnectivityManager mockConnectivityManager;
     @Mock
-    private ConnectivityManagerWrapper mockConnectivityManagerWrapper;
-    @Mock
     private Network mockNetwork;
     @Mock
     private NetworkInfo mockNetworkInfo;
@@ -173,8 +168,6 @@
     private ArgumentCaptor<NetworkCallback> mCallbackCaptor;
     @Captor
     private ArgumentCaptor<View.OnClickListener> mForgetClickListener;
-    @Captor
-    private ArgumentCaptor<Preference> mIpv6AddressCaptor;
 
     private Context mContext;
     private Lifecycle mLifecycle;
@@ -245,12 +238,9 @@
         when(mockAccessPoint.getConfig()).thenReturn(mockWifiConfig);
         when(mockAccessPoint.getLevel()).thenReturn(LEVEL);
         when(mockAccessPoint.getSecurityString(false)).thenReturn(SECURITY);
-
-        when(mockConnectivityManagerWrapper.getConnectivityManager())
-                .thenReturn(mockConnectivityManager);
         when(mockConnectivityManager.getNetworkInfo(any(Network.class)))
                 .thenReturn(mockNetworkInfo);
-        doNothing().when(mockConnectivityManagerWrapper).registerNetworkCallback(
+        doNothing().when(mockConnectivityManager).registerNetworkCallback(
                 nullable(NetworkRequest.class), mCallbackCaptor.capture(), nullable(Handler.class));
         mockButtonsPref = ActionButtonPreferenceTest.createMock();
         when(mockButtonsPref.setButton1OnClickListener(mForgetClickListener.capture()))
@@ -281,7 +271,7 @@
     private WifiDetailPreferenceController newWifiDetailPreferenceController() {
         return new WifiDetailPreferenceController(
                 mockAccessPoint,
-                mockConnectivityManagerWrapper,
+                mockConnectivityManager,
                 mContext,
                 mockFragment,
                 null,  // Handler
@@ -362,7 +352,7 @@
     public void networkCallback_shouldBeRegisteredOnResume() {
         displayAndResume();
 
-        verify(mockConnectivityManagerWrapper, times(1)).registerNetworkCallback(
+        verify(mockConnectivityManager, times(1)).registerNetworkCallback(
                 nullable(NetworkRequest.class), mCallbackCaptor.capture(), nullable(Handler.class));
     }
 
@@ -779,8 +769,6 @@
 
         displayAndResume();
 
-        List<Preference> addrs = mIpv6AddressCaptor.getAllValues();
-
         String expectedAddresses = String.join("\n",
                 asString(Constants.IPV6_LINKLOCAL),
                 asString(Constants.IPV6_GLOBAL1),
@@ -826,7 +814,7 @@
         ArgumentCaptor<OnClickListener> captor = ArgumentCaptor.forClass(OnClickListener.class);
         verify(mockButtonsPref).setButton2OnClickListener(captor.capture());
         captor.getValue().onClick(null);
-        verify(mockConnectivityManagerWrapper).startCaptivePortalApp(mockNetwork);
+        verify(mockConnectivityManager).startCaptivePortalApp(mockNetwork);
         verify(mockMetricsFeatureProvider)
                 .action(mockActivity, MetricsProto.MetricsEvent.ACTION_WIFI_SIGNIN);
     }
diff --git a/tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java b/tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java
index f622804..d1d2b04 100644
--- a/tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java
+++ b/tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java
@@ -17,7 +17,6 @@
 package com.android.settings.deviceinfo.storage;
 
 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.anyString;
@@ -31,11 +30,11 @@
 import android.content.pm.UserInfo;
 import android.net.TrafficStats;
 import android.os.UserHandle;
+import android.os.UserManager;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.util.SparseArray;
 
-import com.android.settings.wrapper.UserManagerWrapper;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.wrapper.PackageManagerWrapper;
 
@@ -65,7 +64,7 @@
     @Mock
     private PackageManagerWrapper mPackageManager;
     @Mock
-    private UserManagerWrapper mUserManager;
+    private UserManager mUserManager;
     private List<ApplicationInfo> mInfo = new ArrayList<>();
     private List<UserInfo> mUsers;
 
