Skip to content

PowerManagerHelper

Pico edited this page Dec 15, 2020 · 10 revisions

void androidLockScreen()

Lock the screen. You need to modify main activity in AndroidManifest.xml to com.picovr.androidhelper.MainActivity.


void androidUnlockScreen()

Unlock the screen.


void acquireWakeLock()

Request a WakeLock. This function will prevent the device to sleep until releaseWakeLock() Called.
PowerManager.WakeLock | Android Developers


void acquireWakeLock(Long timeout)

Request a WakeLock, unlock automatically after timeout.
parameter:
timeout: the allowed maximal time for devices to stay on.


void releaseWakeLock()

Deactivate WakeLock.


void setPropSleep(String time)

Set system sleep timeout. The sleep timeout must longer than screen off timeout.
parameter:
time: timeout duration in seconds."-1" for never sleep mode.


void setPropScreenOff(String time)

Sets Screen Off Timeout.
parameter:
time: timeout duration in seconds. "65535" for screen never off.
You must set sleep mode to never before setting screen never off.


void androidShutDown() (*)

Shutdown the device.


void androidReBoot() (*)

Reboot the device.