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

Commit ae817376 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "Reset selected Notification importance after closing the guts" into tm-qpr-dev

parents e076854f cecb405f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public class FeedbackInfo extends LinearLayout implements NotificationGuts.GutsC
    }

    private void positiveFeedback(View v) {
        mGutsContainer.closeControls(v, false);
        mGutsContainer.closeControls(v, /* save= */ false);
        handleFeedback(true);
    }

@@ -176,7 +176,7 @@ public class FeedbackInfo extends LinearLayout implements NotificationGuts.GutsC
            menuItem = mMenuRowPlugin.getLongpressMenuItem(mContext);
        }

        mGutsContainer.closeControls(v, false);
        mGutsContainer.closeControls(v, /* save= */ false);
        mNotificationGutsManager.openGuts(mExpandableNotificationRow, 0, 0, menuItem);
        handleFeedback(false);
    }
@@ -203,7 +203,7 @@ public class FeedbackInfo extends LinearLayout implements NotificationGuts.GutsC
    }

    private void closeControls(View v) {
        mGutsContainer.closeControls(v, false);
        mGutsContainer.closeControls(v, /* save= */ false);
    }

    @Override
@@ -232,7 +232,7 @@ public class FeedbackInfo extends LinearLayout implements NotificationGuts.GutsC
    }

    @Override
    public boolean shouldBeSaved() {
    public boolean shouldBeSavedOnClose() {
        return false;
    }

+9 −8
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ public class NotificationConversationInfo extends LinearLayout implements
            mShadeController.animateCollapsePanels();
            mPeopleSpaceWidgetManager.requestPinAppWidget(mShortcutInfo, new Bundle());
        }
        mGutsContainer.closeControls(v, true);
        mGutsContainer.closeControls(v, /* save= */ true);
    };

    public NotificationConversationInfo(Context context, AttributeSet attrs) {
@@ -186,7 +186,6 @@ public class NotificationConversationInfo extends LinearLayout implements
    }

    public void bindNotification(
            @Action int selectedAction,
            ShortcutManager shortcutManager,
            PackageManager pm,
            PeopleSpaceWidgetManager peopleSpaceWidgetManager,
@@ -205,8 +204,6 @@ public class NotificationConversationInfo extends LinearLayout implements
            OnConversationSettingsClickListener onConversationSettingsClickListener,
            Optional<BubblesManager> bubblesManagerOptional,
            ShadeController shadeController) {
        mPressedApply = false;
        mSelectedAction = selectedAction;
        mINotificationManager = iNotificationManager;
        mPeopleSpaceWidgetManager = peopleSpaceWidgetManager;
        mOnUserInteractionCallback = onUserInteractionCallback;
@@ -417,9 +414,7 @@ public class NotificationConversationInfo extends LinearLayout implements
    }

    @Override
    public void onFinishedClosing() {
        mSelectedAction = -1;
    }
    public void onFinishedClosing() { }

    @Override
    public boolean needsFalsingProtection() {
@@ -564,7 +559,7 @@ public class NotificationConversationInfo extends LinearLayout implements
    }

    @Override
    public boolean shouldBeSaved() {
    public boolean shouldBeSavedOnClose() {
        return mPressedApply;
    }

@@ -578,6 +573,12 @@ public class NotificationConversationInfo extends LinearLayout implements
        if (save && mSelectedAction > -1) {
            updateChannel();
        }

        // Clear the selected importance when closing, so when when we open again,
        // we starts from a clean state.
        mSelectedAction = -1;
        mPressedApply = false;

        return false;
    }

+3 −3
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ public class NotificationGuts extends FrameLayout {

                    switch (action) {
                        case AccessibilityNodeInfo.ACTION_LONG_CLICK:
                            closeControls(host, false);
                            closeControls(host, /* save= */ false);
                            return true;
                    }

@@ -123,7 +123,7 @@ public class NotificationGuts extends FrameLayout {
        /**
         * Return whether something changed and needs to be saved, possibly requiring a bouncer.
         */
        boolean shouldBeSaved();
        boolean shouldBeSavedOnClose();

        /**
         * Called when the guts view has finished its close animation.
@@ -259,7 +259,7 @@ public class NotificationGuts extends FrameLayout {
        if (mGutsContent != null) {
            if ((mGutsContent.isLeavebehind() && leavebehinds)
                    || (!mGutsContent.isLeavebehind() && controls)) {
                closeControls(x, y, mGutsContent.shouldBeSaved(), force);
                closeControls(x, y, mGutsContent.shouldBeSavedOnClose(), force);
            }
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -463,7 +463,6 @@ public class NotificationGutsManager implements NotifGutsViewManager {
                        R.dimen.notification_guts_conversation_icon_size));

        notificationInfoView.bindNotification(
                notificationInfoView.getSelectedAction(),
                mShortcutManager,
                pmUser,
                mPeopleSpaceWidgetManager,
+8 −6
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
    // used by standard ui
    private OnClickListener mOnDismissSettings = v -> {
        mPressedApply = true;
        mGutsContainer.closeControls(v, true);
        mGutsContainer.closeControls(v, /* save= */ true);
    };

    public NotificationInfo(Context context, AttributeSet attrs) {
@@ -541,10 +541,6 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G

    @Override
    public void onFinishedClosing() {
        if (mChosenImportance != null) {
            mStartingChannelImportance = mChosenImportance;
        }

        bindInlineControls();

        logUiEvent(NotificationControlsEvent.NOTIFICATION_CONTROLS_CLOSE);
@@ -604,7 +600,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
    }

    @Override
    public boolean shouldBeSaved() {
    public boolean shouldBeSavedOnClose() {
        return mPressedApply;
    }

@@ -627,6 +623,12 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
        if (save) {
            saveImportance();
        }

        // Clear the selected importance when closing, so when when we open again,
        // we starts from a clean state.
        mChosenImportance = null;
        mPressedApply = false;

        return false;
    }

Loading