summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2014-10-28 20:00:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-28 20:00:32 +0000
commitf82b029c7c47568f75eb4a7e676baf2cb61c967f (patch)
tree991f0cd8d5098fe8a2e48e3b519f44cee0ed1961 /services
parent9513604cdcfe56eaca70bd5c5a4f672a2b46d1a2 (diff)
parentbe08587510edbc149c841638db721eb97d2351b6 (diff)
downloadframeworks_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.java6
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;
}