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

Commit 7140f576 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Only save conversation modifications on 'apply'" into rvc-dev am:...

Merge "Only save conversation modifications on 'apply'" into rvc-dev am: 7e76c85d am: f95844a4 am: beb74069 am: 77d62aee

Change-Id: I3643a0cefb637d9c964ebc386582d804969efadb
parents 323118a2 77d62aee
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -82,8 +82,8 @@ public class NotificationConversationInfo extends LinearLayout implements
    private INotificationManager mINotificationManager;
    ShortcutManager mShortcutManager;
    private PackageManager mPm;
    private VisualStabilityManager mVisualStabilityManager;
    private ConversationIconFactory mIconFactory;
    private VisualStabilityManager mVisualStabilityManager;

    private String mPackageName;
    private String mAppName;
@@ -99,7 +99,9 @@ public class NotificationConversationInfo extends LinearLayout implements
    private TextView mPriorityDescriptionView;
    private TextView mDefaultDescriptionView;
    private TextView mSilentDescriptionView;

    private @Action int mSelectedAction = -1;
    private boolean mPressedApply;

    private OnSnoozeClickListener mOnSnoozeClickListener;
    private OnSettingsClickListener mOnSettingsClickListener;
@@ -151,6 +153,7 @@ public class NotificationConversationInfo extends LinearLayout implements
    };

    private OnClickListener mOnDone = v -> {
        mPressedApply = true;
        closeControls(v, true);
    };

@@ -489,6 +492,7 @@ public class NotificationConversationInfo extends LinearLayout implements
        bgHandler.post(
                new UpdateChannelRunnable(mINotificationManager, mPackageName,
                        mAppUid, mSelectedAction, mNotificationChannel));
        mVisualStabilityManager.temporarilyAllowReordering();
    }

    /**
@@ -522,7 +526,7 @@ public class NotificationConversationInfo extends LinearLayout implements

    @Override
    public boolean shouldBeSaved() {
        return mSelectedAction == ACTION_FAVORITE || mSelectedAction == ACTION_MUTE;
        return mPressedApply;
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -543,6 +543,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
                .isEqualTo(GONE);

        // no changes until hit done
        assertFalse(mNotificationInfo.shouldBeSaved());
        verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
                anyString(), anyInt(), any());
        assertFalse(mConversationChannel.isImportantConversation());
@@ -580,6 +581,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
                .isEqualTo(GONE);

        // no changes until hit done
        assertFalse(mNotificationInfo.shouldBeSaved());
        verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
                anyString(), anyInt(), any());
        assertFalse(mConversationChannel.isImportantConversation());
@@ -619,6 +621,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
                .isEqualTo(VISIBLE);

        // no changes until save
        assertFalse(mNotificationInfo.shouldBeSaved());
        verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
                anyString(), anyInt(), any());
        assertEquals(IMPORTANCE_DEFAULT, mConversationChannel.getImportance());