Stop disabling wifi toggle when tethering is restricted

When an admin disallows the user from configuring tethering, the
user should still be able to configure wifi.
When an admin disallows wifi configuration, the behavior is
unchanged: the toggle stays enabled and allows the user to turn
wifi on and off, but clicking on the text results in admin
transparency dialog, so the user won't be able to change wifi
config.

Bug: 149481093
Test: manual with TestDPC as the device owner
Change-Id: I6b33e43901454125c7f3f4dd3c70f050997e4e71
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 536ea61..dc5be42 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -26,8 +26,6 @@
 import android.net.wifi.SupplicantState;
 import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
-import android.os.UserHandle;
-import android.os.UserManager;
 import android.provider.Settings;
 import android.widget.Toast;
 
@@ -35,8 +33,6 @@
 
 import com.android.settings.R;
 import com.android.settings.widget.SwitchWidgetController;
-import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
-import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.WirelessUtils;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
@@ -76,9 +72,6 @@
         }
     };
 
-    private static final String EVENT_DATA_IS_WIFI_ON = "is_wifi_on";
-    private static final int EVENT_UPDATE_INDEX = 0;
-
     public WifiEnabler(Context context, SwitchWidgetController switchWidget,
         MetricsFeatureProvider metricsFeatureProvider) {
         this(context, switchWidget, metricsFeatureProvider,
@@ -161,15 +154,6 @@
                 setSwitchBarChecked(false);
                 mSwitchWidget.setEnabled(true);
         }
-
-        if (RestrictedLockUtilsInternal.hasBaseUserRestriction(mContext,
-                UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.myUserId())) {
-            mSwitchWidget.setEnabled(false);
-        } else {
-            final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfRestrictionEnforced(
-                    mContext, UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.myUserId());
-            mSwitchWidget.setDisabledByAdmin(admin);
-        }
     }
 
     private void setSwitchBarChecked(boolean checked) {