mirror of
https://github.com/encounter/SDL.git
synced 2025-12-10 22:17:59 +00:00
Bug 2739 - [Android] No support for SDL_DisableScreenSaver by Martin Gerhardy
This commit is contained in:
@@ -187,6 +187,13 @@ public class SDLActivity extends Activity {
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
public static void suspendScreenSaver(boolean suspend) {
|
||||
if (suspend)
|
||||
mSingleton.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
else
|
||||
mSingleton.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
/** Called by onPause or surfaceDestroyed. Even if surfaceDestroyed
|
||||
* is the first to be called, mIsSurfaceReady should still be set
|
||||
* to 'true' during the call to onPause (in a usual scenario).
|
||||
|
||||
Reference in New Issue
Block a user