Interface for module install APIs.
| abstract Task<ModuleAvailabilityResponse> |
areModulesAvailable(OptionalModuleApi...
apis)
Checks if the optional modules required by the
OptionalModuleApi
are already present on device.
|
| abstract Task<Void> |
deferredInstall(OptionalModuleApi...
apis)
Defers installation of optional modules required by the
OptionalModuleApi.
|
| abstract Task<ModuleInstallIntentResponse> |
getInstallModulesIntent(OptionalModuleApi...
apis)
Gets the
ModuleInstallIntentResponse that includes a PendingIntent
to initiate the optional module download and installation flow.
|
| abstract Task<ModuleInstallResponse> |
installModules(ModuleInstallRequest
request)
Triggers an immediate installation request from a
ModuleInstallRequest.
|
| abstract Task<Void> |
releaseModules(OptionalModuleApi...
apis)
Initiates a request to release optional modules required by
OptionalModuleApi
when they are no longer needed.
|
| abstract Task<Boolean> |
unregisterListener(InstallStatusListener
listener)
Unregisters a listener you previously set in
ModuleInstallRequest.
|
Checks if the optional modules required by the OptionalModuleApi
are already present on device.
This method is intended to be used in cases where you don't want to unconditionally
trigger an immediate installation if the modules aren't available already. If you need
to trigger an immediate installation, use
installModules(ModuleInstallRequest) instead.
| apis | the OptionalModuleApis
that require optional modules. |
|---|
Task with
value
ModuleAvailabilityResponse indicating whether the requested modules are
already present.Defers installation of optional modules required by the OptionalModuleApi.
When called, Google Play services will optimize the best time to install those modules
in the background.
If your app requires immediate access to those modules, use
installModules(ModuleInstallRequest) to install the optional modules right
away.
| apis | the OptionalModuleApis
that require optional modules. |
|---|
Task if the
deferred install request is received.Gets the
ModuleInstallIntentResponse that includes a PendingIntent
to initiate the optional module download and installation flow.
| apis | the OptionalModuleApis
that require optional modules. |
|---|
Task with
value
ModuleInstallIntentResponse which includes the PendingIntent
that can be used to launch the UI flow. A null PendingIntent
indicates that the optional modules are already present on device.Triggers an immediate installation request from a
ModuleInstallRequest.
The Task completes
once the
ModuleInstallRequest has been initiated. This method does not wait for
installation to complete. To monitor the install/download progress of the request, set
a
InstallStatusListener when building the
ModuleInstallRequest to receive
ModuleInstallStatusUpdate, and make sure to
unregisterListener(InstallStatusListener) once the installation completes.
The listener is only registered if the modules requested are not already installed.
The
ModuleInstallResponse indicates whether the modules are already installed
and contains an integer session id that is corresponding to a unique install request. A
session id of 0 and/or
ModuleInstallResponse.areModulesAlreadyInstalled() returned
true indicate that the optional modules are already installed. You don't
need to interact with session id unless the same
InstallStatusListener object is used in multiple
ModuleInstallRequests.
| request | the
ModuleInstallRequest you build for the install request. |
|---|
Task with
value
ModuleInstallResponse if the install request is received.Initiates a request to release optional modules required by OptionalModuleApi
when they are no longer needed.
This method notifies Google Play services that the optional modules are no longer needed for this app, but it does not guarantee the optional modules can be removed. Google Play services will try to clean up the optional modules when they are not used by any apps.
If this method is called when an install request with all the specified modules is
pending, this method will do the best-effort to cancel that install request. You can
monitor the
ModuleInstallStatusUpdate through
InstallStatusListener to listen for the
ModuleInstallStatusUpdate.InstallState.STATE_CANCELED state when the install
request is canceled.
| apis | the OptionalModuleApis
that require optional modules. |
|---|
Task if the
release modules request is received.Unregisters a listener you previously set in
ModuleInstallRequest.
| listener | the same
InstallStatusListener that is set in the
ModuleInstallRequest. |
|---|
true if the given listener was found and unregistered,
false otherwise.