From 86d4722f80dee418d9bab85aad7dc05c637b13e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E5=AE=AB=E9=9B=AA=E7=8F=8A?= Date: Mon, 5 Dec 2022 22:21:50 +0800 Subject: [PATCH] Set opPkg to settings for android 9- (#2277) --- .../org/lsposed/lspd/service/LSPNotificationManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/src/main/java/org/lsposed/lspd/service/LSPNotificationManager.java b/daemon/src/main/java/org/lsposed/lspd/service/LSPNotificationManager.java index 8d3772fd..f94c97b6 100644 --- a/daemon/src/main/java/org/lsposed/lspd/service/LSPNotificationManager.java +++ b/daemon/src/main/java/org/lsposed/lspd/service/LSPNotificationManager.java @@ -34,11 +34,13 @@ public class LSPNotificationManager { private static final String UPDATED_CHANNEL_ID = "lsposed_module_updated"; private static final String STATUS_CHANNEL_ID = "lsposed_status"; private static final int STATUS_NOTIFICATION_ID = 2000; + private static final String opPkg = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? + "android" : "com.android.settings"; private static final HashMap notificationIds = new HashMap<>(); private static int previousNotificationId = STATUS_NOTIFICATION_ID; - static String openManagerAction = UUID.randomUUID().toString(); + static final String openManagerAction = UUID.randomUUID().toString(); private static INotificationManager notificationManager = null; private static IBinder binder = null; @@ -140,7 +142,7 @@ public class LSPNotificationManager { try { var nm = getNotificationManager(); createNotificationChannel(nm); - nm.enqueueNotificationWithTag("android", "android", null, + nm.enqueueNotificationWithTag("android", opPkg, null, STATUS_NOTIFICATION_ID, notification, 0); } catch (RemoteException e) { Log.e(TAG, "notifyStatusNotification: ", e); @@ -215,7 +217,7 @@ public class LSPNotificationManager { notification.extras.putString("android.substName", "LSPosed"); var nm = getNotificationManager(); createNotificationChannel(nm); - nm.enqueueNotificationWithTag("android", "android", modulePackageName, + nm.enqueueNotificationWithTag("android", opPkg, modulePackageName, pushAndGetNotificationId(modulePackageName, moduleUserId), notification, 0); } catch (Throwable e) {