Change user 0 directory back for compatibility

The PackageManagerTests aren't designed for multiple users yet, so they
fail. Since multiple users aren't supported yet, just change the default
data directory for user 0 back to how it was previously. This fixes the
existing tests and doesn't get anyone's hopes up since they won't see
/data/user/0/pacakge when we don't support multiple users yet.

Bug: 4380006
Change-Id: Iedcc3115b000759c0013ba6878e13cd2358897da
This commit is contained in:
Kenny Root
2011-07-25 09:42:22 -07:00
parent e432a00051
commit 9c8625ead8

View File

@@ -2860,8 +2860,17 @@ public class PackageManagerService extends IPackageManager.Stub {
}
private File getDataPathForPackage(String packageName, int userId) {
return new File(mUserAppDataDir.getAbsolutePath() + File.separator + userId
/*
* Until we fully support multiple users, return the directory we
* previously would have. The PackageManagerTests will need to be
* revised when this is changed back..
*/
if (userId == 0) {
return new File(mAppDataDir, packageName);
} else {
return new File(mUserAppDataDir.getAbsolutePath() + File.separator + userId
+ File.separator + packageName);
}
}
private PackageParser.Package scanPackageLI(PackageParser.Package pkg,