IT. Expert System.

Android Reference

StorageManager


android.os.storage

Class StorageManager



  • public class StorageManager
    extends Object
    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.

    Get an instance of this class by calling Context.getSystemService(java.lang.String) with an argument of Context.STORAGE_SERVICE.

    • Method Detail

      • enableUsbMassStorage

        public void enableUsbMassStorage()
        Enables USB Mass Storage (UMS) on the device.
      • disableUsbMassStorage

        public void disableUsbMassStorage()
        Disables USB Mass Storage (UMS) on the device.
      • isUsbMassStorageConnected

        public boolean isUsbMassStorageConnected()
        Query if a USB Mass Storage (UMS) host is connected.
        Returns:
        true if UMS host is connected.
      • isUsbMassStorageEnabled

        public boolean isUsbMassStorageEnabled()
        Query if a USB Mass Storage (UMS) is enabled on the device.
        Returns:
        true if UMS host is enabled.
      • mountObb

        public boolean mountObb(String rawPath,
                       String key,
                       OnObbStateChangeListener listener)
        Mount an Opaque Binary Blob (OBB) file. If a key is specified, it is supplied to the mounting process to be used in any encryption used in the OBB.

        The OBB will remain mounted for as long as the StorageManager reference is held by the application. As soon as this reference is lost, the OBBs in use will be unmounted. The OnObbStateChangeListener registered with this call will receive the success or failure of this operation.

        Note: you can only mount OBB files for which the OBB tag on the file matches a package ID that is owned by the calling program's UID. That is, shared UID applications can attempt to mount any other application's OBB that shares its UID.

        Parameters:
        rawPath - the path to the OBB file
        key - secret used to encrypt the OBB; may be null if no encryption was used on the OBB.
        listener - will receive the success or failure of the operation
        Returns:
        whether the mount call was successfully queued or not
      • unmountObb

        public boolean unmountObb(String rawPath,
                         boolean force,
                         OnObbStateChangeListener listener)
        Unmount an Opaque Binary Blob (OBB) file asynchronously. If the force flag is true, it will kill any application needed to unmount the given OBB (even the calling application).

        The OnObbStateChangeListener registered with this call will receive the success or failure of this operation.

        Note: you can only mount OBB files for which the OBB tag on the file matches a package ID that is owned by the calling program's UID. That is, shared UID applications can obtain access to any other application's OBB that shares its UID.

        Parameters:
        rawPath - path to the OBB file
        force - whether to kill any programs using this in order to unmount it
        listener - will receive the success or failure of the operation
        Returns:
        whether the unmount call was successfully queued or not
      • isObbMounted

        public boolean isObbMounted(String rawPath)
        Check whether an Opaque Binary Blob (OBB) is mounted or not.
        Parameters:
        rawPath - path to OBB image
        Returns:
        true if OBB is mounted; false if not mounted or on error
      • getMountedObbPath

        public String getMountedObbPath(String rawPath)
        Check the mounted path of an Opaque Binary Blob (OBB) file. This will give you the path to where you can obtain access to the internals of the OBB.
        Parameters:
        rawPath - path to OBB image
        Returns:
        absolute path to mounted OBB image data or null if not mounted or exception encountered trying to read status
      • getVolumeState

        public String getVolumeState(String mountPoint)
        Gets the state of a volume via its mountpoint.
      • getVolumeList

        public StorageVolume[] getVolumeList()
        Returns list of all mountable volumes.
      • getVolumePaths

        public String[] getVolumePaths()
        Returns list of paths for all mountable volumes.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 93 / 158735071. Delta: 0.04638 с