use of com.android.documentsui.model.RootInfo in project android_frameworks_base by AOSPA.
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 AOSPA.
the class BaseActivity method canCreateDirectory.
/**
* Returns true if a directory can be created in the current location.
* @return
*/
boolean canCreateDirectory() {
final RootInfo root = getCurrentRoot();
final DocumentInfo cwd = getCurrentDirectory();
return cwd != null && cwd.isCreateSupported() && !mSearchManager.isSearching() && !root.isRecents() && !root.isDownloads();
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by AOSPA.
the class FilesActivity method refreshDirectory.
@Override
void refreshDirectory(int anim) {
final FragmentManager fm = getFragmentManager();
final RootInfo root = getCurrentRoot();
final DocumentInfo cwd = getCurrentDirectory();
assert (!mSearchManager.isSearching());
if (cwd == null) {
DirectoryFragment.showRecentsOpen(fm, anim);
} else {
// Normal boring directory
DirectoryFragment.showDirectory(fm, root, cwd, anim);
}
}
use of com.android.documentsui.model.RootInfo in project android_frameworks_base by AOSPA.
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 AOSPA.
the class RootsCacheTest method buildForMimeTypes.
private static RootInfo buildForMimeTypes(String... mimeTypes) {
final RootInfo root = new RootInfo();
root.derivedMimeTypes = mimeTypes;
return root;
}
Aggregations