diff options
author | Jeff Davidson <jpd@google.com> | 2014-10-28 20:00:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-28 20:00:32 +0000 |
commit | f82b029c7c47568f75eb4a7e676baf2cb61c967f (patch) | |
tree | 991f0cd8d5098fe8a2e48e3b519f44cee0ed1961 /services | |
parent | 9513604cdcfe56eaca70bd5c5a4f672a2b46d1a2 (diff) | |
parent | be08587510edbc149c841638db721eb97d2351b6 (diff) | |
download | frameworks_base-f82b029c7c47568f75eb4a7e676baf2cb61c967f.zip frameworks_base-f82b029c7c47568f75eb4a7e676baf2cb61c967f.tar.gz frameworks_base-f82b029c7c47568f75eb4a7e676baf2cb61c967f.tar.bz2 |
Merge "Check UID instead of package name when preparing VPN." into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/connectivity/Vpn.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index 3f6b71a..83756aa 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -215,7 +215,7 @@ public class Vpn { */ public synchronized boolean prepare(String oldPackage, String newPackage) { // Return false if the package does not match. - if (oldPackage != null && !oldPackage.equals(mPackage)) { + if (oldPackage != null && getAppUid(oldPackage, mUserHandle) != mOwnerUID) { // The package doesn't match. If this VPN was not previously authorized, return false // to force user authorization. Otherwise, revoke the VPN anyway. if (!oldPackage.equals(VpnConfig.LEGACY_VPN) && isVpnUserPreConsented(oldPackage)) { @@ -234,8 +234,8 @@ public class Vpn { } // Return true if we do not need to revoke. - if (newPackage == null || - (newPackage.equals(mPackage) && !newPackage.equals(VpnConfig.LEGACY_VPN))) { + if (newPackage == null || (!newPackage.equals(VpnConfig.LEGACY_VPN) && + getAppUid(newPackage, mUserHandle) == mOwnerUID)) { return true; } |