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

Commit 1fbda547 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Revert "Fix isRemoved not being set for rows"

This reverts commit b1dbf69d.

Reason for revert: b/418888050

Bug: 417457086
Change-Id: Ifcb006c7a1a61516ab1f7eb8bdc4890e969c5c28
parent b1dbf69d
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -76,16 +76,6 @@ flag {
   bug: "343942780"
}

flag {
   name: "notification_row_is_removed_fix"
   namespace: "systemui"
   description: "Fix incorrect isRemoved value in ExpandableNotificationRow"
   bug: "417457086"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "notification_ambient_suppression_after_inflation"
   namespace: "systemui"
+12 −0
Original line number Diff line number Diff line
@@ -677,6 +677,18 @@ public final class NotificationEntry extends ListEntry {
        return row != null && row.isDismissed();
    }

    public boolean isRowRemoved() {
        return row != null && row.isRemoved();
    }

    /**
     * @return {@code true} if the row is null or removed
     */
    public boolean isRemoved() {
        //TODO: recycling invalidates this
        return row == null || row.isRemoved();
    }

    public boolean isRowPinned() {
        return getPinnedStatus().isPinned();
    }
+0 −9
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.systemui.statusbar.notification.row;

import static com.android.systemui.Flags.notificationRowIsRemovedFix;

import android.util.ArrayMap;
import android.util.ArraySet;
import android.widget.FrameLayout;
@@ -220,13 +218,6 @@ public final class NotifBindPipeline {
            mStage.deleteStageParams(entry);
            mStartProcessor.cancel(entry);
        }

        @Override
        public void onEntryRemoved(NotificationEntry entry, int reason) {
            if (notificationRowIsRemovedFix()) {
                entry.removeRow();
            }
        }
    };

    private @NonNull BindEntry getBindEntry(NotificationEntry entry) {
+6 −9
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.systemui.statusbar.notification.stack;

import static android.app.Flags.notificationsRedesignTemplates;

import static com.android.systemui.Flags.notificationRowIsRemovedFix;

import android.app.Notification;
import android.content.Context;
import android.content.res.Configuration;
@@ -434,14 +432,13 @@ public class NotificationChildrenContainer extends ViewGroup
    }

    private static boolean shouldRestoreChild(ExpandableNotificationRow row) {
        if (notificationRowIsRemovedFix() || !USE_IS_CHANGING_POSITION_TO_RESTORE) {
            return !row.isRemoved();
        } else {
            // TODO: b/417457086 - We're only checking for isChangingPosition here as a
            //  quick-and-dirty fix for b/415665263, but the real issue is that isRemoved is
            //  currently ALWAYS false. This should be fixed when notification_row_is_removed_fix
            //  is enabled.
        // TODO: b/417457086 - We're only checking for isChangingPosition here as a quick-and-dirty
        //  fix for b/415665263, but the real issue is that isRemoved is currently ALWAYS false.
        //  We need to fix that behind a flag, so this hack is temporary.
        if (USE_IS_CHANGING_POSITION_TO_RESTORE) {
            return !row.isRemoved() && row.isChangingPosition();
        } else {
            return !row.isRemoved();
        }
    }