public class RootsCache extends Object
Modifier and Type | Field and Description |
---|---|
static Uri |
sNotificationUri |
Constructor and Description |
---|
RootsCache(Context context) |
Modifier and Type | Method and Description |
---|---|
RootInfo |
getDefaultRootBlocking(State state)
Returns the default root for the specified state.
|
Collection<RootInfo> |
getMatchingRootsBlocking(State state) |
RootInfo |
getRecentsRoot() |
RootInfo |
getRootBlocking(String authority,
String rootId) |
RootInfo |
getRootOneshot(String authority,
String rootId)
Return the requested
RootInfo , but only loading the roots for the
requested authority. |
Collection<RootInfo> |
getRootsBlocking() |
Collection<RootInfo> |
getRootsForAuthorityBlocking(String authority)
Returns a list of roots for the specified authority.
|
boolean |
isIconUniqueBlocking(RootInfo root) |
boolean |
isRecentsRoot(RootInfo root) |
void |
setBootCompletedResult(BroadcastReceiver.PendingResult result) |
void |
updateAsync(boolean forceRefreshAll)
Gather roots from all known storage providers.
|
void |
updateAuthorityAsync(String authority)
Gather roots from storage providers belonging to given authority.
|
void |
updatePackageAsync(String packageName)
Gather roots from storage providers belonging to given package name.
|
public static final Uri sNotificationUri
public RootsCache(Context context)
public void updateAsync(boolean forceRefreshAll)
public void updatePackageAsync(String packageName)
public void updateAuthorityAsync(String authority)
public void setBootCompletedResult(BroadcastReceiver.PendingResult result)
public RootInfo getRootOneshot(String authority, String rootId)
RootInfo
, but only loading the roots for the
requested authority. This is useful when we want to load fast without
waiting for all the other roots to come back.public boolean isIconUniqueBlocking(RootInfo root)
public RootInfo getRecentsRoot()
public boolean isRecentsRoot(RootInfo root)
public Collection<RootInfo> getRootsBlocking()
public Collection<RootInfo> getMatchingRootsBlocking(State state)
public Collection<RootInfo> getRootsForAuthorityBlocking(String authority)