Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/os/storage/StorageVolume#constants) \| [Inherited Constants](https://developer.android.com/reference/android/os/storage/StorageVolume#inhconstants) \| [Fields](https://developer.android.com/reference/android/os/storage/StorageVolume#lfields) \| [Methods](https://developer.android.com/reference/android/os/storage/StorageVolume#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/storage/StorageVolume#inhmethods)

# StorageVolume

*** ** * ** ***

` public final class StorageVolume `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.storage.StorageVolume |

<br />

*** ** * ** ***

Information about a shared/external storage volume for a specific user.

A device always has one (and one only) primary storage volume, but it could have extra volumes, like SD cards and USB drives. This object represents the logical view of a storage volume for a specific user: different users might have different views for the same physical volume (for example, if the volume is a built-in emulated storage).

The storage volume is not necessarily mounted, applications should use `https://developer.android.com/reference/android/os/storage/StorageVolume#getState()` to verify its state.

Applications willing to read or write to this storage volume needs to get a permission from the user first, which can be achieved in the following ways:

- To get access to standard directories (like the `https://developer.android.com/reference/android/os/Environment#DIRECTORY_PICTURES`), they can use the `https://developer.android.com/reference/android/os/storage/StorageVolume#createAccessIntent(java.lang.String)`. This is the recommend way, since it provides a simpler API and narrows the access to the given directory (and its descendants).
- To get access to any directory (and its descendants), they can use the Storage Access Framework APIs (such as `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT` and `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE`, although these APIs do not guarantee the user will select this specific volume.
- To get read and write access to the primary storage volume, applications can declare the `https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` and `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` permissions respectively, with the latter including the former. This approach is discouraged, since users may be hesitant to grant broad access to all files contained on a storage device.

It can be obtained through `https://developer.android.com/reference/android/os/storage/StorageManager#getStorageVolumes()` and `https://developer.android.com/reference/android/os/storage/StorageManager#getPrimaryStorageVolume()` and also as an extra in some broadcasts (see `https://developer.android.com/reference/android/os/storage/StorageVolume#EXTRA_STORAGE_VOLUME`).

See `https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()` for more info about shared/external storage semantics.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/os/storage/StorageVolume#EXTRA_STORAGE_VOLUME` Name of the `https://developer.android.com/reference/android/os/Parcelable` extra in the `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_REMOVED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_CHECKING`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_NOFS`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_MOUNTED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_SHARED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_BAD_REMOVAL`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTABLE`, and `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_EJECT` broadcast that contains a `https://developer.android.com/reference/android/os/storage/StorageVolume`. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/os/storage/StorageVolume>` | `https://developer.android.com/reference/android/os/storage/StorageVolume#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#createAccessIntent(java.lang.String)(https://developer.android.com/reference/java/lang/String directoryName) ` *This method was deprecated in API level 29. Callers should migrate to using `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE` instead. Launching this `https://developer.android.com/reference/android/content/Intent` on devices running `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or higher, will immediately finish with a result code of `https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED`.* |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#createOpenDocumentTreeIntent()() ` Builds an `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE` to allow the user to grant access to any directory subtree (or entire volume) from the `https://developer.android.com/reference/android/provider/DocumentsProvider`s available on the device. |
| ` int` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` boolean` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getDescription(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Returns a user-visible description of the volume. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getDirectory()() ` Returns the directory where this volume is currently mounted. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getMediaStoreVolumeName()() ` Return the volume name that can be used to interact with this storage device through `https://developer.android.com/reference/android/provider/MediaStore`. |
| ` https://developer.android.com/reference/android/os/UserHandle` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getOwner()() ` Returns the user that owns this volume |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getState()() ` Returns the current state of the volume. |
| ` https://developer.android.com/reference/java/util/UUID` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getStorageUuid()() ` Gets the converted volume UUID. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#getUuid()() ` Gets the volume UUID, if any. |
| ` int` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#hashCode()() ` Returns a hash code value for the object. |
| ` boolean` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#isEmulated()() ` Returns true if the volume is emulated. |
| ` boolean` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#isPrimary()() ` Returns true if the volume is the primary shared/external storage, which is the volume backed by `https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()`. |
| ` boolean` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#isRemovable()() ` Returns true if the volume is removable. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/os/storage/StorageVolume#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

### 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*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### EXTRA_STORAGE_VOLUME

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

```
public static final String EXTRA_STORAGE_VOLUME
```

Name of the `https://developer.android.com/reference/android/os/Parcelable` extra in the `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_REMOVED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_CHECKING`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_NOFS`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_MOUNTED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_SHARED`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_BAD_REMOVAL`, `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTABLE`, and `https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_EJECT` broadcast that contains a `https://developer.android.com/reference/android/os/storage/StorageVolume`.

<br />

Constant Value: "android.os.storage.extra.STORAGE_VOLUME"

## Fields

### CREATOR

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

```
public static final Creator<StorageVolume> CREATOR
```

<br />

<br />

## Public methods

### createAccessIntent

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

```
public Intent createAccessIntent (String directoryName)
```

<br />

**This method was deprecated in API level 29.**   

Callers should migrate to using `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE` instead. Launching this `https://developer.android.com/reference/android/content/Intent` on devices running `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or higher, will immediately finish with a result code of `https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED`.

Builds an intent to give access to a standard storage directory or entire volume after obtaining the user's approval.

When invoked, the system will ask the user to grant access to the requested directory (and its descendants). The result of the request will be returned to the activity through the `onActivityResult` method.

To gain access to descendants (child, grandchild, etc) documents, use `https://developer.android.com/reference/android/provider/DocumentsContract#buildDocumentUriUsingTree(android.net.Uri,%20java.lang.String)`, or `https://developer.android.com/reference/android/provider/DocumentsContract#buildChildDocumentsUriUsingTree(android.net.Uri,%20java.lang.String)` with the returned URI.

If your application only needs to store internal data, consider using `https://developer.android.com/reference/android/content/Context#getExternalFilesDirs(java.lang.String)`, `https://developer.android.com/reference/android/content/Context#getExternalCacheDirs()`, or `https://developer.android.com/reference/android/content/Context#getExternalMediaDirs()`, which require no permissions to read or write.

Access to the entire volume is only available for non-primary volumes (for the primary volume, apps can use the `https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` and `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` permissions) and should be used with caution, since users are more likely to deny access when asked for entire volume access rather than specific directories.

<br />

| Parameters ||
|---|---|
| `directoryName` | `String`: must be one of `https://developer.android.com/reference/android/os/Environment#DIRECTORY_MUSIC`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_PODCASTS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_RINGTONES`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_ALARMS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_NOTIFICATIONS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_PICTURES`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_MOVIES`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_DOWNLOADS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_DCIM`, or `https://developer.android.com/reference/android/os/Environment#DIRECTORY_DOCUMENTS`, or `null` to request access to the entire volume. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | intent to request access, or `null` if the requested directory is invalid for that volume. <br /> |

**See also:**

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

### createOpenDocumentTreeIntent

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

```
public Intent createOpenDocumentTreeIntent ()
```

Builds an `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE` to allow the user to grant access to any directory subtree (or entire volume) from the `https://developer.android.com/reference/android/provider/DocumentsProvider`s available on the device. The initial location of the document navigation will be the root of this `https://developer.android.com/reference/android/os/storage/StorageVolume`. Note that the returned `https://developer.android.com/reference/android/content/Intent` simply suggests that the user picks this `https://developer.android.com/reference/android/os/storage/StorageVolume` by default, but the user may select a different location. Callers must respect the user's chosen location, even if it is different from the originally requested location.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | intent to `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE` initially showing the contents of this `https://developer.android.com/reference/android/os/storage/StorageVolume` This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE`

### describeContents

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

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### equals

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

```
public boolean equals (Object obj)
```

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getDescription

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

```
public String getDescription (Context context)
```

Returns a user-visible description of the volume.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the volume description <br /> |

### getDirectory

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

```
public File getDirectory ()
```

Returns the directory where this volume is currently mounted.

Direct filesystem access via this path has significant emulation overhead, and apps are instead strongly encouraged to interact with media on storage volumes via the `https://developer.android.com/reference/android/provider/MediaStore` APIs.

This directory does not give apps any additional access beyond what they already have via `https://developer.android.com/reference/android/provider/MediaStore`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | directory where this volume is mounted, or `null` if the volume is not currently mounted. <br /> |

### getMediaStoreVolumeName

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

```
public String getMediaStoreVolumeName ()
```

Return the volume name that can be used to interact with this storage device through `https://developer.android.com/reference/android/provider/MediaStore`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | opaque volume name, or `null` if this volume is not indexed by `https://developer.android.com/reference/android/provider/MediaStore`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/provider/MediaStore.Audio.Media#getContentUri(java.lang.String)`
- `https://developer.android.com/reference/android/provider/MediaStore.Video.Media#getContentUri(java.lang.String)`
- `https://developer.android.com/reference/android/provider/MediaStore.Images.Media#getContentUri(java.lang.String)`

### getOwner

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

```
public UserHandle getOwner ()
```

Returns the user that owns this volume

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/UserHandle` | This value cannot be `null`. <br /> |

### getState

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

```
public String getState ()
```

Returns the current state of the volume.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | one of `https://developer.android.com/reference/android/os/Environment#MEDIA_UNKNOWN`, `https://developer.android.com/reference/android/os/Environment#MEDIA_REMOVED`, `https://developer.android.com/reference/android/os/Environment#MEDIA_UNMOUNTED`, `https://developer.android.com/reference/android/os/Environment#MEDIA_CHECKING`, `https://developer.android.com/reference/android/os/Environment#MEDIA_NOFS`, `https://developer.android.com/reference/android/os/Environment#MEDIA_MOUNTED`, `https://developer.android.com/reference/android/os/Environment#MEDIA_MOUNTED_READ_ONLY`, `https://developer.android.com/reference/android/os/Environment#MEDIA_SHARED`, `https://developer.android.com/reference/android/os/Environment#MEDIA_BAD_REMOVAL`, or `https://developer.android.com/reference/android/os/Environment#MEDIA_UNMOUNTABLE`. <br /> |

### getStorageUuid

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

```
public UUID getStorageUuid ()
```

Gets the converted volume UUID. If a valid UUID is returned, it is compatible with other APIs that make use of `https://developer.android.com/reference/java/util/UUID` like `https://developer.android.com/reference/android/os/storage/StorageManager#allocateBytes(java.io.FileDescriptor,%20long)` and `https://developer.android.com/reference/android/content/pm/ApplicationInfo#storageUuid`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/UUID` | the UUID for the volume or `null` for "portable" storage devices which haven't been adopted. <br /> |

**See also:**

- [Adoptable storage](https://source.android.com/devices/storage/adoptable)

### getUuid

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

```
public String getUuid ()
```

Gets the volume UUID, if any.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isEmulated

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

```
public boolean isEmulated ()
```

Returns true if the volume is emulated.

<br />

| Returns ||
|---|---|
| `boolean` | is emulated <br /> |

### isPrimary

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

```
public boolean isPrimary ()
```

Returns true if the volume is the primary shared/external storage, which is the volume backed by `https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isRemovable

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

```
public boolean isRemovable ()
```

Returns true if the volume is removable.

<br />

| Returns ||
|---|---|
| `boolean` | is removable <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |