Skip to content

Commit 46e2121

Browse files
author
Dave Smith
committed
Make launch behavior optional.
Bug: 72950561 Signed-off-by: Dave Smith <[email protected]> Change-Id: I11754b42bb69ec3200e7dd24c660a7cd2a472b5a
1 parent 5924bde commit 46e2121

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

java/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ $ adb root
5454
$ adb shell setprop persist.sys.timezone "America/Denver"
5555
```
5656

57+
## Enable auto-launch behavior
58+
59+
This sample app is currently configured to launch only when deployed from your
60+
development machine. To enable the main activity to launch automatically on boot,
61+
add the following `intent-filter` to the app's manifest file:
62+
63+
```xml
64+
<activity ...>
65+
66+
<intent-filter>
67+
<action android:name="android.intent.action.MAIN"/>
68+
<category android:name="android.intent.category.HOME"/>
69+
<category android:name="android.intent.category.DEFAULT"/>
70+
</intent-filter>
71+
72+
</activity>
73+
```
74+
5775
## License
5876

5977
Copyright 2017 The Android Open Source Project, Inc.

java/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@
3232
<category android:name="android.intent.category.LAUNCHER"/>
3333
</intent-filter>
3434

35-
<!-- Launch as default on IoT startup -->
35+
<!--
36+
Uncomment the following intent filter block to enable this activity to
37+
launch automatically on boot, and re-launch if the app terminates.
38+
-->
39+
<!--
3640
<intent-filter>
3741
<action android:name="android.intent.action.MAIN"/>
38-
<category android:name="android.intent.category.IOT_LAUNCHER"/>
42+
<category android:name="android.intent.category.HOME"/>
3943
<category android:name="android.intent.category.DEFAULT"/>
4044
</intent-filter>
45+
-->
4146
</activity>
4247
</application>
4348

44-
</manifest>
49+
</manifest>

kotlin/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ $ adb root
5454
$ adb shell setprop persist.sys.timezone "America/Denver"
5555
```
5656

57+
## Enable auto-launch behavior
58+
59+
This sample app is currently configured to launch only when deployed from your
60+
development machine. To enable the main activity to launch automatically on boot,
61+
add the following `intent-filter` to the app's manifest file:
62+
63+
```xml
64+
<activity ...>
65+
66+
<intent-filter>
67+
<action android:name="android.intent.action.MAIN"/>
68+
<category android:name="android.intent.category.HOME"/>
69+
<category android:name="android.intent.category.DEFAULT"/>
70+
</intent-filter>
71+
72+
</activity>
73+
```
74+
5775
## License
5876

5977
Copyright 2018 The Android Open Source Project, Inc.

kotlin/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@
3232
<category android:name="android.intent.category.LAUNCHER"/>
3333
</intent-filter>
3434

35-
<!-- Launch as default on IoT startup -->
35+
<!--
36+
Uncomment the following intent filter block to enable this activity to
37+
launch automatically on boot, and re-launch if the app terminates.
38+
-->
39+
<!--
3640
<intent-filter>
3741
<action android:name="android.intent.action.MAIN"/>
38-
<category android:name="android.intent.category.IOT_LAUNCHER"/>
42+
<category android:name="android.intent.category.HOME"/>
3943
<category android:name="android.intent.category.DEFAULT"/>
4044
</intent-filter>
45+
-->
4146
</activity>
4247
</application>
4348

44-
</manifest>
49+
</manifest>

0 commit comments

Comments
 (0)