Merge "Include dependency packages in RunningAppProcessInfo"

This commit is contained in:
Chun-Wei Wang
2022-09-02 07:09:51 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -3128,7 +3128,13 @@ public class ActivityManager {
/**
* All packages that have been loaded into the process.
*/
public String pkgList[];
public String[] pkgList;
/**
* Additional packages loaded into the process as dependency.
* @hide
*/
public String[] pkgDeps;
/**
* Constant for {@link #flags}: this is an app that is unable to
@@ -3509,6 +3515,7 @@ public class ActivityManager {
dest.writeInt(pid);
dest.writeInt(uid);
dest.writeStringArray(pkgList);
dest.writeStringArray(pkgDeps);
dest.writeInt(this.flags);
dest.writeInt(lastTrimLevel);
dest.writeInt(importance);
@@ -3527,6 +3534,7 @@ public class ActivityManager {
pid = source.readInt();
uid = source.readInt();
pkgList = source.readStringArray();
pkgDeps = source.readStringArray();
flags = source.readInt();
lastTrimLevel = source.readInt();
importance = source.readInt();

View File

@@ -3724,6 +3724,10 @@ public final class ProcessList {
ActivityManager.RunningAppProcessInfo currApp =
new ActivityManager.RunningAppProcessInfo(app.processName,
app.getPid(), app.getPackageList());
if (app.getPkgDeps() != null) {
final int size = app.getPkgDeps().size();
currApp.pkgDeps = app.getPkgDeps().toArray(new String[size]);
}
fillInProcMemInfoLOSP(app, currApp, clientTargetSdk);
if (state.getAdjSource() instanceof ProcessRecord) {
currApp.importanceReasonPid = ((ProcessRecord) state.getAdjSource()).getPid();