Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4689ff4 authored by lyn's avatar lyn
Browse files

Add toggle for bundling test apk notifs and debug logging

Bug: 396301289
Test: adb
Flag: com.android.systemui.notification_bundle_ui
Change-Id: Iea8b2a3408e379ea6753b60f602c5ae8d1fdd1ac
parent 5c715c15
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -289,6 +289,9 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {

        mIdToBundleEntry.clear();
        for (String id: mNotifBundler.getBundleIds()) {
            if (BundleCoordinator.debugBundleUi) {
                Log.i(TAG, "create BundleEntry with id: " + id);
            }
            mIdToBundleEntry.put(id, new BundleEntry(id));
        }
    }
+11 −1
Original line number Diff line number Diff line
@@ -98,9 +98,14 @@ class BundleCoordinator @Inject constructor(
        object : NotifBundler("NotifBundler") {

            // Use list instead of set to keep fixed order
            override val bundleIds: List<String> = SYSTEM_RESERVED_IDS
            override val bundleIds: List<String> =
                if (debugBundleUi) SYSTEM_RESERVED_IDS + "notify"
                else SYSTEM_RESERVED_IDS

            override fun getBundleIdOrNull(entry: NotificationEntry?): String? {
                if (debugBundleUi && entry?.key?.contains("notify") == true) {
                    return "notify"
                }
                return entry?.representativeEntry?.channel?.id?.takeIf { it in this.bundleIds }
            }
        }
@@ -110,4 +115,9 @@ class BundleCoordinator @Inject constructor(
            pipeline.setNotifBundler(bundler)
        }
    }

    companion object {
        @kotlin.jvm.JvmField
        var debugBundleUi: Boolean = true
    }
}