Package com.android.repository.api
Interface PackageOperation
-
- All Known Subinterfaces:
Installer,Uninstaller
- All Known Implementing Classes:
AbstractInstaller,AbstractPackageOperation,AbstractUninstaller
public interface PackageOperationAn install or uninstall operation that affects the current SDK state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPackageOperation.InstallStatusStatuses of in-progress operations.static interfacePackageOperation.StatusChangeListenerA listener that will be called when thestatusof this installer changes.static classPackageOperation.StatusChangeListenerExceptionException thrown by aPackageOperation.StatusChangeListener.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancomplete(ProgressIndicator progress)Install/Uninstall the package.PackageOperationgetFallbackOperation()If this operation fails, it might be possible to try the install a different way.PackageOperation.InstallStatusgetInstallStatus()Gets the currentPackageOperation.InstallStatusof this installer.java.nio.file.PathgetLocation(ProgressIndicator progress)The filesystem path affected by this operation.java.lang.StringgetName()Gets the name of this operation, suitable for using in user-facing messages.RepoPackagegetPackage()The package (local or remote) that's being affected.RepoManagergetRepoManager()Gets theRepoManagerfor which we're installing/uninstalling a package.booleanprepare(ProgressIndicator progress)Perform any preparatory work that can be done in the background prior to (un)installing a package.voidregisterStateChangeListener(PackageOperation.StatusChangeListener listener)Registers a listener that will be called when thePackageOperation.InstallStatusof this installer changes.voidsetFallbackOperation(PackageOperation fallback)Sets the operation used to retry if this operation fails.
-
-
-
Method Detail
-
getPackage
@NonNull RepoPackage getPackage()
The package (local or remote) that's being affected.
-
getLocation
@NonNull java.nio.file.Path getLocation(@NonNull ProgressIndicator progress)The filesystem path affected by this operation.
-
prepare
boolean prepare(@NonNull ProgressIndicator progress)Perform any preparatory work that can be done in the background prior to (un)installing a package.- Returns:
trueif the preparation was successful,falseotherwise.
-
complete
boolean complete(@NonNull ProgressIndicator progress)Install/Uninstall the package.- Parameters:
progress- AProgressIndicator.- Returns:
trueif the install/uninstall was successful,falseotherwise.
-
getRepoManager
@NonNull RepoManager getRepoManager()
Gets theRepoManagerfor which we're installing/uninstalling a package.
-
registerStateChangeListener
void registerStateChangeListener(@NonNull PackageOperation.StatusChangeListener listener)Registers a listener that will be called when thePackageOperation.InstallStatusof this installer changes.
-
getInstallStatus
@NonNull PackageOperation.InstallStatus getInstallStatus()
Gets the currentPackageOperation.InstallStatusof this installer.
-
getName
@NonNull java.lang.String getName()
Gets the name of this operation, suitable for using in user-facing messages. e.g. "Install Foo" or "Uninstall Bar".
-
getFallbackOperation
@Nullable PackageOperation getFallbackOperation()
If this operation fails, it might be possible to try the install a different way. Specifically, if we have afallback factory, this could be an operation created by that factory.
-
setFallbackOperation
void setFallbackOperation(@Nullable PackageOperation fallback)Sets the operation used to retry if this operation fails.- See Also:
getFallbackOperation()
-
-