EnvironmentCompat

class EnvironmentCompat
kotlin.Any
   ↳ androidx.core.os.EnvironmentCompat

Helper for accessing features in Environment.

Summary

Constants

static String

Unknown storage state, such as when a path isn't backed by known storage media.

Public methods

static String
getStorageState(@NonNull path: File)

Returns the current state of the storage device that provides the given path.

Constants

MEDIA_UNKNOWN

static val MEDIA_UNKNOWN: String

Unknown storage state, such as when a path isn't backed by known storage media.

Value: "unknown"

Public methods

getStorageState

@NonNull static fun getStorageState(@NonNull path: File): String

Returns the current state of the storage device that provides the given path.

Return
String: one of MEDIA_UNKNOWN, Environment#MEDIA_REMOVED, Environment#MEDIA_UNMOUNTED, Environment#MEDIA_CHECKING, Environment#MEDIA_NOFS, Environment#MEDIA_MOUNTED, Environment#MEDIA_MOUNTED_READ_ONLY, Environment#MEDIA_SHARED, Environment#MEDIA_BAD_REMOVAL, or Environment#MEDIA_UNMOUNTABLE.