Network Reset should have a lockdown like Factory Reset.

bug:20332322
Change-Id: I7c61a011d11e89513757f112abf320bb2a785edb
This commit is contained in:
Stuart Scott
2015-04-20 14:07:45 -07:00
parent 73dc94036d
commit 7c7cecec4a

View File

@@ -4602,16 +4602,24 @@ public class ConnectivityService extends IConnectivityManager.Stub
@Override @Override
public void factoryReset() { public void factoryReset() {
enforceConnectivityInternalPermission(); enforceConnectivityInternalPermission();
if (mUserManager.hasUserRestriction(UserManager.DISALLOW_NETWORK_RESET)) {
return;
}
final int userId = UserHandle.getCallingUserId(); final int userId = UserHandle.getCallingUserId();
// Turn airplane mode off // Turn airplane mode off
setAirplaneMode(false); setAirplaneMode(false);
if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING)) {
// Untether // Untether
for (String tether : getTetheredIfaces()) { for (String tether : getTetheredIfaces()) {
untether(tether); untether(tether);
} }
}
if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
// Turn VPN off // Turn VPN off
VpnConfig vpnConfig = getVpnConfig(userId); VpnConfig vpnConfig = getVpnConfig(userId);
if (vpnConfig != null) { if (vpnConfig != null) {
@@ -4627,3 +4635,4 @@ public class ConnectivityService extends IConnectivityManager.Stub
} }
} }
} }
}