Enum Class WakeLockErrorCode
- All Implemented Interfaces:
Serializable,Comparable<WakeLockErrorCode>,Constable
Reason a
WakeLock.request(onError) call failed.- Since:
- 25.2
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe browser refused the request, usually because the tab is currently hidden, a permissions policy blocks wake lock in this frame, or the operating system's power-management settings prevent it.The request failed for a reason that does not match a more specific code.The Screen Wake Lock API is unusable in this context ? the browser does not implement it, or the page is served over an insecure connection (not HTTPS orlocalhost). -
Method Summary
Modifier and TypeMethodDescriptionstatic WakeLockErrorCodeReturns the enum constant of this class with the specified name.static WakeLockErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNSUPPORTED
The Screen Wake Lock API is unusable in this context ? the browser does not implement it, or the page is served over an insecure connection (not HTTPS orlocalhost). This matches theWakeLockAvailability.UNSUPPORTEDavailability hint, so you can hide wake-lock controls up front rather than letting the request fail. -
NOT_ALLOWED
The browser refused the request, usually because the tab is currently hidden, a permissions policy blocks wake lock in this frame, or the operating system's power-management settings prevent it. -
UNKNOWN
The request failed for a reason that does not match a more specific code. SeeWakeLockError.message()for the underlying browser message.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-