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

Commit b43c634b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Export timestamp of the creation of install session. The timestamp is...

Merge "Export timestamp of the creation of install session. The timestamp is an useful signal for downstream to determine post-creation operation."
parents d474dcd5 bc969f43
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11773,6 +11773,7 @@ package android.content.pm {
    method @Nullable public CharSequence getAppLabel();
    method @Nullable public String getAppPackageName();
    method @NonNull public int[] getChildSessionIds();
    method public long getCreatedMillis();
    method public int getInstallLocation();
    method public int getInstallReason();
    method @Nullable public String getInstallerPackageName();
+12 −0
Original line number Diff line number Diff line
@@ -2028,6 +2028,9 @@ public class PackageInstaller {
        /** {@hide} */
        public boolean isCommitted;

        /** {@hide} */
        public long createdMillis;

        /** {@hide} */
        public long updatedMillis;

@@ -2078,6 +2081,7 @@ public class PackageInstaller {
            mStagedSessionErrorMessage = source.readString();
            isCommitted = source.readBoolean();
            rollbackDataPolicy = source.readInt();
            createdMillis = source.readLong();
        }

        /**
@@ -2519,6 +2523,13 @@ public class PackageInstaller {
            return isCommitted;
        }

        /**
         * The timestamp of the initial creation of the session.
         */
        public long getCreatedMillis() {
            return createdMillis;
        }

        /**
         * The timestamp of the last update that occurred to the session, including changing of
         * states in case of staged sessions.
@@ -2568,6 +2579,7 @@ public class PackageInstaller {
            dest.writeString(mStagedSessionErrorMessage);
            dest.writeBoolean(isCommitted);
            dest.writeInt(rollbackDataPolicy);
            dest.writeLong(createdMillis);
        }

        public static final Parcelable.Creator<SessionInfo>
+1 −0
Original line number Diff line number Diff line
@@ -597,6 +597,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
            info.isStagedSessionReady = mStagedSessionReady;
            info.isStagedSessionFailed = mStagedSessionFailed;
            info.setStagedSessionErrorCode(mStagedSessionErrorCode, mStagedSessionErrorMessage);
            info.createdMillis = createdMillis;
            info.updatedMillis = updatedMillis;
        }
        return info;
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ public class PackageInstallerSessionTest {
                actual.getStagedSessionErrorMessage());
        assertEquals(expected.isPrepared(), actual.isPrepared());
        assertEquals(expected.isCommitted(), actual.isCommitted());
        assertEquals(expected.createdMillis, actual.createdMillis);
        assertEquals(expected.isSealed(), actual.isSealed());
        assertEquals(expected.isMultiPackage(), actual.isMultiPackage());
        assertEquals(expected.hasParentSessionId(), actual.hasParentSessionId());