summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joanne Chung <joannechung@google.com> 2023-05-08 15:19:32 +0800
committer Joanne Chung <joannechung@google.com> 2023-05-09 10:51:21 +0800
commitd4443d49a7070c0167a1a72b2690f11efd29f9e5 (patch)
treed0c0cf6e823ca9edf1e99c1a15aec85b54987fee
parentf3475fcf118e8069ed6c2123f9c5bc0882d91107 (diff)
InstallConstraints API javadoc improvement
Bug: 280721937 Test: build pass and boot success Change-Id: Ied7b346413e389f63cda5178a1d6ede24b74c3c4
-rw-r--r--core/java/android/content/pm/PackageInstaller.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index 56f6f8206d30..920ca99acfb9 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -981,6 +981,15 @@ public class PackageInstaller {
*
* The result is returned by a callback because some constraints might take a long time
* to evaluate.
+ *
+ * @param packageNames a list of package names to check the constraints for installation
+ * @param constraints the constraints for installation.
+ * @param executor the {@link Executor} on which to invoke the callback
+ * @param callback called when the {@link InstallConstraintsResult} is ready
+ *
+ * @throws SecurityException if the given packages' installer of record doesn't match the
+ * caller's own package name or the installerPackageName set by the caller doesn't
+ * match the caller's own package name.
*/
public void checkInstallConstraints(@NonNull List<String> packageNames,
@NonNull InstallConstraints constraints,
@@ -1008,6 +1017,8 @@ public class PackageInstaller {
* Note: the device idle constraint might take a long time to evaluate. The system will
* ensure the constraint is evaluated completely before handling timeout.
*
+ * @param packageNames a list of package names to check the constraints for installation
+ * @param constraints the constraints for installation.
* @param callback Called when the constraints are satisfied or after timeout.
* Intents sent to this callback contain:
* {@link Intent#EXTRA_PACKAGES} for the input package names,
@@ -1017,6 +1028,9 @@ public class PackageInstaller {
* satisfied. Valid range is from 0 to one week. {@code 0} means the
* callback will be invoked immediately no matter constraints are
* satisfied or not.
+ * @throws SecurityException if the given packages' installer of record doesn't match the
+ * caller's own package name or the installerPackageName set by the caller doesn't
+ * match the caller's own package name.
*/
public void waitForInstallConstraints(@NonNull List<String> packageNames,
@NonNull InstallConstraints constraints,
@@ -1039,6 +1053,7 @@ public class PackageInstaller {
* may be performed on the session. In the case of timeout, you may commit the
* session again using this method or {@link Session#commit(IntentSender)} for retries.
*
+ * @param sessionId the session ID to commit when all constraints are satisfied.
* @param statusReceiver Called when the state of the session changes. Intents
* sent to this receiver contain {@link #EXTRA_STATUS}.
* Refer to the individual status codes on how to handle them.