Bug 2739 - [Android] No support for SDL_DisableScreenSaver by Martin Gerhardy
This commit is contained in:
parent
a32480ef1f
commit
0ec4fc6589
4 changed files with 28 additions and 1 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue