#[repr(i32)]pub enum Level {
Partial = 1,
Full = 26,
ScreenBright = 10,
ScreenDim = 6,
}
Expand description
Possible levels for a wake lock.
Variants§
Partial = 1
Ensures that the CPU is running; the screen and keyboard backlight will be allowed to go off.
If the user presses the power button, then the screen will be turned off but the CPU will be kept on until all partial wake locks have been released.
Full = 26
Ensures that the screen and keyboard backlight are on at full brightness.
If the user presses the power button, then the wake lock will be
implicitly released by the system, causing both the screen and the CPU
to be turned off. Contrast with Level::Partial
.
§Deprecation
This constant was deprecated in API level 17. Most applications
should use WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
instead of
this type of wake lock, as it will be correctly managed by the platform
as the user moves between applications and doesn’t require a special
permission.
ScreenBright = 10
Ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off.
If the user presses the power button, then the wake lock will be
implicitly released by the system, causing both the screen and the CPU
to be turned off. Contrast with Level::Partial
.
§Deprecation
This constant was deprecated in API level 15. Most applications
should use WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
instead of
this type of wake lock, as it will be correctly managed by the platform
as the user moves between applications and doesn’t require a special
permission.
ScreenDim = 6
Wake lock level: Ensures that the screen is on (but may be dimmed); the keyboard backlight will be allowed to go off.
If the user presses the power button, then the wake lock will be
implicitly released by the system, causing both the screen and the CPU
to be turned off. Contrast with Level::Partial
.
§Deprecation
This constant was deprecated in API level 17. Most applications
should use WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
instead of
this type of wake lock, as it will be correctly managed by the platform
as the user moves between applications and doesn’t require a special
permission.