EnvironmentCompat

public final class EnvironmentCompat
extends Object

java.lang.Object
   ↳ androidx.core.os.EnvironmentCompat


Helper for accessing features in Environment.

Summary

Constants

String MEDIA_UNKNOWN

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

Public methods

static String getStorageState(File path)

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

Inherited methods

Constants

MEDIA_UNKNOWN

public static final String MEDIA_UNKNOWN

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

Constant Value: "unknown"

Public methods

getStorageState

public static String getStorageState (File path)

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

Parameters
path File

Returns
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.