Set opPkg to settings for android 9- (#2277)

This commit is contained in:
南宫雪珊 2022-12-05 22:21:50 +08:00 committed by GitHub
parent 4b66d556db
commit 86d4722f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -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<String, Integer> 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) {