Network Reset should have a lockdown like Factory Reset.
bug:20332322 Change-Id: I7c61a011d11e89513757f112abf320bb2a785edb (cherry picked from commit 94b038bbb291431a7b39611d72f206b07e839891)
This commit is contained in:
@@ -4603,16 +4603,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,4 +4635,5 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user