Merge changes Ide9daebc,Id47ada57
* changes: Ensure all VPN runners clean up state when exiting Enforce restricted user, getConnectionOwnerUid checks
This commit is contained in:
@@ -7528,6 +7528,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
*/
|
||||
public int getConnectionOwnerUid(ConnectionInfo connectionInfo) {
|
||||
final Vpn vpn = enforceActiveVpnOrNetworkStackPermission();
|
||||
|
||||
// Only VpnService based VPNs should be able to get this information.
|
||||
if (vpn != null && vpn.getActiveAppVpnType() != VpnManager.TYPE_VPN_SERVICE) {
|
||||
throw new SecurityException(
|
||||
"getConnectionOwnerUid() not allowed for non-VpnService VPNs");
|
||||
}
|
||||
|
||||
if (connectionInfo.protocol != IPPROTO_TCP && connectionInfo.protocol != IPPROTO_UDP) {
|
||||
throw new IllegalArgumentException("Unsupported protocol " + connectionInfo.protocol);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user