/**@class android.os.storage.StorageVolume implements android.os.Parcelable @extends java.lang.Object Information about a shared/external storage volume for a specific user. <p> 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). <p> The storage volume is not necessarily mounted, applications should use {@link #getState}() to verify its state. <p> 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: <ul> <li>To get access to standard directories (like the {@link Environment#DIRECTORY_PICTURES}), they can use the {@link #createAccessIntent}(String). This is the recommend way, since it provides a simpler API and narrows the access to the given directory (and its descendants). <li>To get access to any directory (and its descendants), they can use the Storage Acess Framework APIs (such as {@link Intent#ACTION_OPEN_DOCUMENT} and {@link Intent#ACTION_OPEN_DOCUMENT_TREE}, although these APIs do not guarantee the user will select this specific volume. <li>To get read and write access to the primary storage volume, applications can declare the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} and {@link 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. </ul> <p>It can be obtained through {@link android.os.storage.StorageManager#getStorageVolumes()} and {@link android.os.storage.StorageManager#getPrimaryStorageVolume()} and also as an extra in some broadcasts (see {@link #EXTRA_STORAGE_VOLUME}). <p> See {@link Environment#getExternalStorageDirectory()} for more info about shared/external storage semantics. */ var StorageVolume = { /** Name of the {@link Parcelable} extra in the {@link Intent#ACTION_MEDIA_REMOVED}, {@link Intent#ACTION_MEDIA_UNMOUNTED}, {@link Intent#ACTION_MEDIA_CHECKING}, {@link Intent#ACTION_MEDIA_NOFS}, {@link Intent#ACTION_MEDIA_MOUNTED}, {@link Intent#ACTION_MEDIA_SHARED}, {@link Intent#ACTION_MEDIA_BAD_REMOVAL}, {@link Intent#ACTION_MEDIA_UNMOUNTABLE}, and {@link Intent#ACTION_MEDIA_EJECT} broadcast that contains a {@link android.os.storage.StorageVolume}. */ EXTRA_STORAGE_VOLUME : "android.os.storage.extra.STORAGE_VOLUME", /** Name of the String extra used by {@link #createAccessIntent(String) createAccessIntent}. @hide */ EXTRA_DIRECTORY_NAME : "android.os.storage.extra.DIRECTORY_NAME", /**{@hide} */ STORAGE_ID_INVALID : "0", /**{@hide} */ STORAGE_ID_PRIMARY : "65537", /***/ CREATOR : "null", /**{@hide} */ getId : function( ) {}, /**Returns the mount path for the volume. @return {String} the mount path @hide */ getPath : function( ) {}, /**Returns the path of the underlying filesystem. @return {String} the internal path @hide */ getInternalPath : function( ) {}, /**{@hide} */ getPathFile : function( ) {}, /**Returns a user-visible description of the volume. @return {String} the volume description */ getDescription : function( ) {}, /**Returns true if the volume is the primary shared/external storage, which is the volume backed by {@link Environment#getExternalStorageDirectory()}. */ isPrimary : function( ) {}, /**Returns true if the volume is removable. @return {Boolean} is removable */ isRemovable : function( ) {}, /**Returns true if the volume is emulated. @return {Boolean} is removable */ isEmulated : function( ) {}, /**Returns true if this volume can be shared via USB mass storage. @return {Boolean} whether mass storage is allowed @hide */ allowMassStorage : function( ) {}, /**Returns maximum file size for the volume, or zero if it is unbounded. @return {Number} maximum file size @hide */ getMaxFileSize : function( ) {}, /**{@hide} */ getOwner : function( ) {}, /**Gets the volume UUID, if any. */ getUuid : function( ) {}, /**{@hide} */ normalizeUuid : function( ) {}, /**{@hide} */ getNormalizedUuid : function( ) {}, /**Parse and return volume UUID as FAT volume ID, or return -1 if unable to parse or UUID is unknown. @hide */ getFatVolumeId : function( ) {}, /**{@hide} */ getUserLabel : function( ) {}, /**Returns the current state of the volume. @return {String} one of {@link Environment#MEDIA_UNKNOWN}, {@link Environment#MEDIA_REMOVED}, {@link Environment#MEDIA_UNMOUNTED}, {@link Environment#MEDIA_CHECKING}, {@link Environment#MEDIA_NOFS}, {@link Environment#MEDIA_MOUNTED}, {@link Environment#MEDIA_MOUNTED_READ_ONLY}, {@link Environment#MEDIA_SHARED}, {@link Environment#MEDIA_BAD_REMOVAL}, or {@link Environment#MEDIA_UNMOUNTABLE}. */ getState : function( ) {}, /**Builds an intent to give access to a standard storage directory or entire volume after obtaining the user's approval. <p> 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 {@code onActivityResult} method. <p> To gain access to descendants (child, grandchild, etc) documents, use {@link DocumentsContract#buildDocumentUriUsingTree(Uri, String)}, or {@link DocumentsContract#buildChildDocumentsUriUsingTree(Uri, String)} with the returned URI. <p> If your application only needs to store internal data, consider using {@link Context#getExternalFilesDirs(String) Context.getExternalFilesDirs}, {@link Context#getExternalCacheDirs()}, or {@link Context#getExternalMediaDirs()}, which require no permissions to read or write. <p> Access to the entire volume is only available for non-primary volumes (for the primary volume, apps can use the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} and {@link 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. @param {String} directoryName must be one of {@link Environment#DIRECTORY_MUSIC}, {@link Environment#DIRECTORY_PODCASTS}, {@link Environment#DIRECTORY_RINGTONES}, {@link Environment#DIRECTORY_ALARMS}, {@link Environment#DIRECTORY_NOTIFICATIONS}, {@link Environment#DIRECTORY_PICTURES}, {@link Environment#DIRECTORY_MOVIES}, {@link Environment#DIRECTORY_DOWNLOADS}, {@link Environment#DIRECTORY_DCIM}, or {@link Environment#DIRECTORY_DOCUMENTS}, or {@code null} to request access to the entire volume. @return {Object {android.content.Intent}} intent to request access, or {@code null} if the requested directory is invalid for that volume. @see DocumentsContract @deprecated Callers should migrate to using {@link Intent#ACTION_OPEN_DOCUMENT_TREE} instead. Launching this {@link Intent} on devices running {@link android.os.Build.VERSION_CODES#Q} or higher, will immediately finish with a result code of {@link android.app.Activity#RESULT_CANCELED}. */ createAccessIntent : function( ) {}, /**Builds an {@link Intent#ACTION_OPEN_DOCUMENT_TREE} to allow the user to grant access to any directory subtree (or entire volume) from the {@link android.provider.DocumentsProvider}s available on the device. The initial location of the document navigation will be the root of this {@link android.os.storage.StorageVolume}. Note that the returned {@link Intent} simply suggests that the user picks this {@link 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. @return {Object {android.content.Intent}} intent to {@link Intent#ACTION_OPEN_DOCUMENT_TREE} initially showing the contents of this {@link StorageVolume} @see Intent#ACTION_OPEN_DOCUMENT_TREE */ createOpenDocumentTreeIntent : function( ) {}, /** */ equals : function( ) {}, /** */ hashCode : function( ) {}, /** */ toString : function( ) {}, /**{@hide} */ dump : function( ) {}, /**{@hide} */ dump : function( ) {}, /** */ describeContents : function( ) {}, /** */ writeToParcel : function( ) {}, };