Merge "Disallow prepare()-ing over an always on VPN app" into nyc-dev

This commit is contained in:
Robin Lee
2016-04-06 19:12:42 +00:00
committed by Android (Google) Code Review

View File

@@ -264,7 +264,12 @@ public class Vpn {
return true;
}
// Check if the caller is authorized.
// Stop an existing always-on VPN from being dethroned by other apps.
if (getAlwaysOnPackage() != null) {
return false;
}
// Check that the caller is authorized.
enforceControlPermission();
prepareInternal(newPackage);