diff options
| author | 2024-09-26 17:52:39 +0000 | |
|---|---|---|
| committer | 2024-10-02 14:33:49 +0000 | |
| commit | 4d4494fde63f39ed88471d866eac86ec2a5b305c (patch) | |
| tree | 5f232d45814e40b9081ad46f0c8ed2002b464403 | |
| parent | 0fc279fb25bdd4e178137dbf4303ffaf69d3ac8b (diff) | |
Set startinfo package name from persisted data
The field is already being stored in the higher level proto which
is why it missing does not impact accessing persisted records.
Use the already existing field and populate to all records under
it.
Test: run start info tests
Bug: EXEMPT - bugfix
Flag: EXEMPT - bugfix
Change-Id: I37883350de9a7f2333d5689a2558a3a417698949
| -rw-r--r-- | core/java/android/app/ApplicationStartInfo.java | 7 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/AppStartInfoTracker.java | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/app/ApplicationStartInfo.java b/core/java/android/app/ApplicationStartInfo.java index edcdb6cc58ea..5680ea5c4e58 100644 --- a/core/java/android/app/ApplicationStartInfo.java +++ b/core/java/android/app/ApplicationStartInfo.java @@ -1065,8 +1065,9 @@ public final class ApplicationStartInfo implements Parcelable { return mPid == o.mPid && mRealUid == o.mRealUid && mPackageUid == o.mPackageUid && mDefiningUid == o.mDefiningUid && mReason == o.mReason && mStartupState == o.mStartupState && mStartType == o.mStartType - && mLaunchMode == o.mLaunchMode && TextUtils.equals(mProcessName, o.mProcessName) - && timestampsEquals(o) && mWasForceStopped == o.mWasForceStopped + && mLaunchMode == o.mLaunchMode && TextUtils.equals(mPackageName, o.mPackageName) + && TextUtils.equals(mProcessName, o.mProcessName) && timestampsEquals(o) + && mWasForceStopped == o.mWasForceStopped && mMonoticCreationTimeMs == o.mMonoticCreationTimeMs && mStartComponent == o.mStartComponent; } @@ -1074,7 +1075,7 @@ public final class ApplicationStartInfo implements Parcelable { @Override public int hashCode() { return Objects.hash(mPid, mRealUid, mPackageUid, mDefiningUid, mReason, mStartupState, - mStartType, mLaunchMode, mProcessName, mStartupTimestampsNs, + mStartType, mLaunchMode, mPackageName, mProcessName, mStartupTimestampsNs, mMonoticCreationTimeMs, mStartComponent); } diff --git a/services/core/java/com/android/server/am/AppStartInfoTracker.java b/services/core/java/com/android/server/am/AppStartInfoTracker.java index 71b64567d062..aca6d0b0b967 100644 --- a/services/core/java/com/android/server/am/AppStartInfoTracker.java +++ b/services/core/java/com/android/server/am/AppStartInfoTracker.java @@ -1005,7 +1005,8 @@ public final class AppStartInfoTracker { case (int) AppsStartInfoProto.Package.USERS: AppStartInfoContainer container = new AppStartInfoContainer(mAppStartInfoHistoryListSize); - int uid = container.readFromProto(proto, AppsStartInfoProto.Package.USERS); + int uid = container.readFromProto(proto, AppsStartInfoProto.Package.USERS, + pkgName); synchronized (mLock) { mData.put(pkgName, uid, container); } @@ -1403,7 +1404,7 @@ public final class AppStartInfoTracker { proto.end(token); } - int readFromProto(ProtoInputStream proto, long fieldId) + int readFromProto(ProtoInputStream proto, long fieldId, String packageName) throws IOException, WireTypeMismatchException, ClassNotFoundException { long token = proto.start(fieldId); for (int next = proto.nextField(); @@ -1418,6 +1419,7 @@ public final class AppStartInfoTracker { // have a create time. ApplicationStartInfo info = new ApplicationStartInfo(0); info.readFromProto(proto, AppsStartInfoProto.Package.User.APP_START_INFO); + info.setPackageName(packageName); mInfos.add(info); break; case (int) AppsStartInfoProto.Package.User.MONITORING_ENABLED: |