Wakelock
HMSSDK's toggleAlwaysScreenOn
method allows you to toggle always screen on
mode which prevents the screen from turning off automatically.
When the always screen on
mode is enabled, it prevents the device screen from turning off automatically due to inactivity. This can be useful in scenarios where you want to keep the screen active constantly, such as during video playback.
🔑 Note: Enabling always screen on
can have an impact on the device's battery life as it keeps the screen active even when not in use. Make sure to use this feature
judiciously and consider disabling it when no longer needed.
Let's see how to enable and disable the "always screen on" mode.
/// Enables or disables the "always screen on" mode. void toggleAlwaysScreenOn() { hmsSDK.toggleAlwaysScreenOn(); }