Skip to content

Commit 2afded1

Browse files
committed
Measure ASECs for forward-locked apps
Forward-locked apps are mostly in ASEC containers now, so the containers need to be measured as well. Bug: 6606390 Change-Id: I69e9fe47aabe1e130568779a45fe8000b3ce9d4c
1 parent b7161f5 commit 2afded1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7839,7 +7839,7 @@ private boolean getPackageSizeInfoLI(String packageName, PackageStats pStats) {
78397839
}
78407840
p = ps.pkg;
78417841
}
7842-
if (p != null && isExternal(p)) {
7842+
if (p != null && (isExternal(p) || isForwardLocked(p))) {
78437843
String secureContainerId = cidFromCodePath(p.applicationInfo.sourceDir);
78447844
if (secureContainerId != null) {
78457845
asecPath = PackageHelper.getSdFilesystem(secureContainerId);
@@ -7862,6 +7862,13 @@ private boolean getPackageSizeInfoLI(String packageName, PackageStats pStats) {
78627862
if (res < 0) {
78637863
return false;
78647864
}
7865+
7866+
// Fix-up for forward-locked applications in ASEC containers.
7867+
if (!isExternal(p)) {
7868+
pStats.codeSize += pStats.externalCodeSize;
7869+
pStats.externalCodeSize = 0L;
7870+
}
7871+
78657872
return true;
78667873
}
78677874

0 commit comments

Comments
 (0)