diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-06-29 14:05:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-29 14:05:01 -0700 |
commit | 2c22882181e867c9ba4e74ee973b87a71db3389f (patch) | |
tree | 6593873639d24d7fba98e9b7d9cad8f709bf8de9 /services/java/com/android/server/pm/PackageManagerService.java | |
parent | 9e1fb41b4fbfbd190560cf48f24939703a13eca5 (diff) | |
parent | 292f8bc9d1b790ab975a87a842c7fabc908b97e0 (diff) | |
download | frameworks_base-2c22882181e867c9ba4e74ee973b87a71db3389f.zip frameworks_base-2c22882181e867c9ba4e74ee973b87a71db3389f.tar.gz frameworks_base-2c22882181e867c9ba4e74ee973b87a71db3389f.tar.bz2 |
Merge "Plumb information from the framework about asec container size."
Diffstat (limited to 'services/java/com/android/server/pm/PackageManagerService.java')
-rw-r--r-- | services/java/com/android/server/pm/PackageManagerService.java | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 5a9dae9..22e2dde 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -75,6 +75,7 @@ import android.os.Bundle; import android.os.Environment; import android.os.FileObserver; import android.os.FileUtils; +import android.os.FileUtils.FileStatus; import android.os.Handler; import android.os.HandlerThread; import android.os.IBinder; @@ -4887,8 +4888,7 @@ public class PackageManagerService extends IPackageManager.Stub { private final IPackageStatsObserver mObserver; - public MeasureParams(PackageStats stats, boolean success, - IPackageStatsObserver observer) { + public MeasureParams(PackageStats stats, boolean success, IPackageStatsObserver observer) { mObserver = observer; mStats = stats; mSuccess = success; @@ -5480,6 +5480,17 @@ public class PackageManagerService extends IPackageManager.Stub { } } + /** + * Extract the MountService "container ID" from the full code path of an + * .apk. + */ + static String cidFromCodePath(String fullCodePath) { + int eidx = fullCodePath.lastIndexOf("/"); + String subStr1 = fullCodePath.substring(0, eidx); + int sidx = subStr1.lastIndexOf("/"); + return subStr1.substring(sidx+1, eidx); + } + class SdInstallArgs extends InstallArgs { static final String RES_FILE_NAME = "pkg.apk"; @@ -6831,6 +6842,7 @@ public class PackageManagerService extends IPackageManager.Stub { } PackageParser.Package p; boolean dataOnly = false; + String asecPath = null; synchronized (mPackages) { p = mPackages.get(packageName); if(p == null) { @@ -6842,6 +6854,12 @@ public class PackageManagerService extends IPackageManager.Stub { } p = ps.pkg; } + if (p != null && isExternal(p)) { + String secureContainerId = cidFromCodePath(p.applicationInfo.sourceDir); + if (secureContainerId != null) { + asecPath = PackageHelper.getSdFilesystem(secureContainerId); + } + } } String publicSrcDir = null; if(!dataOnly) { @@ -6850,10 +6868,13 @@ public class PackageManagerService extends IPackageManager.Stub { Slog.w(TAG, "Package " + packageName + " has no applicationInfo."); return false; } - publicSrcDir = isForwardLocked(p) ? applicationInfo.publicSourceDir : null; + if (isForwardLocked(p)) { + publicSrcDir = applicationInfo.publicSourceDir; + } } if (mInstaller != null) { - int res = mInstaller.getSizeInfo(packageName, p.mPath, publicSrcDir, pStats); + int res = mInstaller.getSizeInfo(packageName, p.mPath, publicSrcDir, + asecPath, pStats); if (res < 0) { return false; } else { |