From e0ef393cb30141eba34e978a30db3be72cf9f8b1 Mon Sep 17 00:00:00 2001 From: Daniel Lublin Date: Tue, 16 Jan 2024 14:13:08 +0100 Subject: Send explicit intent, required on Android 14 --- .../java/se/lublin/mumla/service/MumlaConnectionNotification.java | 4 +++- .../main/java/se/lublin/mumla/service/MumlaReconnectNotification.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/se/lublin/mumla/service/MumlaConnectionNotification.java b/app/src/main/java/se/lublin/mumla/service/MumlaConnectionNotification.java index 64f180f..f1e1b43 100644 --- a/app/src/main/java/se/lublin/mumla/service/MumlaConnectionNotification.java +++ b/app/src/main/java/se/lublin/mumla/service/MumlaConnectionNotification.java @@ -31,7 +31,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.content.pm.ServiceInfo; import android.os.Build; import androidx.core.app.NotificationCompat; @@ -166,8 +165,11 @@ public class MumlaConnectionNotification { if (mActionsShown) { // Add notification triggers Intent muteIntent = new Intent(BROADCAST_MUTE); + muteIntent.setPackage(mService.getPackageName()); Intent deafenIntent = new Intent(BROADCAST_DEAFEN); + deafenIntent.setPackage(mService.getPackageName()); Intent overlayIntent = new Intent(BROADCAST_OVERLAY); + overlayIntent.setPackage(mService.getPackageName()); builder.addAction(R.drawable.ic_action_microphone, mService.getString(R.string.mute), PendingIntent.getBroadcast(mService, 1, diff --git a/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java b/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java index 86c9f86..a4a0e08 100644 --- a/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java +++ b/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java @@ -113,17 +113,20 @@ public class MumlaReconnectNotification { builder.setTicker(mContext.getString(R.string.mumlaDisconnected)); Intent dismissIntent = new Intent(BROADCAST_DISMISS); + dismissIntent.setPackage(mContext.getPackageName()); builder.setDeleteIntent(PendingIntent.getBroadcast(mContext, 2, dismissIntent, FLAG_CANCEL_CURRENT | FLAG_IMMUTABLE)); if (autoReconnect) { Intent cancelIntent = new Intent(BROADCAST_CANCEL_RECONNECT); + cancelIntent.setPackage(mContext.getPackageName()); builder.addAction(R.drawable.ic_action_delete_dark, mContext.getString(R.string.cancel_reconnect), PendingIntent.getBroadcast(mContext, 2, cancelIntent, FLAG_CANCEL_CURRENT | FLAG_IMMUTABLE)); builder.setOngoing(true); } else { Intent reconnectIntent = new Intent(BROADCAST_RECONNECT); + reconnectIntent.setPackage(mContext.getPackageName()); builder.addAction(R.drawable.ic_action_move, mContext.getString(R.string.reconnect), PendingIntent.getBroadcast(mContext, 2, reconnectIntent, FLAG_CANCEL_CURRENT | FLAG_IMMUTABLE)); -- cgit v1.2.3