@Implements(value=android.os.storage.StorageManager.class) public class ShadowStorageManager extends Object
Fake implementation of StorageManager
Constructor and Description |
---|
ShadowStorageManager() |
Modifier and Type | Method and Description |
---|---|
void |
addStorageVolume(StorageVolume storageVolume)
Adds a
StorageVolume to the list returned by getStorageVolumes() . |
StorageVolume |
getStorageVolume(File file)
Checks whether File belongs to any
StorageVolume in the list returned by getStorageVolumes() . |
protected List<StorageVolume> |
getStorageVolumes()
Returns the storage volumes configured via
#addStorageVolume() . |
StorageVolume[] |
getVolumeList()
Gets the volume list from
getVolumeList(int, int) |
protected static StorageVolume[] |
getVolumeList(int userId,
int flags) |
protected static boolean |
isFileEncryptedNativeOrEmulated() |
protected static boolean |
isUserKeyUnlocked(int userId) |
void |
resetStorageVolumeList()
Clears the storageVolumeList.
|
void |
setFileEncryptedNativeOrEmulated(boolean isSupported)
Setter for
isFileEncryptedNativeOrEmulated() |
@Implementation(minSdk=23) protected static StorageVolume[] getVolumeList(int userId, int flags)
public StorageVolume[] getVolumeList()
Gets the volume list from getVolumeList(int, int)
public void addStorageVolume(StorageVolume storageVolume)
Adds a StorageVolume
to the list returned by getStorageVolumes()
.
StorageVolume
- to add to list@Implementation(minSdk=24) protected List<StorageVolume> getStorageVolumes()
Returns the storage volumes configured via #addStorageVolume()
.
public void resetStorageVolumeList()
Clears the storageVolumeList.
@Implementation(minSdk=24) public StorageVolume getStorageVolume(File file)
Checks whether File belongs to any StorageVolume
in the list returned by getStorageVolumes()
.
File
- to check@HiddenApi @Implementation(minSdk=24) protected static boolean isFileEncryptedNativeOrEmulated()
public void setFileEncryptedNativeOrEmulated(boolean isSupported)
Setter for isFileEncryptedNativeOrEmulated()
isSupported
- a boolean value to set file encrypted native or not@HiddenApi @Implementation(minSdk=24) protected static boolean isUserKeyUnlocked(int userId)