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 {