Skip to content

Commit

Permalink
ANDROID: set default to allow screen sleep
Browse files Browse the repository at this point in the history
Removed line in bootstrap.java.in that prevented screen sleep on android. Added ANDROID_java_oncreate in DemoSensors with code to prevent screen sleep as an example
  • Loading branch information
peterlew committed Jul 30, 2021
1 parent 79a80df commit d956914
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/DemoSensors/ANDROID_java_oncreate
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This is an example of when you might want the screen to stay on
// The following line sets the appropriate flag
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
2 changes: 0 additions & 2 deletions loaders/android/bootstrap.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ public class @SYS_APPNAME@ extends Activity implements @ANDROID_JAVA_IMPLEMENTS@
this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// prevent sleep
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
if(mGLView==null) { // once only!
mGLView = new xGLSurfaceView(this);
// This may better before other pieces
Expand Down

0 comments on commit d956914

Please sign in to comment.