We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7bb5a2c + d576fc4 commit 8fa920fCopy full SHA for 8fa920f
6 files changed
app/src/main/AndroidManifest.xml
@@ -92,6 +92,15 @@
92
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
93
</intent-filter>
94
</receiver>
95
+ <receiver
96
+ android:name="PowerReceiver"
97
+ android:enabled="false"
98
+ android:exported="false">
99
+ <intent-filter>
100
+ <action android:name="android.intent.action.SCREEN_ON" />
101
+ <action android:name="android.intent.action.SCREEN_OFF" />
102
+ </intent-filter>
103
+ </receiver>
104
<receiver
105
android:name=".ActionReceiver"
106
android:enabled="true"
@@ -113,4 +122,4 @@
113
122
android:permission="android.permission.BIND_JOB_SERVICE" />
114
123
</application>
115
124
116
-</manifest>
125
+</manifest>
app/src/main/java/ru/meefik/linuxdeploy/PowerReceiver.java
@@ -0,0 +1,13 @@
1
+package ru.meefik.linuxdeploy;
2
+
3
+import android.content.BroadcastReceiver;
4
+import android.content.Context;
5
+import android.content.Intent;
6
7
+public class PowerReceiver extends BroadcastReceiver {
8
9
+ @Override
10
+ public void onReceive(final Context context, Intent intent) {
11
+ EnvUtils.execService(context, "start", "core/power");
12
+ }
13
+}
app/src/main/java/ru/meefik/linuxdeploy/PropertiesStore.java
@@ -13,7 +13,7 @@ class PropertiesStore extends ParamUtils {
public static final String name = "properties_conf";
14
private static final String[] params = {"method", "distrib", "arch", "suite", "source_path",
15
"target_type", "target_path", "disk_size", "fs_type", "user_name", "user_password",
16
- "privileged_users", "locale", "dns", "net_trigger", "init", "init_path", "init_level",
+ "privileged_users", "locale", "dns", "net_trigger", "power_trigger", "init", "init_path", "init_level",
17
"init_user", "init_async", "ssh_port", "ssh_args", "pulse_host", "pulse_port", "graphics",
18
"vnc_display", "vnc_depth", "vnc_dpi", "vnc_width", "vnc_height", "vnc_args",
19
"x11_display", "x11_host", "x11_sdl", "x11_sdl_delay", "fb_display", "fb_dev",
app/src/main/res/values/preferences.xml
@@ -51,6 +51,7 @@
51
<string name="locale" translatable="false">C</string>
52
<string name="dns" translatable="false"></string>
53
<string name="net_trigger" translatable="false"></string>
54
+ <string name="power_trigger" translatable="false"></string>
55
<string name="is_init" translatable="false">false</string>
56
<string name="init" translatable="false">run-parts</string>
57
<string name="init_path" translatable="false">/etc/rc.local</string>
app/src/main/res/values/strings.xml
@@ -212,6 +212,9 @@
212
<!-- NET_TRIGGER -->
213
<string name="title_net_trigger_preference">Network trigger</string>
214
<string name="dialog_title_net_trigger_preference">Path to trigger script</string>
215
+ <!-- POWER_TRIGGER -->
216
+ <string name="title_power_trigger_preference">Power trigger</string>
217
+ <string name="dialog_title_power_trigger_preference">Path to trigger script</string>
218
219
<!-- INIT -->
220
<string name="init_preferences">INIT</string>
app/src/main/res/xml/properties.xml
@@ -123,6 +123,13 @@
android:summary="@string/net_trigger"
android:title="@string/title_net_trigger_preference" />
126
+ <EditTextPreference
127
+ android:defaultValue="@string/power_trigger"
128
+ android:dialogTitle="@string/dialog_title_power_trigger_preference"
129
+ android:key="power_trigger"
130
+ android:summary="@string/power_trigger"
131
+ android:title="@string/title_power_trigger_preference" />
132
133
</PreferenceCategory>
134
135
<PreferenceCategory android:title="@string/init_preferences">
@@ -235,4 +242,4 @@
235
242
236
243
237
244
238
-</PreferenceScreen>
245
+</PreferenceScreen>
0 commit comments