FileDocCategorySizeDatePackage
IMountService.javaAPI DocAndroid 5.1 API69447Thu Mar 12 22:22:10 GMT 2015android.os.storage

IMountService

public interface IMountService implements android.os.IInterface
WARNING! Update IMountService.h and IMountService.cpp if you change this file. In particular, the ordering of the methods below must match the _TRANSACTION enum in IMountService.cpp
hide
- Applications should use android.os.storage.StorageManager to access storage functions.

Fields Summary
static final int
ENCRYPTION_STATE_NONE
The volume is not encrypted.
static final int
ENCRYPTION_STATE_OK
The volume has been encrypted succesfully.
static final int
ENCRYPTION_STATE_ERROR_UNKNOWN
The volume is in a bad state.
static final int
ENCRYPTION_STATE_ERROR_INCOMPLETE
Encryption is incomplete
static final int
ENCRYPTION_STATE_ERROR_INCONSISTENT
Encryption is incomplete and irrecoverable
static final int
ENCRYPTION_STATE_ERROR_CORRUPT
Underlying data is corrupt
Constructors Summary
Methods Summary
public intchangeEncryptionPassword(int type, java.lang.String password)
Changes the encryption password.

public voidclearPassword()
Securely clear password from vold

public intcreateSecureContainer(java.lang.String id, int sizeMb, java.lang.String fstype, java.lang.String key, int ownerUid, boolean external)

public intdecryptStorage(java.lang.String password)
Decrypts any encrypted volumes.

public intdestroySecureContainer(java.lang.String id, boolean force)

public intencryptStorage(int type, java.lang.String password)
Encrypts storage.

public intfinalizeSecureContainer(java.lang.String id)

public voidfinishMediaUpdate()
Call into MountService by PackageManager to notify that its done processing the media status update request.

public intfixPermissionsSecureContainer(java.lang.String id, int gid, java.lang.String filename)

public intformatVolume(java.lang.String mountPoint)
Format external storage given a mount point. Returns an int consistent with MountServiceResultCode

public intgetEncryptionState()
Determines the encryption state of the volume.

return
a numerical value. See {@code ENCRYPTION_STATE_*} for possible values.

public java.lang.StringgetField(java.lang.String field)
Gets a field from the crypto header.

param
field field to get
return
contents of field

public java.lang.StringgetMountedObbPath(java.lang.String rawPath)
Gets the path to the mounted Opaque Binary Blob (OBB).

public java.lang.StringgetPassword()
Get password from vold

return
password or empty string

public intgetPasswordType()
Determines the type of the encryption password

return
PasswordType

public java.lang.StringgetSecureContainerFilesystemPath(java.lang.String cid)
Gets the path on the filesystem for the ASEC container itself.

param
cid ASEC container ID
return
path to filesystem or {@code null} if it's not found
throws
RemoteException

public java.lang.String[]getSecureContainerList()
Gets an Array of currently known secure container IDs

public java.lang.StringgetSecureContainerPath(java.lang.String id)

public int[]getStorageUsers(java.lang.String path)
Returns an array of pids with open files on the specified path.

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

public java.lang.StringgetVolumeState(java.lang.String mountPoint)
Gets the state of a volume via its mountpoint.

public booleanisExternalStorageEmulated()
Returns whether or not the external storage is emulated.

public booleanisObbMounted(java.lang.String rawPath)
Checks whether the specified Opaque Binary Blob (OBB) is mounted somewhere.

public booleanisSecureContainerMounted(java.lang.String id)

public booleanisUsbMassStorageConnected()
Returns true if a USB mass storage host is connected

public booleanisUsbMassStorageEnabled()
Returns true if a USB mass storage host is enabled (media is shared)

public longlastMaintenance()
Report the time of the last maintenance operation such as fstrim.

return
Timestamp of the last maintenance operation, in the System.currentTimeMillis() time base
throws
RemoteException

public intmkdirs(java.lang.String callingPkg, java.lang.String path)
Ensure that all directories along given path exist, creating parent directories as needed. Validates that given path is absolute and that it contains no relative "." or ".." paths or symlinks. Also ensures that path belongs to a volume managed by vold, and that path is either external storage data or OBB directory belonging to calling app.

public voidmountObb(java.lang.String rawPath, java.lang.String canonicalPath, java.lang.String key, IObbActionListener token, int nonce)
Mounts an Opaque Binary Blob (OBB) with the specified decryption key and only allows the calling process's UID access to the contents. MountService will call back to the supplied IObbActionListener to inform it of the terminal state of the call.

public intmountSecureContainer(java.lang.String id, java.lang.String key, int ownerUid, boolean readOnly)

public intmountVolume(java.lang.String mountPoint)
Mount external storage at given mount point. Returns an int consistent with MountServiceResultCode

public voidregisterListener(IMountServiceListener listener)
Registers an IMountServiceListener for receiving async notifications.

public intrenameSecureContainer(java.lang.String oldId, java.lang.String newId)

public intresizeSecureContainer(java.lang.String id, int sizeMb, java.lang.String key)

public voidrunMaintenance()
Kick off an immediate maintenance operation

throws
RemoteException

public voidsetField(java.lang.String field, java.lang.String contents)
Set a field in the crypto header.

param
field field to set
param
contents contents to set in field

public voidsetUsbMassStorageEnabled(boolean enable)
Enables / disables USB mass storage. The caller should check actual status of enabling/disabling USB mass storage via StorageEventListener.

public voidshutdown(IMountShutdownObserver observer)
Shuts down the MountService and gracefully unmounts all external media. Invokes call back once the shutdown is complete.

public voidunmountObb(java.lang.String rawPath, boolean force, IObbActionListener token, int nonce)
Unmounts an Opaque Binary Blob (OBB). When the force flag is specified, any program using it will be forcibly killed to unmount the image. MountService will call back to the supplied IObbActionListener to inform it of the terminal state of the call.

public intunmountSecureContainer(java.lang.String id, boolean force)

public voidunmountVolume(java.lang.String mountPoint, boolean force, boolean removeEncryption)
Safely unmount external storage at given mount point. The unmount is an asynchronous operation. Applications should register StorageEventListener for storage related status changes.

param
mountPoint the mount point
param
force whether or not to forcefully unmount it (e.g. even if programs are using this data currently)
param
removeEncryption whether or not encryption mapping should be removed from the volume. This value implies {@code force}.

public voidunregisterListener(IMountServiceListener listener)
Unregisters an IMountServiceListener

public intverifyEncryptionPassword(java.lang.String password)
Verify the encryption password against the stored volume. This method may only be called by the system process.