summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2014-06-24 10:56:55 -0400
committerJulia Reynolds <juliacr@google.com>2014-07-02 16:46:54 +0000
commitfc6b2a0be3524e09c6e12eeaf0222a2ecf2a3007 (patch)
tree2992adadbcaa34d57af666c31ed9d27bab75de83 /services
parentbe55c0d23b02f9de9f295f3bca2f7cd7f016c4d6 (diff)
downloadframeworks_base-fc6b2a0be3524e09c6e12eeaf0222a2ecf2a3007.zip
frameworks_base-fc6b2a0be3524e09c6e12eeaf0222a2ecf2a3007.tar.gz
frameworks_base-fc6b2a0be3524e09c6e12eeaf0222a2ecf2a3007.tar.bz2
Apply the tethering user restriction to connectivity service.
Bug: 15852213 Change-Id: Ib2df696189981ed1b31955257047fac3ee403965
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 64db8cf..87d28d3 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -109,6 +109,7 @@ import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
+import android.os.UserManager;
import android.provider.Settings;
import android.security.Credentials;
import android.security.KeyStore;
@@ -482,6 +483,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private AppOpsManager mAppOpsManager;
+ private UserManager mUserManager;
+
NetworkConfig[] mNetConfigs;
int mNetworksDefined;
@@ -884,6 +887,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mContext.registerReceiver(mProvisioningReceiver, filter);
mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
+
+ mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
}
private synchronized int nextNetworkRequestId() {
@@ -3607,7 +3612,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
enforceTetherAccessPermission();
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
boolean tetherEnabledInSettings = (Settings.Global.getInt(mContext.getContentResolver(),
- Settings.Global.TETHER_SUPPORTED, defaultVal) != 0);
+ Settings.Global.TETHER_SUPPORTED, defaultVal) != 0)
+ && !mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING);
return tetherEnabledInSettings && ((mTethering.getTetherableUsbRegexs().length != 0 ||
mTethering.getTetherableWifiRegexs().length != 0 ||
mTethering.getTetherableBluetoothRegexs().length != 0) &&