summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/content/pm/PackageInstaller.java13
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerSession.java1
3 files changed, 15 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index cb53ba11a4cd..f78dfde30c3e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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();
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index a96316b3d36e..ec2e8ca26060 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -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;
@@ -1817,6 +1818,9 @@ public class PackageInstaller {
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;
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index d2a160b29a8b..3306ccdf2a22 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -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;
}