Disallow prepare()-ing over an always on VPN app

Bug: 27042309
Change-Id: I6aa069a91f20b645f4d23e796ea03b0355155c41
This commit is contained in:
Robin Lee
2016-02-12 18:11:30 +00:00
parent fa272e5c92
commit 1b1bcd7b73

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);