public abstract class BaseProductProvider extends java.lang.Object implements ProductProviderManager.Provider
Modifier and Type | Field and Description |
---|---|
protected ProductRepository |
_cache |
protected android.app.Activity |
_context |
Constructor and Description |
---|
BaseProductProvider(android.app.Activity context) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String pkg) |
void |
dispose() |
ProductRepository |
get()
Get cached repo contents
|
protected abstract java.io.File |
getAPK(ProductInformation product)
Runs on UI thread, must be quick (i.e.
|
void |
install(ProductInformation product)
Base impl ignores bForce
|
boolean |
installed(java.lang.String pkg)
Notification that an app has been installed
|
boolean |
isRemote()
Check if the repo is hosted remotely (not on this device)
|
protected abstract ProductRepository |
load()
Load cached index
|
protected ProductRepository |
parseRepo(java.lang.String repoType,
java.io.File repoIndex) |
java.lang.String |
toString() |
void |
uninstall(ProductInformation product)
User has requested to uninstall the product
This is done on UI thread by default, so if operation may be long running, implementations
should off load to another thread
|
boolean |
uninstalled(java.lang.String pkg)
Notification that an app has been uninstalled
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
rebuild
protected ProductRepository _cache
protected android.app.Activity _context
public void dispose()
dispose
in interface ProductProviderManager.Provider
public ProductRepository get()
ProductProviderManager.Provider
get
in interface ProductProviderManager.Provider
protected abstract ProductRepository load()
protected abstract java.io.File getAPK(ProductInformation product)
product
- the product informationpublic boolean contains(java.lang.String pkg)
contains
in interface ProductProviderManager.Provider
public void install(ProductInformation product)
install
in interface ProductProviderManager.Provider
product
- install the product described by the passed in product informationpublic void uninstall(ProductInformation product)
ProductProviderManager.Provider
uninstall
in interface ProductProviderManager.Provider
public boolean installed(java.lang.String pkg)
ProductProviderManager.Provider
installed
in interface ProductProviderManager.Provider
public boolean uninstalled(java.lang.String pkg)
ProductProviderManager.Provider
uninstalled
in interface ProductProviderManager.Provider
public boolean isRemote()
ProductProviderManager.Provider
isRemote
in interface ProductProviderManager.Provider
protected ProductRepository parseRepo(java.lang.String repoType, java.io.File repoIndex)
public java.lang.String toString()
toString
in class java.lang.Object