Skip to content

Commit 1bd88ad

Browse files
committed
feat: Support quickboot for HTC devices
1 parent f0e65b7 commit 1bd88ad

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<intent-filter>
1515
<action android:name="android.intent.action.BOOT_COMPLETED" />
1616
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
17+
<!-- This is required on HTC devices to support their "quickboot" feature -->
18+
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
1719
</intent-filter>
1820
</receiver>
1921
<receiver

android/src/main/kotlin/com/pravera/flutter_foreground_task/service/RebootReceiver.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class RebootReceiver : BroadcastReceiver() {
3333
val options = ForegroundTaskOptions.getData(context)
3434

3535
// Check whether to start the service at boot intent.
36-
if (intent.action == Intent.ACTION_BOOT_COMPLETED && options.autoRunOnBoot) {
36+
if ((intent.action == Intent.ACTION_BOOT_COMPLETED ||
37+
intent.action == "android.intent.action.QUICKBOOT_POWERON") && options.autoRunOnBoot) {
3738
return startForegroundService(context)
3839
}
3940

0 commit comments

Comments
 (0)