Merge "InstallConstraints API javadoc improvement" into udc-dev am: 029ca32ffa am: 632dc413ab

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23050247

Change-Id: Iebdb144faeee723f2ae554f141536d0aefc6b11f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Joanne Chung
2023-05-09 11:34:22 +00:00
committed by Automerger Merge Worker

View File

@@ -981,6 +981,15 @@ public class PackageInstaller {
* *
* The result is returned by a callback because some constraints might take a long time * The result is returned by a callback because some constraints might take a long time
* to evaluate. * 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, public void checkInstallConstraints(@NonNull List<String> packageNames,
@NonNull InstallConstraints constraints, @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 * Note: the device idle constraint might take a long time to evaluate. The system will
* ensure the constraint is evaluated completely before handling timeout. * 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. * @param callback Called when the constraints are satisfied or after timeout.
* Intents sent to this callback contain: * Intents sent to this callback contain:
* {@link Intent#EXTRA_PACKAGES} for the input package names, * {@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 * satisfied. Valid range is from 0 to one week. {@code 0} means the
* callback will be invoked immediately no matter constraints are * callback will be invoked immediately no matter constraints are
* satisfied or not. * 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, public void waitForInstallConstraints(@NonNull List<String> packageNames,
@NonNull InstallConstraints constraints, @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 * 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. * 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 * @param statusReceiver Called when the state of the session changes. Intents
* sent to this receiver contain {@link #EXTRA_STATUS}. * sent to this receiver contain {@link #EXTRA_STATUS}.
* Refer to the individual status codes on how to handle them. * Refer to the individual status codes on how to handle them.