提交 795728aa 编写于 作者: S Simon Fels 提交者: Simon Fels

android: launcher: configure the screen to stay on forever

上级 6011fe29
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
package="org.anbox.launcher"> package="org.anbox.launcher">
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<application <application
android:name=".LauncherApplication" android:name=".LauncherApplication"
android:label="Anbox Launcher" android:label="Anbox Launcher"
......
...@@ -19,6 +19,7 @@ package org.anbox.launcher; ...@@ -19,6 +19,7 @@ package org.anbox.launcher;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings;
/** /**
* Default launcher application. * Default launcher application.
...@@ -29,6 +30,13 @@ public final class Launcher extends Activity { ...@@ -29,6 +30,13 @@ public final class Launcher extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(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); setContentView(R.layout.activity_launcher);
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册