From 1b8c9069dabd9c84de41d19766ec29507f70262f Mon Sep 17 00:00:00 2001 From: Kevin Hoogendam Date: Mon, 15 Jan 2024 10:39:50 +0100 Subject: [PATCH] #403 also auto start service after app update --- .../android/src/main/AndroidManifest.xml | 1 + .../id/flutter/flutter_background_service/BootReceiver.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/flutter_background_service_android/android/src/main/AndroidManifest.xml b/packages/flutter_background_service_android/android/src/main/AndroidManifest.xml index be143d39..a3db7697 100644 --- a/packages/flutter_background_service_android/android/src/main/AndroidManifest.xml +++ b/packages/flutter_background_service_android/android/src/main/AndroidManifest.xml @@ -28,6 +28,7 @@ + diff --git a/packages/flutter_background_service_android/android/src/main/java/id/flutter/flutter_background_service/BootReceiver.java b/packages/flutter_background_service_android/android/src/main/java/id/flutter/flutter_background_service/BootReceiver.java index 7be88687..36a7fd1d 100644 --- a/packages/flutter_background_service_android/android/src/main/java/id/flutter/flutter_background_service/BootReceiver.java +++ b/packages/flutter_background_service_android/android/src/main/java/id/flutter/flutter_background_service/BootReceiver.java @@ -12,7 +12,7 @@ public class BootReceiver extends BroadcastReceiver { @SuppressLint("WakelockTimeout") @Override public void onReceive(Context context, Intent intent) { - if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED) || intent.getAction().equals("android.intent.action.QUICKBOOT_POWERON")) { + if (intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED) || intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED) || intent.getAction().equals("android.intent.action.QUICKBOOT_POWERON")) { final Config config = new Config(context); boolean autoStart = config.isAutoStartOnBoot(); if (autoStart) {