Partager via


StorageManager Class

Definition

StorageManager is the interface to the systems storage service.

[Android.Runtime.Register("android/os/storage/StorageManager", DoNotGenerateAcw=true)]
public class StorageManager : Java.Lang.Object
[<Android.Runtime.Register("android/os/storage/StorageManager", DoNotGenerateAcw=true)>]
type StorageManager = class
    inherit Object
Inheritance
StorageManager
Attributes

Remarks

StorageManager is the interface to the systems storage service. The storage manager handles storage-related items such as Opaque Binary Blobs (OBBs).

OBBs contain a filesystem that maybe be encrypted on disk and mounted on-demand from an application. OBBs are a good way of providing large amounts of binary assets without packaging them into APKs as they may be multiple gigabytes in size. However, due to their size, they're most likely stored in a shared storage pool accessible from all programs. The system does not guarantee the security of the OBB file itself: if any program modifies the OBB, there is no guarantee that a read from that OBB will produce the expected output.

Java documentation for android.os.storage.StorageManager.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

StorageManager(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ActionClearAppCache

Activity Action: Allows the user to free up space by clearing app external cache directories.

ActionManageStorage

Activity Action: Allows the user to manage their storage.

ExtraRequestedBytes

Extra used to indicate the total size (in bytes) that an application is interested in allocating.

ExtraUuid

Extra UUID used to indicate the storage volume where an application is interested in allocating or managing disk space.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsCheckpointSupported

Check whether the device supports filesystem checkpoint.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
PrimaryStorageVolume

Return the primary shared/external storage volume available to the current user.

RecentStorageVolumes

Return the list of shared/external storage volumes both currently and recently available to the calling user.

StorageVolumes

Return the list of shared/external storage volumes currently available to the calling user.

StorageVolumesIncludingSharedProfiles

Return the list of shared/external storage volumes currently available to the calling user and the user it shares media with.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

UuidDefault

UUID representing the default internal storage of this device which provides Environment#getDataDirectory().

Methods

AllocateBytes(FileDescriptor, Int64)

Allocate the requested number of bytes for your application to use in the given open file.

AllocateBytes(UUID, Int64)

Allocate the requested number of bytes for your application to use on the given storage volume.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

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

(Inherited from Object)
FromContext(Context)
GetAllocatableBytes(UUID)

Return the maximum number of new bytes that your app can allocate for itself on the given storage volume.

GetCacheQuotaBytes(UUID)

Return quota size in bytes for all cached data belonging to the calling app on the given storage volume.

GetCacheSizeBytes(UUID)

Return total size in bytes of all cached data belonging to the calling app on the given storage volume.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetManageSpaceActivityIntent(String, Int32)

Returns a PendingIntent that can be used by Apps with android.Manifest.permission#MANAGE_EXTERNAL_STORAGE permission to launch the manageSpaceActivity for any App that implements it, irrespective of its exported status.

GetMountedObbPath(String)

Check the mounted path of an Opaque Binary Blob (OBB) file.

GetStorageVolume(File)

Return the StorageVolume that contains the given file, or null if none.

GetStorageVolume(Uri)

Return the StorageVolume that contains the given MediaStore item.

GetUuidForPath(File)

Return a UUID identifying the storage volume that hosts the given filesystem path.

IsAllocationSupported(FileDescriptor)

Test if the given file descriptor supports allocation of disk space using #allocateBytes(FileDescriptor, long).

IsCacheBehaviorGroup(File)

Read the current value set by #setCacheBehaviorGroup(File, boolean).

IsCacheBehaviorTombstone(File)

Read the current value set by #setCacheBehaviorTombstone(File, boolean).

IsEncrypted(File)

Return if data stored at or under the given path will be encrypted while at rest.

IsObbMounted(String)

Check whether an Opaque Binary Blob (OBB) is mounted or not.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
MountObb(String, String, OnObbStateChangeListener)

Mount an Opaque Binary Blob (OBB) file.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OpenProxyFileDescriptor(ParcelFileMode, ProxyFileDescriptorCallback, Handler)

Opens a seekable ParcelFileDescriptor that proxies all low-level I/O requests back to the given ProxyFileDescriptorCallback.

RegisterStorageVolumeCallback(IExecutor, StorageManager+StorageVolumeCallback)

Registers the given callback to listen for StorageVolume changes.

SetCacheBehaviorGroup(File, Boolean)

Enable or disable special cache behavior that treats this directory and its contents as an entire group.

SetCacheBehaviorTombstone(File, Boolean)

Enable or disable special cache behavior that leaves deleted cache files intact as tombstones.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnmountObb(String, Boolean, OnObbStateChangeListener)

Unmount an Opaque Binary Blob (OBB) file asynchronously.

UnregisterFromRuntime() (Inherited from Object)
UnregisterStorageVolumeCallback(StorageManager+StorageVolumeCallback)

Unregisters the given callback from listening for StorageVolume changes.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to