OSDN Git Service

Repair broken keychain wifi_uid logic
authorRobin Lee <rgl@google.com>
Fri, 30 Jan 2015 14:57:25 +0000 (14:57 +0000)
committerRobin Lee <rgl@google.com>
Fri, 30 Jan 2015 19:00:45 +0000 (19:00 +0000)
Check for cross-user installs was missing a short-circuit for installs
where no UID was specified. This is now added.

Bug: 19194391
Change-Id: I10aa8323b47e0fcabb59e7c30d677080bb80b976

src/com/android/settings/CredentialStorage.java

index 40bed90..60803dc 100644 (file)
@@ -223,9 +223,9 @@ public final class CredentialStorage extends Activity {
         Bundle bundle = mInstallBundle;
         mInstallBundle = null;
 
-        final int uid = bundle.getInt(Credentials.EXTRA_INSTALL_AS_UID, -1);
+        final int uid = bundle.getInt(Credentials.EXTRA_INSTALL_AS_UID, KeyStore.UID_SELF);
 
-        if (!UserHandle.isSameUser(uid, Process.myUid())) {
+        if (uid != KeyStore.UID_SELF && !UserHandle.isSameUser(uid, Process.myUid())) {
             int dstUserId = UserHandle.getUserId(uid);
             int myUserId = UserHandle.myUserId();