diff --git a/src/com/android/settings/network/TetherProvisioningActivity.java b/src/com/android/settings/network/TetherProvisioningActivity.java
index 09efe48..bb61546 100644
--- a/src/com/android/settings/network/TetherProvisioningActivity.java
+++ b/src/com/android/settings/network/TetherProvisioningActivity.java
@@ -16,13 +16,19 @@
 
 package com.android.settings.network;
 
+import static android.net.TetheringConstants.EXTRA_ADD_TETHER_TYPE;
+import static android.net.TetheringConstants.EXTRA_PROVISION_CALLBACK;
+import static android.net.TetheringConstants.EXTRA_RUN_PROVISION;
+import static android.net.TetheringManager.TETHERING_INVALID;
+import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
+import static android.telephony.SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
 import android.app.Activity;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
-import android.net.ConnectivityManager;
-import android.net.TetheringConstants;
-import android.net.TetheringManager;
 import android.os.Bundle;
 import android.os.ResultReceiver;
 import android.os.UserHandle;
@@ -52,23 +58,19 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        mResultReceiver = (ResultReceiver)getIntent().getParcelableExtra(
-                ConnectivityManager.EXTRA_PROVISION_CALLBACK);
+        mResultReceiver = (ResultReceiver) getIntent().getParcelableExtra(EXTRA_PROVISION_CALLBACK);
 
-        final int tetherType = getIntent().getIntExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE,
-                ConnectivityManager.TETHERING_INVALID);
+        final int tetherType = getIntent().getIntExtra(EXTRA_ADD_TETHER_TYPE, TETHERING_INVALID);
 
-        final int tetherSubId = getIntent().getIntExtra(EXTRA_SUBID,
-                SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+        final int tetherSubId = getIntent().getIntExtra(EXTRA_SUBID, INVALID_SUBSCRIPTION_ID);
         final int subId = SubscriptionManager.getActiveDataSubscriptionId();
         if (tetherSubId != subId) {
             Log.e(TAG, "This Provisioning request is outdated, current subId: " + subId);
-            mResultReceiver.send(TetheringManager.TETHER_ERROR_PROVISIONING_FAILED, null);
+            mResultReceiver.send(TETHER_ERROR_PROVISIONING_FAILED, null);
             finish();
             return;
         }
-        String[] provisionApp = getIntent().getStringArrayExtra(
-                TetheringConstants.EXTRA_RUN_PROVISION);
+        String[] provisionApp = getIntent().getStringArrayExtra(EXTRA_RUN_PROVISION);
         if (provisionApp == null || provisionApp.length < 2) {
             final Resources res = Utils.getResourcesForSubId(this, subId);
             provisionApp = res.getStringArray(
@@ -77,8 +79,8 @@
         final Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.setClassName(provisionApp[0], provisionApp[1]);
         intent.putExtra(EXTRA_TETHER_TYPE, tetherType);
-        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
-        intent.putExtra(ConnectivityManager.EXTRA_PROVISION_CALLBACK, mResultReceiver);
+        intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
+        intent.putExtra(EXTRA_PROVISION_CALLBACK, mResultReceiver);
         if (DEBUG) {
             Log.d(TAG, "Starting provisioning app: " + provisionApp[0] + "." + provisionApp[1]);
         }
@@ -86,7 +88,7 @@
         if (getPackageManager().queryIntentActivities(intent,
                 PackageManager.MATCH_DEFAULT_ONLY).isEmpty()) {
             Log.e(TAG, "Provisioning app is configured, but not available.");
-            mResultReceiver.send(TetheringManager.TETHER_ERROR_PROVISIONING_FAILED, null);
+            mResultReceiver.send(TETHER_ERROR_PROVISIONING_FAILED, null);
             finish();
             return;
         }
@@ -99,9 +101,8 @@
         super.onActivityResult(requestCode, resultCode, intent);
         if (requestCode == PROVISION_REQUEST) {
             if (DEBUG) Log.d(TAG, "Got result from app: " + resultCode);
-            int result = resultCode == Activity.RESULT_OK ?
-                    TetheringManager.TETHER_ERROR_NO_ERROR :
-                    TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
+            int result = resultCode == Activity.RESULT_OK
+                    ? TETHER_ERROR_NO_ERROR : TETHER_ERROR_PROVISIONING_FAILED;
             mResultReceiver.send(result, null);
             finish();
         }
diff --git a/src/com/android/settings/wifi/tether/TetherService.java b/src/com/android/settings/wifi/tether/TetherService.java
index 7252960..72ea1a9 100644
--- a/src/com/android/settings/wifi/tether/TetherService.java
+++ b/src/com/android/settings/wifi/tether/TetherService.java
@@ -16,13 +16,24 @@
 
 package com.android.settings.wifi.tether;
 
+import static android.net.TetheringConstants.EXTRA_ADD_TETHER_TYPE;
+import static android.net.TetheringConstants.EXTRA_PROVISION_CALLBACK;
+import static android.net.TetheringConstants.EXTRA_REM_TETHER_TYPE;
+import static android.net.TetheringConstants.EXTRA_RUN_PROVISION;
+import static android.net.TetheringManager.TETHERING_BLUETOOTH;
+import static android.net.TetheringManager.TETHERING_ETHERNET;
+import static android.net.TetheringManager.TETHERING_INVALID;
+import static android.net.TetheringManager.TETHERING_USB;
+import static android.net.TetheringManager.TETHERING_WIFI;
+import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
+import static android.net.TetheringManager.TETHER_ERROR_UNKNOWN_IFACE;
+import static android.telephony.SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
 import android.app.Activity;
 import android.app.Service;
 import android.app.usage.UsageStatsManager;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothPan;
-import android.bluetooth.BluetoothProfile;
-import android.bluetooth.BluetoothProfile.ServiceListener;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -31,7 +42,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
-import android.net.ConnectivityManager;
+import android.net.TetheringManager;
 import android.os.IBinder;
 import android.os.ResultReceiver;
 import android.telephony.SubscriptionManager;
@@ -89,17 +100,16 @@
         mCurrentTethers = stringToTethers(prefs.getString(KEY_TETHERS, ""));
         mCurrentTypeIndex = 0;
         mPendingCallbacks = new ArrayMap<>(3);
-        mPendingCallbacks.put(ConnectivityManager.TETHERING_WIFI, new ArrayList<ResultReceiver>());
-        mPendingCallbacks.put(ConnectivityManager.TETHERING_USB, new ArrayList<ResultReceiver>());
-        mPendingCallbacks.put(
-                ConnectivityManager.TETHERING_BLUETOOTH, new ArrayList<ResultReceiver>());
+        mPendingCallbacks.put(TETHERING_WIFI, new ArrayList<ResultReceiver>());
+        mPendingCallbacks.put(TETHERING_USB, new ArrayList<ResultReceiver>());
+        mPendingCallbacks.put(TETHERING_BLUETOOTH, new ArrayList<ResultReceiver>());
+        mPendingCallbacks.put(TETHERING_ETHERNET, new ArrayList<ResultReceiver>());
     }
 
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
         if (intent.hasExtra(EXTRA_SUBID)) {
-            final int tetherSubId = intent.getIntExtra(EXTRA_SUBID,
-                    SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+            final int tetherSubId = intent.getIntExtra(EXTRA_SUBID, INVALID_SUBSCRIPTION_ID);
             final int subId = getTetherServiceWrapper().getActiveDataSubscriptionId();
             if (tetherSubId != subId) {
                 Log.e(TAG, "This Provisioning request is outdated, current subId: " + subId);
@@ -109,18 +119,16 @@
                 return START_NOT_STICKY;
             }
         }
-        if (intent.hasExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE)) {
-            int type = intent.getIntExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE,
-                    ConnectivityManager.TETHERING_INVALID);
-            ResultReceiver callback =
-                    intent.getParcelableExtra(ConnectivityManager.EXTRA_PROVISION_CALLBACK);
+        if (intent.hasExtra(EXTRA_ADD_TETHER_TYPE)) {
+            int type = intent.getIntExtra(EXTRA_ADD_TETHER_TYPE, TETHERING_INVALID);
+            ResultReceiver callback = intent.getParcelableExtra(EXTRA_PROVISION_CALLBACK);
             if (callback != null) {
                 List<ResultReceiver> callbacksForType = mPendingCallbacks.get(type);
                 if (callbacksForType != null) {
                     callbacksForType.add(callback);
                 } else {
                     // Invalid tether type. Just ignore this request and report failure.
-                    callback.send(ConnectivityManager.TETHER_ERROR_UNKNOWN_IFACE, null);
+                    callback.send(TETHER_ERROR_UNKNOWN_IFACE, null);
                     stopSelf();
                     return START_NOT_STICKY;
                 }
@@ -132,10 +140,9 @@
             }
         }
 
-        if (intent.hasExtra(ConnectivityManager.EXTRA_REM_TETHER_TYPE)) {
+        if (intent.hasExtra(EXTRA_REM_TETHER_TYPE)) {
             if (!mInProvisionCheck) {
-                int type = intent.getIntExtra(ConnectivityManager.EXTRA_REM_TETHER_TYPE,
-                        ConnectivityManager.TETHERING_INVALID);
+                int type = intent.getIntExtra(EXTRA_REM_TETHER_TYPE, TETHERING_INVALID);
                 int index = mCurrentTethers.indexOf(type);
                 if (DEBUG) Log.d(TAG, "Removing tether " + type + ", index " + index);
                 if (index >= 0) {
@@ -146,7 +153,7 @@
             }
         }
 
-        if (intent.getBooleanExtra(ConnectivityManager.EXTRA_RUN_PROVISION, false)) {
+        if (intent.getBooleanExtra(EXTRA_RUN_PROVISION, false)) {
             startProvisioning(mCurrentTypeIndex);
         } else if (!mInProvisionCheck) {
             // If we aren't running any provisioning, no reason to stay alive.
@@ -207,32 +214,9 @@
         return buffer.toString();
     }
 
-    private void disableWifiTethering() {
-        ConnectivityManager cm =
-                (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
-        cm.stopTethering(ConnectivityManager.TETHERING_WIFI);
-    }
-
-    private void disableUsbTethering() {
-        ConnectivityManager cm =
-                (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
-        cm.setUsbTethering(false);
-    }
-
-    private void disableBtTethering() {
-        final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
-        if (adapter != null) {
-            adapter.getProfileProxy(this, new ServiceListener() {
-                @Override
-                public void onServiceDisconnected(int profile) { }
-
-                @Override
-                public void onServiceConnected(int profile, BluetoothProfile proxy) {
-                    ((BluetoothPan) proxy).setBluetoothTethering(false);
-                    adapter.closeProfileProxy(BluetoothProfile.PAN, proxy);
-                }
-            }, BluetoothProfile.PAN);
-        }
+    private void disableTethering(final int tetheringType) {
+        final TetheringManager tm = (TetheringManager) getSystemService(Context.TETHERING_SERVICE);
+        tm.stopTethering(tetheringType);
     }
 
     private void startProvisioning(int index) {
@@ -255,7 +239,7 @@
         Intent intent = new Intent(provisionAction);
         int type = mCurrentTethers.get(index);
         intent.putExtra(TETHER_CHOICE, type);
-        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
+        intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
         intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND
                 | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
 
@@ -285,8 +269,8 @@
         if (callbacksForType == null) {
             return;
         }
-        int errorCode = result == RESULT_OK ? ConnectivityManager.TETHER_ERROR_NO_ERROR :
-                ConnectivityManager.TETHER_ERROR_PROVISION_FAILED;
+        int errorCode = result == RESULT_OK ? TETHER_ERROR_NO_ERROR :
+                TETHER_ERROR_PROVISIONING_FAILED;
         for (ResultReceiver callback : callbacksForType) {
           if (DEBUG) Log.d(TAG, "Firing result: " + errorCode + " to callback");
           callback.send(errorCode, null);
@@ -309,19 +293,7 @@
                 int checkType = mCurrentTethers.get(mCurrentTypeIndex);
                 mInProvisionCheck = false;
                 int result = intent.getIntExtra(EXTRA_RESULT, RESULT_DEFAULT);
-                if (result != RESULT_OK) {
-                    switch (checkType) {
-                        case ConnectivityManager.TETHERING_WIFI:
-                            disableWifiTethering();
-                            break;
-                        case ConnectivityManager.TETHERING_BLUETOOTH:
-                            disableBtTethering();
-                            break;
-                        case ConnectivityManager.TETHERING_USB:
-                            disableUsbTethering();
-                            break;
-                    }
-                }
+                if (result != RESULT_OK) disableTethering(checkType);
                 fireCallbacksForType(checkType, result);
 
                 if (++mCurrentTypeIndex >= mCurrentTethers.size()) {
diff --git a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
index 514755b..19f29c0 100644
--- a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
+++ b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
@@ -16,15 +16,15 @@
 
 package com.android.settings.wifi.tether;
 
-import static android.net.ConnectivityManager.EXTRA_ADD_TETHER_TYPE;
-import static android.net.ConnectivityManager.EXTRA_PROVISION_CALLBACK;
-import static android.net.ConnectivityManager.EXTRA_RUN_PROVISION;
-import static android.net.ConnectivityManager.TETHERING_BLUETOOTH;
-import static android.net.ConnectivityManager.TETHERING_INVALID;
-import static android.net.ConnectivityManager.TETHERING_USB;
-import static android.net.ConnectivityManager.TETHERING_WIFI;
-import static android.net.ConnectivityManager.TETHER_ERROR_NO_ERROR;
-import static android.net.ConnectivityManager.TETHER_ERROR_PROVISION_FAILED;
+import static android.net.TetheringConstants.EXTRA_ADD_TETHER_TYPE;
+import static android.net.TetheringConstants.EXTRA_PROVISION_CALLBACK;
+import static android.net.TetheringConstants.EXTRA_RUN_PROVISION;
+import static android.net.TetheringManager.TETHERING_BLUETOOTH;
+import static android.net.TetheringManager.TETHERING_INVALID;
+import static android.net.TetheringManager.TETHERING_USB;
+import static android.net.TetheringManager.TETHERING_WIFI;
+import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
 import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
 
 import static org.mockito.Matchers.any;
@@ -47,7 +47,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
-import android.net.ConnectivityManager;
+import android.net.TetheringManager;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.os.ResultReceiver;
@@ -88,7 +88,7 @@
     private ProvisionReceiver mProvisionReceiver;
     private Receiver mResultReceiver;
 
-    @Mock private ConnectivityManager mConnectivityManager;
+    @Mock private TetheringManager mTetheringManager;
     @Mock private PackageManager mPackageManager;
     @Mock private WifiManager mWifiManager;
     @Mock private SharedPreferences mPrefs;
@@ -208,9 +208,9 @@
         runProvisioningForType(TETHERING_WIFI);
 
         assertTrue(waitForProvisionRequest(TETHERING_WIFI));
-        assertTrue(waitForProvisionResponse(TETHER_ERROR_PROVISION_FAILED));
+        assertTrue(waitForProvisionResponse(TETHER_ERROR_PROVISIONING_FAILED));
 
-        verify(mConnectivityManager).stopTethering(ConnectivityManager.TETHERING_WIFI);
+        verify(mTetheringManager).stopTethering(TETHERING_WIFI);
     }
 
     public void testFailureStopsTethering_Usb() {
@@ -219,9 +219,9 @@
         runProvisioningForType(TETHERING_USB);
 
         assertTrue(waitForProvisionRequest(TETHERING_USB));
-        assertTrue(waitForProvisionResponse(TETHER_ERROR_PROVISION_FAILED));
+        assertTrue(waitForProvisionResponse(TETHER_ERROR_PROVISIONING_FAILED));
 
-        verify(mConnectivityManager).setUsbTethering(eq(false));
+        verify(mTetheringManager).stopTethering(TETHERING_USB);
     }
 
     public void testIgnoreOutdatedRequest() {
@@ -345,8 +345,8 @@
 
         @Override
         public Object getSystemService(String name) {
-            if (CONNECTIVITY_SERVICE.equals(name)) {
-                return mConnectivityManager;
+            if (TETHERING_SERVICE.equals(name)) {
+                return mTetheringManager;
             } else if (WIFI_SERVICE.equals(name)) {
                 return mWifiManager;
             }
