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

Commit d2a99bdf authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Create/rename methods to track entryadapter usage

Create a new getEntryLegacy() method that throws if used
with the bundling flag on, and use that in every place that has already
been migrated

Deprecate both getEntry() and getEntryLegacy() so new usages stop appearing

Do the same for setEntry()

Test: full SystemUI suite
Test: boot device and post notification with flag on and off
Bug: 395857098
Flag: com.android.systemui.notification_bundle_ui

Change-Id: Ib4431652e869c83b4a2f32cde8e2230c9d4a6e71
parent c80fd5d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
        if (NotificationBundleUi.isEnabled()) {
            return row.getEntryAdapter().getSbn().getNotification();
        } else {
            return row.getEntry().getSbn().getNotification();
            return row.getEntryLegacy().getSbn().getNotification();
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ public final class NotificationGroupTestHelper {
        ExpandableNotificationRow row = mock(ExpandableNotificationRow.class);
        entry.setRow(row);
        when(row.getEntry()).thenReturn(entry);
        when(row.getEntryLegacy()).thenReturn(entry);
        return entry;
    }

+2 −2
Original line number Diff line number Diff line
@@ -894,8 +894,8 @@ public class SwipeHelper implements Gefingerpoken, Dumpable {
                if (NotificationBundleUi.isEnabled()) {
                    return enr.getEntryAdapter().canDragAndDrop();
                } else {
                    boolean canBubble = enr.getEntry().canBubble();
                    Notification notif = enr.getEntry().getSbn().getNotification();
                    boolean canBubble = enr.getEntryLegacy().canBubble();
                    Notification notif = enr.getEntryLegacy().getSbn().getNotification();
                    PendingIntent dragIntent = notif.contentIntent != null ? notif.contentIntent
                            : notif.fullScreenIntent;
                    if (dragIntent != null && dragIntent.isActivity() && !canBubble) {
+2 −2
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ constructor(
                // Only drag down on sensitive views, otherwise the ExpandHelper will take this
                return if (NotificationBundleUi.isEnabled)
                    view.entryAdapter?.isSensitive?.value == true
                else view.entry.isSensitive.value
                else view.entryLegacy.isSensitive.value
            }
        }
        return false
@@ -569,7 +569,7 @@ constructor(
            if (NotificationBundleUi.isEnabled) {
                userId = expandView.entryAdapter?.sbn?.userId!!
            } else {
                userId = expandView.entry.sbn.userId
                userId = expandView.entryLegacy.sbn.userId
            }
        }
        var fullShadeNeedsBouncer =
+3 −3
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public class NotificationRemoteInputManager implements CoreStartable {
                        if (NotificationBundleUi.isEnabled()) {
                            releaseNotificationIfKeptForRemoteInputHistory(row.getEntryAdapter());
                        } else {
                            releaseNotificationIfKeptForRemoteInputHistory(row.getEntry());
                            releaseNotificationIfKeptForRemoteInputHistory(row.getEntryLegacy());
                        }
                    }
                    return started;
@@ -189,8 +189,8 @@ public class NotificationRemoteInputManager implements CoreStartable {
                    statusBarNotification = row.getEntryAdapter().getSbn();
                }
            } else {
                if (row.getEntry() != null) {
                    statusBarNotification = row.getEntry().getSbn();
                if (row.getEntryLegacy() != null) {
                    statusBarNotification = row.getEntryLegacy().getSbn();
                }
            }
            if (statusBarNotification == null) {
Loading