Package com.android.repository.impl.meta
Class RepositoryPackages
- java.lang.Object
-
- com.android.repository.impl.meta.RepositoryPackages
-
public final class RepositoryPackages extends java.lang.ObjectStore of currently-known local and remote packages, in convenient forms.
-
-
Constructor Summary
Constructors Constructor Description RepositoryPackages()RepositoryPackages(java.util.List<LocalPackage> localPkgs, java.util.List<RemotePackage> remotePkgs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,UpdatablePackage>getConsolidatedPkgs()Returns a map of package install ids toUpdatablePackages representing all known local and remote packages.java.util.Map<java.lang.String,LocalPackage>getLocalPackages()Returns a map ofpath(the unique ID of a package) toLocalPackage, for all packages currently installed.java.util.Collection<LocalPackage>getLocalPackagesForPrefix(java.lang.String pathPrefix)java.util.Set<RemotePackage>getNewPkgs()Returns the set of new remote packages that are not locally present and that the user could install.java.util.Map<java.lang.String,RemotePackage>getRemotePackages()java.util.Collection<RemotePackage>getRemotePackagesForPrefix(java.lang.String pathPrefix)longgetTimestampMs()Returns the timestamp (inSystem.currentTimeMillis()time) when this object was created.java.util.Set<UpdatablePackage>getUpdatedPkgs()Returns the set of packages that have local updates available.voidsetLocalPkgInfos(java.util.Collection<LocalPackage> packages)Sets the collection of knownLocalPackages, and recomputes the list of updates and new packages, ifRemotePackages have been set.voidsetRemotePkgInfos(java.util.Collection<RemotePackage> packages)Sets the collection of knownRemotePackages, and recomputes the list of updates and new packages, ifLocalPackages have been set.
-
-
-
Constructor Detail
-
RepositoryPackages
public RepositoryPackages()
-
RepositoryPackages
public RepositoryPackages(@NonNull java.util.List<LocalPackage> localPkgs, @NonNull java.util.List<RemotePackage> remotePkgs)
-
-
Method Detail
-
getTimestampMs
public long getTimestampMs()
Returns the timestamp (inSystem.currentTimeMillis()time) when this object was created.
-
getUpdatedPkgs
@NonNull public java.util.Set<UpdatablePackage> getUpdatedPkgs()
Returns the set of packages that have local updates available.- Returns:
- A non-null, possibly empty Set of update candidates.
-
getNewPkgs
@NonNull public java.util.Set<RemotePackage> getNewPkgs()
Returns the set of new remote packages that are not locally present and that the user could install.- Returns:
- A non-null, possibly empty Set of new install candidates.
-
getConsolidatedPkgs
@NonNull public java.util.Map<java.lang.String,UpdatablePackage> getConsolidatedPkgs()
Returns a map of package install ids toUpdatablePackages representing all known local and remote packages. Remote packages corresponding to local packages will be represented by a single item containing both the local and remote info. {@see IPkgDesc#getInstallId()}
-
getLocalPackages
@NonNull public java.util.Map<java.lang.String,LocalPackage> getLocalPackages()
Returns a map ofpath(the unique ID of a package) toLocalPackage, for all packages currently installed.
-
getRemotePackages
@NonNull public java.util.Map<java.lang.String,RemotePackage> getRemotePackages()
-
getLocalPackagesForPrefix
@NonNull public java.util.Collection<LocalPackage> getLocalPackagesForPrefix(@Nullable java.lang.String pathPrefix)
-
getRemotePackagesForPrefix
@NonNull public java.util.Collection<RemotePackage> getRemotePackagesForPrefix(@Nullable java.lang.String pathPrefix)
-
setLocalPkgInfos
public void setLocalPkgInfos(@NonNull java.util.Collection<LocalPackage> packages)Sets the collection of knownLocalPackages, and recomputes the list of updates and new packages, ifRemotePackages have been set.
-
setRemotePkgInfos
public void setRemotePkgInfos(@NonNull java.util.Collection<RemotePackage> packages)Sets the collection of knownRemotePackages, and recomputes the list of updates and new packages, ifLocalPackages have been set.
-
-