From 40fba1a1be6692fdd07d4e1f977b732552eadc75 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 14 Dec 2024 20:51:55 -0500 Subject: [PATCH] SDK 34 upgrade. 35 is going to be more work because of edge to edge stuff... --- app/build.gradle | 4 ++-- app/src/main/java/net/gaast/giggity/Reminder.java | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e89adff0..58485098 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.application' def generatedRes = 'build/genrule/res' android { - compileSdk 33 + compileSdk 35 defaultConfig { applicationId "net.gaast.giggity" minSdkVersion 26 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' // Thought I was going to use this for something but forgot. And it may break reproducible builds? // buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" diff --git a/app/src/main/java/net/gaast/giggity/Reminder.java b/app/src/main/java/net/gaast/giggity/Reminder.java index 4e9ae862..7843a72e 100644 --- a/app/src/main/java/net/gaast/giggity/Reminder.java +++ b/app/src/main/java/net/gaast/giggity/Reminder.java @@ -34,7 +34,13 @@ public Reminder(Giggity app) { Log.d("reminder", "onCreate"); IntentFilter filter = new IntentFilter(NotificationPoster.ACTION); - app.registerReceiver(poster, filter); + if (android.os.Build.VERSION.SDK_INT >= 33) { + // Not documented very clearly, but alarm-delivered intents count as external, so not + // exporting breaks notifications! + app.registerReceiver(poster, filter, Context.RECEIVER_EXPORTED); + } else { + app.registerReceiver(poster, filter); + } } public static class NotificationPoster extends BroadcastReceiver {