use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class HeatMapProvider method queryRoots.
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
final RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, ROOT_ID_HEAT_MAP);
row.add(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY | Root.FLAG_ADVANCED);
row.add(Root.COLUMN_ICON, R.drawable.ic_root_usb);
row.add(Root.COLUMN_TITLE, getContext().getString(R.string.root_heat_map));
row.add(Root.COLUMN_DOCUMENT_ID, ROOT_ID_HEAT_MAP);
row.add(Root.COLUMN_AVAILABLE_BYTES, -1);
row.add(Root.COLUMN_CAPACITY_BYTES, -1);
return result;
}
use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class NonMediaDocumentsProvider method queryRoots.
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
includeFileRoot(result, TYPE_DOCUMENT_ROOT, R.string.root_document, DOCUMENT_MIME_TYPES, true);
includeFileRoot(result, TYPE_ARCHIVE_ROOT, R.string.root_archive, ARCHIVE_MIME_TYPES, false);
includeFileRoot(result, TYPE_APK_ROOT, R.string.root_apk, APK_MIME_TYPES, false);
return result;
}
use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class NonMediaDocumentsProvider method queryRecentDocuments.
@Override
public Cursor queryRecentDocuments(String rootId, String[] projection) throws FileNotFoundException {
final ContentResolver resolver = getContext().getContentResolver();
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
final long token = Binder.clearCallingIdentity();
Cursor cursor = null;
try {
if (TYPE_DOCUMENT_ROOT.equals(rootId)) {
queryRecentFile(resolver, cursor, result, DOCUMENT_MIMES);
} else {
throw new UnsupportedOperationException("Unsupported root " + rootId);
}
} finally {
IoUtils.closeQuietly(cursor);
Binder.restoreCallingIdentity(token);
}
return result;
}
use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class RootedStorageProvider method queryRoots.
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
synchronized (mRootsLock) {
for (RootInfo root : mRoots.values()) {
final RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, root.rootId);
row.add(Root.COLUMN_FLAGS, root.flags);
row.add(Root.COLUMN_TITLE, root.title);
row.add(Root.COLUMN_PATH, root.path);
row.add(Root.COLUMN_DOCUMENT_ID, root.docId);
}
}
return result;
}
use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class RootedStorageProvider method queryDocument.
@Override
public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
includeRootFile(result, documentId, null);
return result;
}
Aggregations