Lines Matching refs:root

74     // docId format: root:path/to/file
206 final RootInfo root = new RootInfo();
207 mRoots.put(rootId, root);
209 root.rootId = rootId;
210 root.volumeId = volume.id;
211 root.storageUuid = storageUuid;
212 root.flags = Root.FLAG_LOCAL_ONLY
217 if (DEBUG) Log.d(TAG, "Disk for root " + rootId + " is " + disk);
219 root.flags |= Root.FLAG_REMOVABLE_SD;
221 root.flags |= Root.FLAG_REMOVABLE_USB;
225 root.flags |= Root.FLAG_SUPPORTS_EJECT;
231 root.flags |= Root.FLAG_ADVANCED;
235 root.flags |= Root.FLAG_SUPPORTS_CREATE;
237 root.title = title;
239 root.flags |= Root.FLAG_HAS_SETTINGS;
242 root.visiblePath = volume.getPathForUser(userId);
244 root.visiblePath = null;
246 root.path = volume.getInternalPathForUser(userId);
248 root.docId = getDocIdForFile(root.path);
258 final RootInfo root = new RootInfo();
259 root.rootId = ROOT_ID_HOME;
260 mRoots.put(root.rootId, root);
261 root.title = getContext().getString(R.string.root_documents);
264 root.reportAvailableBytes = false;
265 root.flags = Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_SEARCH
270 root.flags |= Root.FLAG_SUPPORTS_CREATE;
274 root.visiblePath = new File(
276 root.path = new File(
279 root.docId = getDocIdForFile(root.path);
287 // Note this affects content://com.android.externalstorage.documents/root/39BD-07C5
306 // Find the most-specific root path
317 throw new FileNotFoundException("Failed to find root that contains " + path);
320 // Start at first char of path under root
343 // Find the most-specific root path
348 final RootInfo root = mRoots.valueAt(i);
349 final File rootFile = visible ? root.visiblePath : root.path;
354 mostSpecificRoot = root;
371 RootInfo root = getRootFromDocId(docId);
372 return buildFile(root, docId, visible, mustExist);
377 RootInfo root = getRootFromDocId(docId);
378 return Pair.create(root, buildFile(root, docId, visible, true));
385 RootInfo root;
387 root = mRoots.get(tag);
389 if (root == null) {
390 throw new FileNotFoundException("No root for " + tag);
393 return root;
396 private File buildFile(RootInfo root, String docId, boolean visible, boolean mustExist)
401 File target = visible ? root.visiblePath : root.path;
437 for (RootInfo root : mRoots.values()) {
439 row.add(Root.COLUMN_ROOT_ID, root.rootId);
440 row.add(Root.COLUMN_FLAGS, root.flags);
441 row.add(Root.COLUMN_TITLE, root.title);
442 row.add(Root.COLUMN_DOCUMENT_ID, root.docId);
445 if (root.reportAvailableBytes) {
446 if (root.storageUuid != null) {
450 .getFreeBytes(root.storageUuid);
455 availableBytes = root.path.getUsableSpace();
468 final RootInfo root = resolvedDocId.first;
472 ? root.path
475 return new Path(parentDocId == null ? root.rootId : null, findDocumentPath(parent, child));
554 RootInfo root = mRoots.get(rootId);
555 if (root != null) {
557 mStorageManager.unmount(root.volumeId);
571 final RootInfo root = mRoots.valueAt(i);
572 pw.println("Root{" + root.rootId + "}:");
574 pw.printPair("flags", DebugUtils.flagsToString(Root.class, "FLAG_", root.flags));
576 pw.printPair("title", root.title);
577 pw.printPair("docId", root.docId);
579 pw.printPair("path", root.path);
580 pw.printPair("visiblePath", root.visiblePath);