Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/provider/DocumentsContract.Root#constants) \| [Inherited Methods](https://developer.android.com/reference/android/provider/DocumentsContract.Root#inhmethods)

# DocumentsContract.Root

*** ** * ** ***


`
public
static
final

class
DocumentsContract.Root
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.DocumentsContract.Root |

<br />

*** ** * ** ***

Constants related to a root of documents, including `https://developer.android.com/reference/android/database/Cursor` column
names and flags. A root is the start of a tree of documents, such as a
physical storage device, or an account. Each root starts at the directory
referenced by `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_DOCUMENT_ID`, which can recursively
contain both documents and directories.


All columns are *read-only* to client applications.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_AVAILABLE_BYTES` Number of bytes available in this root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_CAPACITY_BYTES` Capacity of a root in bytes. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_DOCUMENT_ID` Document which is a directory that represents the top directory of this root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS` Flags that apply to a root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_ICON` Icon resource ID for a root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_MIME_TYPES` MIME types supported by this root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_QUERY_ARGS` Query arguments supported by this root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_ROOT_ID` Unique ID of a root. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_SUMMARY` Summary for this root, which may be shown to a user. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_TITLE` Title for a root, which will be shown to a user. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_EMPTY` Flag indicating that this root is currently empty. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE` Flag indicating that this root has limited functionality when the device does not have an internet connection. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LOCAL_ONLY` Flag indicating that this root offers content that is strictly local on the device. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_CREATE` Flag indicating that at least one directory under this root supports creating content. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_EJECT` Flag indicating that this root can be ejected. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_IS_CHILD` Flag indicating that this root supports testing parent child relationships. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_QUERY_TRASH` Flag indicating that this root can be queried to provide trashed documents. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_RECENTS` Flag indicating that this root can be queried to provide recently modified documents. |
| `int` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_SEARCH` Flag indicating that this root supports search. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/DocumentsContract.Root#MIME_TYPE_ITEM` MIME type for a root. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### COLUMN_AVAILABLE_BYTES

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_AVAILABLE_BYTES
```

Number of bytes available in this root. This column is optional, and
may be `null` if unknown or unbounded.


Type: INTEGER (long)

<br />

Constant Value:

"available_bytes"


### COLUMN_CAPACITY_BYTES

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_CAPACITY_BYTES
```

Capacity of a root in bytes. This column is optional, and may be
`null` if unknown or unbounded.


Type: INTEGER (long)

<br />

Constant Value:

"capacity_bytes"


### COLUMN_DOCUMENT_ID

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_DOCUMENT_ID
```

Document which is a directory that represents the top directory of
this root. This column is required.


Type: STRING

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_DOCUMENT_ID`

Constant Value:

"document_id"


### COLUMN_FLAGS

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_FLAGS
```

Flags that apply to a root. This column is required.


Type: INTEGER (int)

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LOCAL_ONLY`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_CREATE`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_RECENTS`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_SEARCH`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_QUERY_TRASH`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE`

Constant Value:

"flags"


### COLUMN_ICON

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_ICON
```

Icon resource ID for a root. This column is required.


Type: INTEGER (int)

<br />

Constant Value:

"icon"


### COLUMN_MIME_TYPES

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_MIME_TYPES
```

MIME types supported by this root. This column is optional, and if
`null` the root is assumed to support all MIME types. Multiple
MIME types can be separated by a newline. For example, a root
supporting audio might return "audio/\*\\napplication/x-flac".


Type: STRING

<br />

Constant Value:

"mime_types"


### COLUMN_QUERY_ARGS

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_QUERY_ARGS
```

Query arguments supported by this root. This column is optional
and related to `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS` and `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_SEARCH`.
If the flags include `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_SEARCH`, and the column is
`null`, the root is assumed to support `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_DISPLAY_NAME`
search of `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_DISPLAY_NAME`. Multiple query arguments
can be separated by a newline. For example, a root supporting
`https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_MIME_TYPES` and `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_DISPLAY_NAME` might
return "android:query-arg-mime-types\\nandroid:query-arg-display-name".


Type: STRING

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_SEARCH`
- `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_DISPLAY_NAME`
- `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_FILE_SIZE_OVER`
- `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_LAST_MODIFIED_AFTER`
- `https://developer.android.com/reference/android/provider/DocumentsContract#QUERY_ARG_MIME_TYPES`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#querySearchDocuments(java.lang.String,%20java.lang.String[],%20android.os.Bundle)`

Constant Value:

"query_args"


### COLUMN_ROOT_ID

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_ROOT_ID
```

Unique ID of a root. This ID is both provided by and interpreted by a
`https://developer.android.com/reference/android/provider/DocumentsProvider`, and should be treated as an opaque value
by client applications. This column is required.


Type: STRING

<br />

Constant Value:

"root_id"


### COLUMN_SUMMARY

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_SUMMARY
```

Summary for this root, which may be shown to a user. This column is
optional, and may be `null`. For a single storage service
surfacing multiple accounts as different roots, this summary should
be the name of the account.


Type: STRING

<br />

Constant Value:

"summary"


### COLUMN_TITLE

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String COLUMN_TITLE
```

Title for a root, which will be shown to a user. This column is
required. For a single storage service surfacing multiple accounts as
different roots, this title should be the name of the service.


Type: STRING

<br />

Constant Value:

"title"


### FLAG_EMPTY

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_EMPTY
```

Flag indicating that this root is currently empty. This may be used
to hide the root when opening documents, but the root will still be
shown when creating documents and `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_SUPPORTS_CREATE` is
also set. If the value of this flag changes, such as when a root
becomes non-empty, you must send a content changed notification for
`https://developer.android.com/reference/android/provider/DocumentsContract#buildRootsUri(java.lang.String)`.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20boolean)`

Constant Value:

64
(0x00000040)


### FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE
```

Flag indicating that this root has limited functionality when the device does not have an
internet connection. This will affect how the system file picker and file manager
presents files to the user when the device does not have internet connection.

Operations such as open, copy and move, that require reading file contents, will be
disabled on files that do not have content available locally. Specifically, the following
conditions have to be met to disable these actions:

- the device does not have internet connection
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_CONTENT_SYNC_STATE_FLAGS` is non-null and `https://developer.android.com/reference/android/provider/DocumentsContract.Document#SYNC_STATE_FLAG_AVAILABLE_LOCALLY` is not set
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE` is set
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#FLAG_VIRTUAL_DOCUMENT` is not set
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_MIME_TYPE` does not equal `https://developer.android.com/reference/android/provider/DocumentsContract.Document#MIME_TYPE_DIR`

Folder opens will be unaffected by the state of this flag to allow users to be able to still navigate around the file system. However, other operations that require reading file contents will be disabled on folders because they may contain files that don't have content available locally. Specifically, the following conditions have to be met to disable these actions:

<!-- -->

- the device does not have internet connection
- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#FLAG_LIMITED_FUNCTIONALITY_WHEN_OFFLINE` is set
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_MIME_TYPE` equals `https://developer.android.com/reference/android/provider/DocumentsContract.Document#MIME_TYPE_DIR`

Operations such as rename and delete, that don't require reading file contents, will be unaffected by the state of this flag. In addition, when this flag is set and the device if offline, the file picker and file manager will show a message to the user indicating that there is limited functionality when offline. Note that even if the device has an internet connection, the documents provider implementation may be limited or prevented from accessing it because of various system restrictions and battery saving features. There will be no UI change for this case.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_CONTENT_SYNC_STATE_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#SYNC_STATE_FLAG_AVAILABLE_LOCALLY`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#FLAG_VIRTUAL_DOCUMENT`
- `https://developer.android.com/reference/android/provider/DocumentsContract.Document#COLUMN_MIME_TYPE`

Constant Value:

2097152
(0x00200000)


### FLAG_LOCAL_ONLY

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_LOCAL_ONLY
```

Flag indicating that this root offers content that is strictly local
on the device. That is, no network requests are made for the content.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/content/Intent#EXTRA_LOCAL_ONLY`

Constant Value:

2
(0x00000002)


### FLAG_SUPPORTS_CREATE

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_CREATE
```

Flag indicating that at least one directory under this root supports
creating content. Roots with this flag will be shown when an
application interacts with `https://developer.android.com/reference/android/content/Intent#ACTION_CREATE_DOCUMENT`.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`

Constant Value:

1
(0x00000001)


### FLAG_SUPPORTS_EJECT

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_EJECT
```

Flag indicating that this root can be ejected.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract#ejectRoot(android.content.ContentResolver,%20android.net.Uri)`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#ejectRoot(java.lang.String)`

Constant Value:

32
(0x00000020)


### FLAG_SUPPORTS_IS_CHILD

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_IS_CHILD
```

Flag indicating that this root supports testing parent child
relationships.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#isChildDocument(java.lang.String,%20java.lang.String)`

Constant Value:

16
(0x00000010)


### FLAG_SUPPORTS_QUERY_TRASH

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_QUERY_TRASH
```

Flag indicating that this root can be queried to provide trashed documents.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract#buildTrashDocumentsUri(java.lang.String,%20java.lang.String)`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#queryTrashDocuments(java.lang.String,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)`

Constant Value:

1048576
(0x00100000)


### FLAG_SUPPORTS_RECENTS

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_RECENTS
```

Flag indicating that this root can be queried to provide recently
modified documents.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract#buildRecentDocumentsUri(java.lang.String,%20java.lang.String)`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#queryRecentDocuments(java.lang.String,%20java.lang.String[])`

Constant Value:

4
(0x00000004)


### FLAG_SUPPORTS_SEARCH

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SUPPORTS_SEARCH
```

Flag indicating that this root supports search.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/DocumentsContract.Root#COLUMN_FLAGS`
- `https://developer.android.com/reference/android/provider/DocumentsContract#buildSearchDocumentsUri(java.lang.String,%20java.lang.String,%20java.lang.String)`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#querySearchDocuments(java.lang.String,%20java.lang.String,%20java.lang.String[])`
- `https://developer.android.com/reference/android/provider/DocumentsProvider#querySearchDocuments(java.lang.String,%20java.lang.String[],%20android.os.Bundle)`

Constant Value:

8
(0x00000008)


### MIME_TYPE_ITEM

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String MIME_TYPE_ITEM
```

MIME type for a root.

<br />

Constant Value:

"vnd.android.document/root"