Skip to content

Commit 2075a39

Browse files
Migrate NotificationListener to AndroidX
Update NotificationListener to use AndroidX LocalBroadcastManager import.
1 parent 90e303f commit 2075a39

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/src/main/java/com/benny/openlauncher/notifications/NotificationListener.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.content.Context;
66
import android.content.Intent;
77
import android.content.IntentFilter;
8+
import android.os.Build;
89
import android.os.Handler;
910
import android.os.Message;
1011
import android.service.notification.NotificationListenerService;
@@ -55,7 +56,11 @@ public void onCreate() {
5556
if (_notificationReceiver == null) {
5657
_notificationReceiver = new NotificationListenerReceiver();
5758
IntentFilter filter = new IntentFilter(UPDATE_NOTIFICATIONS_ACTION);
58-
registerReceiver(_notificationReceiver, filter);
59+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
60+
registerReceiver(_notificationReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
61+
} else {
62+
registerReceiver(_notificationReceiver, filter);
63+
}
5964
}
6065
}
6166

0 commit comments

Comments
 (0)