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

Commit 33f26620 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "Fixed a bug where the notification became clearable"

parents 76d159fd 757d8799
Loading
Loading
Loading
Loading
+19 −24
Original line number Diff line number Diff line
@@ -826,9 +826,8 @@ public abstract class BaseStatusBar extends SystemUI implements
        }
    }

    protected View updateNotificationVetoButton(View row, StatusBarNotification n) {
    protected View bindVetoButtonClickListener(View row, StatusBarNotification n) {
        View vetoButton = row.findViewById(R.id.veto);
        if (n.isClearable()) {
        final String _pkg = n.getPackageName();
        final String _tag = n.getTag();
        final int _id = n.getId();
@@ -846,10 +845,6 @@ public abstract class BaseStatusBar extends SystemUI implements
                }
            }
        });
            vetoButton.setVisibility(View.VISIBLE);
        } else {
            vetoButton.setVisibility(View.GONE);
        }
        vetoButton.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
        return vetoButton;
    }
@@ -1368,7 +1363,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        }

        workAroundBadLayerDrawableOpacity(row);
        View vetoButton = updateNotificationVetoButton(row, sbn);
        View vetoButton = bindVetoButtonClickListener(row, sbn);
        vetoButton.setContentDescription(mContext.getString(
                R.string.accessibility_remove_notification));

@@ -2008,7 +2003,7 @@ public abstract class BaseStatusBar extends SystemUI implements

        // Update the veto button accordingly (and as a result, whether this row is
        // swipe-dismissable)
        updateNotificationVetoButton(entry.row, notification);
        bindVetoButtonClickListener(entry.row, notification);

        if (DEBUG) {
            // Is this for you?
+4 −3
Original line number Diff line number Diff line
@@ -211,7 +211,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mStatusBarNotification = entry.notification;
        mPrivateLayout.onNotificationUpdated(entry);
        mPublicLayout.onNotificationUpdated(entry);
        updateVetoButton();
        mShowingPublicInitialized = false;
        updateClearability();
        if (mIsSummaryWithChildren) {
            recreateNotificationHeader();
        }
@@ -910,7 +911,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        }

        mPrivateLayout.updateExpandButtons(isExpandable());
        updateVetoButton();
        updateClearability();
        mShowingPublicInitialized = true;
    }

@@ -946,7 +947,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        }
    }

    private void updateVetoButton() {
    private void updateClearability() {
        // public versions cannot be dismissed
        mVetoButton.setVisibility(isClearable() && !mShowingPublic ? View.VISIBLE : View.GONE);
    }