use of com.android.documentsui.model.RootInfo in project android_frameworks_base by AOSPA.
the class RootsCache method getRootOneshot.
/**
* Return the requested {@link 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 RootInfo getRootOneshot(String authority, String rootId) {
synchronized (mLock) {
RootInfo root = getRootLocked(authority, rootId);
if (root == null) {
mRoots.putAll(authority, loadRootsForAuthority(mContext.getContentResolver(), authority, false));
root = getRootLocked(authority, rootId);
}
return root;
}
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by ResurrectionRemix.
the class BaseActivity method reloadSearch.
private void reloadSearch(String query) {
FragmentManager fm = getFragmentManager();
RootInfo root = getCurrentRoot();
DocumentInfo cwd = getCurrentDirectory();
DirectoryFragment.reloadSearch(fm, root, cwd, query);
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by ResurrectionRemix.
the class RootsCacheTest method testMatchingRoots_DirectoryCopy.
public void testMatchingRoots_DirectoryCopy() throws Exception {
RootInfo downloads = buildForMimeTypes("*/*");
downloads.authority = "com.android.providers.downloads.documents";
mRoots.add(downloads);
mState.acceptMimes = new String[] { "*/*" };
mState.directoryCopy = true;
// basically we're asserting that the results don't contain downloads
assertContainsExactly(newArrayList(mNull, mWild, mImages, mAudio, mDocs, mMalformed1, mMalformed2), getMatchingRoots(mRoots, mState));
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by ResurrectionRemix.
the class RootsCacheTest method testExcludedAuthorities.
public void testExcludedAuthorities() throws Exception {
final List<RootInfo> roots = newArrayList();
// Set up some roots
for (int i = 0; i < 5; ++i) {
RootInfo root = new RootInfo();
root.authority = "authority" + i;
roots.add(root);
}
// Make some allowed authorities
List<RootInfo> allowedRoots = newArrayList(roots.get(0), roots.get(2), roots.get(4));
// Set up the excluded authority list
for (RootInfo root : roots) {
if (!allowedRoots.contains(root)) {
mState.excludedAuthorities.add(root.authority);
}
}
mState.acceptMimes = new String[] { "*/*" };
assertContainsExactly(allowedRoots, getMatchingRoots(roots, mState));
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by ResurrectionRemix.
the class RootsCacheTest method buildForMimeTypes.
private static RootInfo buildForMimeTypes(String... mimeTypes) {
final RootInfo root = new RootInfo();
root.derivedMimeTypes = mimeTypes;
return root;
}
Aggregations