Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d4494fd authored by Yisroel Forta's avatar Yisroel Forta
Browse files

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
parent 0fc279fb
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);
    }

+4 −2
Original line number Diff line number Diff line
@@ -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: