Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions app/src/main/java/io/github/soclear/oneuix/hook/SystemUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,42 @@ object SystemUI {
fun disableNotificationGrouping(loadPackageParam: LoadPackageParam) {
if (loadPackageParam.packageName != Package.SYSTEMUI) return
try {
// Force individual display for all notifications
findAndHookMethod(
"android.service.notification.StatusBarNotification",
loadPackageParam.classLoader,
"isGroup",
returnConstant(false)
)

// Block group-summary notifications from entering the collection pipeline.
// Uses reflection (callMethod) because isGroupSummary() is a @hide API.
findAndHookMethod(
"com.android.systemui.statusbar.notification.collection.NotifCollection",
loadPackageParam.classLoader,
"postNotification",
"android.service.notification.StatusBarNotification",
"android.service.notification.NotificationListenerService\$Ranking",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
try {
val sbn = param.args[0]
val notification = callMethod(sbn, "getNotification")
if (notification != null) {
val isSummary = callMethod(
notification, "isGroupSummary"
) as? Boolean ?: false
if (isSummary) {
// Skip original method to discard the notification
param.result = null
}
}
} catch (t: Throwable) {
XposedBridge.log(t)
}
}
}
)
} catch (t: Throwable) {
XposedBridge.log(t)
}
Expand Down