Package org.robolectric.shadows
Class ShadowStorageManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowStorageManager
-
@Implements(android.os.storage.StorageManager.class) public class ShadowStorageManager extends Object
Fake implementation ofStorageManager
-
-
Constructor Summary
Constructors Constructor Description ShadowStorageManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStorageVolume(StorageVolume storageVolume)
Adds aStorageVolume
to the list returned bygetStorageVolumes()
.StorageVolume
getStorageVolume(File file)
Checks whether File belongs to anyStorageVolume
in the list returned bygetStorageVolumes()
.protected List<StorageVolume>
getStorageVolumes()
Returns the storage volumes configured via#addStorageVolume()
.StorageVolume[]
getVolumeList()
Gets the volume list fromgetVolumeList(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 forisFileEncryptedNativeOrEmulated()
-
-
-
Method Detail
-
getVolumeList
@Implementation(minSdk=23) protected static StorageVolume[] getVolumeList(int userId, int flags)
-
getVolumeList
@Implementation public StorageVolume[] getVolumeList()
Gets the volume list fromgetVolumeList(int, int)
- Returns:
- volume list
-
addStorageVolume
public void addStorageVolume(StorageVolume storageVolume)
Adds aStorageVolume
to the list returned bygetStorageVolumes()
.- Parameters:
StorageVolume
- to add to list
-
getStorageVolumes
@Implementation(minSdk=24) protected List<StorageVolume> getStorageVolumes()
Returns the storage volumes configured via#addStorageVolume()
.- Returns:
- StorageVolume list
-
resetStorageVolumeList
public void resetStorageVolumeList()
Clears the storageVolumeList.
-
getStorageVolume
@Implementation(minSdk=24) public StorageVolume getStorageVolume(File file)
Checks whether File belongs to anyStorageVolume
in the list returned bygetStorageVolumes()
.- Parameters:
File
- to check- Returns:
- StorageVolume for the file
-
isFileEncryptedNativeOrEmulated
@HiddenApi @Implementation(minSdk=24) protected static boolean isFileEncryptedNativeOrEmulated()
-
setFileEncryptedNativeOrEmulated
public void setFileEncryptedNativeOrEmulated(boolean isSupported)
Setter forisFileEncryptedNativeOrEmulated()
- Parameters:
isSupported
- a boolean value to set file encrypted native or not
-
isUserKeyUnlocked
@HiddenApi @Implementation(minSdk=24) protected static boolean isUserKeyUnlocked(int userId)
-
-