diff options
author | Amith Yamasani <yamasani@google.com> | 2015-04-14 15:41:20 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2015-04-14 15:41:20 -0700 |
commit | 1742cfbd8a1458e66f98a56f359590ce3263e161 (patch) | |
tree | ea181319ce153cff773bfa2d3322d766eb19317d | |
parent | 34e79c1e570673148e3e0bbd91df3180a00eeff1 (diff) | |
download | frameworks_base-1742cfbd8a1458e66f98a56f359590ce3263e161.zip frameworks_base-1742cfbd8a1458e66f98a56f359590ce3263e161.tar.gz frameworks_base-1742cfbd8a1458e66f98a56f359590ce3263e161.tar.bz2 |
Always set the dataDir for the given userId
Don't try to optimize for userId != 0 when generating the
ApplicationInfo.
Change-Id: I2eb2d43f36677a781643a1e86a19c8850d517411
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 763a017..7464cab 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -4655,7 +4655,7 @@ public class PackageParser { private static boolean copyNeeded(int flags, Package p, PackageUserState state, Bundle metaData, int userId) { - if (userId != 0) { + if (userId != UserHandle.USER_OWNER) { // We always need to copy for other users, since we need // to fix up the uid. return true; @@ -4737,11 +4737,9 @@ public class PackageParser { // Make shallow copy so we can store the metadata/libraries safely ApplicationInfo ai = new ApplicationInfo(p.applicationInfo); - if (userId != 0) { - ai.uid = UserHandle.getUid(userId, ai.uid); - ai.dataDir = PackageManager.getDataDirForUser(ai.volumeUuid, ai.packageName, userId) - .getAbsolutePath(); - } + ai.uid = UserHandle.getUid(userId, ai.uid); + ai.dataDir = PackageManager.getDataDirForUser(ai.volumeUuid, ai.packageName, userId) + .getAbsolutePath(); if ((flags & PackageManager.GET_META_DATA) != 0) { ai.metaData = p.mAppMetaData; } @@ -4766,11 +4764,9 @@ public class PackageParser { // This is only used to return the ResolverActivity; we will just always // make a copy. ai = new ApplicationInfo(ai); - if (userId != 0) { - ai.uid = UserHandle.getUid(userId, ai.uid); - ai.dataDir = PackageManager.getDataDirForUser(ai.volumeUuid, ai.packageName, userId) - .getAbsolutePath(); - } + ai.uid = UserHandle.getUid(userId, ai.uid); + ai.dataDir = PackageManager.getDataDirForUser(ai.volumeUuid, ai.packageName, userId) + .getAbsolutePath(); if (state.stopped) { ai.flags |= ApplicationInfo.FLAG_STOPPED; } else { |