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

Commit 56c14ddc authored by Dario Freni's avatar Dario Freni Committed by Todd Kennedy
Browse files

Return the update timestamp in getStagedSessions()

This CL adds a SessionInfo.getUpdateMillis() call to the API in order
for callers to figure out which session was applied last.

Change-Id: I3eed6c80f4777ee248671d17d9428eed2fe73aa8
Fix: 129546185
Test: atest CtsStagedInstallHostTestCases; atest apex_e2e_tests
parent 1c53bca6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11452,6 +11452,7 @@ package android.content.pm {
    method public long getSize();
    method public int getStagedSessionErrorCode();
    method @NonNull public String getStagedSessionErrorMessage();
    method public long getUpdatedMillis();
    method @NonNull public android.os.UserHandle getUser();
    method public boolean isActive();
    method public boolean isCommitted();
+13 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.content.pm;

import android.Manifest;
import android.annotation.CurrentTimeMillisLong;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1816,6 +1817,9 @@ public class PackageInstaller {
        /** {@hide} */
        public boolean isCommitted;

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

        /** {@hide} */
        @UnsupportedAppUsage
        public SessionInfo() {
@@ -2237,6 +2241,15 @@ public class PackageInstaller {
            return isCommitted;
        }

        /**
         * The timestamp of the last update that occurred to the session, including changing of
         * states in case of staged sessions.
         */
        @CurrentTimeMillisLong
        public long getUpdatedMillis() {
            return updatedMillis;
        }

        @Override
        public int describeContents() {
            return 0;
+1 −0
Original line number Diff line number Diff line
@@ -498,6 +498,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
            info.isStagedSessionReady = mStagedSessionReady;
            info.isStagedSessionFailed = mStagedSessionFailed;
            info.setStagedSessionErrorCode(mStagedSessionErrorCode, mStagedSessionErrorMessage);
            info.updatedMillis = updatedMillis;
        }
        return info;
    }