|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.archives.ArchiveReplacement
com.android.sdklib.internal.repository.updater.ArchiveInfo
public class ArchiveInfo
Represents an archive that we want to install. Note that the installer deals with archives whereas the user mostly sees packages but as far as we are concerned for installation there's a 1-to-1 mapping.
A new archive is always a remote archive that needs to be downloaded and then installed. It can replace an existing local one. It can also depends on another (new or local) archive, which means the dependent archive needs to be successfully installed first. Finally this archive can also be a dependency for another one. The accepted and rejected flags are used bySdkUpdaterChooserDialog to follow
user choices. The installer should never install something that is not accepted.
Note: There is currently no logic to support more than one level of
dependency, either here or in the SdkUpdaterChooserDialog, since we currently
have no need for it.
ArchiveInfo(Archive, Archive, ArchiveInfo[])| Constructor Summary | |
|---|---|
ArchiveInfo(Archive newArchive,
Archive replaced,
ArchiveInfo[] dependsOn)
Creates a new replacement where the newArchive will replace the
currently installed replaced archive. |
|
| Method Summary | |
|---|---|
ArchiveInfo |
addDependencyFor(ArchiveInfo dependencyFor)
Adds an ArchiveInfo for which this package is a dependency. |
int |
compareTo(ArchiveInfo rhs)
ArchiveInfos are compared using ther "new archive" ordering. |
java.util.Collection<ArchiveInfo> |
getDependenciesFor()
Returns the list of ArchiveInfo for which this package is a dependency. |
ArchiveInfo[] |
getDependsOn()
Returns an optional new or local dependency, that is an archive that this archive depends upon. |
boolean |
isAccepted()
Returns whether this archive was accepted (either manually by the user or automatically if it doesn't have a license) for installation. |
boolean |
isDependencyFor()
Returns true if this new archive is a dependency for another one that we want to install. |
boolean |
isRejected()
Returns whether this archive was rejected manually by the user. |
void |
setAccepted(boolean accepted)
Sets whether this archive was accepted (either manually by the user or automatically if it doesn't have a license) for installation. |
void |
setRejected(boolean rejected)
Sets whether this archive was rejected manually by the user. |
| Methods inherited from class com.android.sdklib.internal.repository.archives.ArchiveReplacement |
|---|
getLongDescription, getNewArchive, getReplaced, getShortDescription, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArchiveInfo(@Nullable
Archive newArchive,
@Nullable
Archive replaced,
@Nullable
ArchiveInfo[] dependsOn)
newArchive will replace the
currently installed replaced archive.
When newArchive is not intended to replace anything (e.g. because
the user is installing a new package not present on her system yet), then
replace shall be null.
newArchive - A "new archive" to be installed. This is always an archive
that comes from a remote site. This may be null.replaced - An optional local archive that the new one will replace.
Can be null if this archive does not replace anything.dependsOn - An optional new or local dependency, that is an archive that
this archive depends upon. In other words, we can only install
this archive if the dependency has been successfully installed. It also
means we need to install the dependency first. Can be null or empty.
However it cannot contain nulls.| Method Detail |
|---|
@Nullable public ArchiveInfo[] getDependsOn()
public boolean isDependencyFor()
@NonNull public ArchiveInfo addDependencyFor(ArchiveInfo dependencyFor)
ArchiveInfo for which this package is a dependency.
This means the package added here depends on this package.
@NonNull public java.util.Collection<ArchiveInfo> getDependenciesFor()
ArchiveInfo for which this package is a dependency.
This means the packages listed here depend on this package.
Implementation detail: this is the internal mutable list. Callers should not modify it.
This list can be empty but is never null.
public void setAccepted(boolean accepted)
public boolean isAccepted()
public void setRejected(boolean rejected)
public boolean isRejected()
public int compareTo(ArchiveInfo rhs)
compareTo in interface java.lang.Comparable<ArchiveInfo>Archive.compareTo(Archive)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||