android: launcher: configure the screen to stay on forever

This commit is contained in:
Simon Fels 2016-07-12 12:46:37 +02:00 • committed by Simon Fels
commit 795728aae6
2 changed files with 10 additions and 0 deletions

View file

@ -3,6 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.anbox.launcher">
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<application
android:name=".LauncherApplication"
android:label="Anbox Launcher"

View file

@ -19,6 +19,7 @@ package org.anbox.launcher;
import android.app.Activity;
import android.os.Bundle;
import android.provider.Settings;
/**
* Default launcher application.
@ -29,6 +30,13 @@ public final class Launcher extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Make sure the screen stays on forever
Settings.System.putInt(
getContentResolver(),
Settings.System.SCREEN_OFF_TIMEOUT,
Integer.MAX_VALUE);
setContentView(R.layout.activity_launcher);
}
}