From 793a12d58de7abacdb1b733b11708d4edcd8f9f3 Mon Sep 17 00:00:00 2001 From: Colin Edwards Date: Fri, 22 Dec 2023 12:30:27 -0600 Subject: [PATCH 1/2] android: Use Java 9 --- android/app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f6fdbf5a8..1426851d7 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -28,8 +28,8 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_9 + targetCompatibility = JavaVersion.VERSION_1_9 } } From 3d8e285e2b3d9de1d81c90816f090e1812d53922 Mon Sep 17 00:00:00 2001 From: Colin Edwards Date: Fri, 22 Dec 2023 12:30:45 -0600 Subject: [PATCH 2/2] android: Fix launching on device boot --- android/app/src/main/AndroidManifest.xml | 3 +++ android/app/src/main/java/org/musicpd/Receiver.java | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 7dc120a0f..28957aa0d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -44,6 +44,9 @@ + + + BOOT_ACTIONS = Set.of( + "android.intent.action.BOOT_COMPLETED", + "android.intent.action.QUICKBOOT_POWERON" + ); + @Override public void onReceive(Context context, Intent intent) { Log.d("Receiver", "onReceive: " + intent); - if (intent.getAction() == "android.intent.action.BOOT_COMPLETED") { + if (BOOT_ACTIONS.contains(intent.getAction())) { if (Settings.Preferences.getBoolean(context, Settings.Preferences.KEY_RUN_ON_BOOT, false)) {