Android.os.PowerManager
lastmod 2018-08-17created 2016-12-081 edits
In practice it's quite simple
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
wl.acquire();
// ..screen will stay on during this section..
wl.release();
See also
Favorite site
- Android developer: PowerManager
- Forcing the screen to wake from sleep mode on Android
- Google play store: Power On Volume (recommended as a good app to analyze)
- https://play.google.com/store/apps/details?id=cz.destil.fixbrokenpb&hl=ko
- Fix Broken Power Button (recommended as a good app to analyze)