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 of 
StorageManager- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddStorageVolume(StorageVolume storageVolume) Adds aStorageVolumeto the list returned bygetStorageVolumes().getStorageVolume(File file) Checks whether File belongs to anyStorageVolumein the list returned bygetStorageVolumes().protected List<StorageVolume>Returns the storage volumes configured via#addStorageVolume().Gets the volume list fromgetVolumeList(int, int)protected static StorageVolume[]getVolumeList(int userId, int flags) protected static booleanprotected static booleanisUserKeyUnlocked(int userId) static voidreset()voidClears the storageVolumeList.voidsetFileEncryptedNativeOrEmulated(boolean isSupported) Setter forisFileEncryptedNativeOrEmulated()
- 
Constructor Details- 
ShadowStorageManagerpublic ShadowStorageManager()
 
- 
- 
Method Details- 
getVolumeList
- 
getVolumeListGets the volume list fromgetVolumeList(int, int)- Returns:
- volume list
 
- 
addStorageVolumeAdds aStorageVolumeto the list returned bygetStorageVolumes().- Parameters:
- StorageVolume- to add to list
 
- 
getStorageVolumesReturns the storage volumes configured via#addStorageVolume().- Returns:
- StorageVolume list
 
- 
resetStorageVolumeListpublic void resetStorageVolumeList()Clears the storageVolumeList.
- 
getStorageVolumeChecks whether File belongs to anyStorageVolumein the list returned bygetStorageVolumes().- Parameters:
- File- to check
- Returns:
- StorageVolume for the file
 
- 
isFileEncryptedNativeOrEmulated@HiddenApi @Implementation(minSdk=24, maxSdk=33) protected static boolean isFileEncryptedNativeOrEmulated()
- 
setFileEncryptedNativeOrEmulatedpublic void setFileEncryptedNativeOrEmulated(boolean isSupported) Setter forisFileEncryptedNativeOrEmulated()- Parameters:
- isSupported- a boolean value to set file encrypted native or not
 
- 
isUserKeyUnlocked@HiddenApi @Implementation(minSdk=24, maxSdk=34) protected static boolean isUserKeyUnlocked(int userId) 
- 
reset
 
-