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

Commit 9226516c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Hide secondary text for Default channel if not blocked" into oc-dev

parents 8a4ff5ed 0a8f0553
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -329,12 +329,14 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
    private void updateSecondaryText() {
        final boolean disabled = mSingleNotificationChannel != null &&
                getSelectedImportance() == IMPORTANCE_NONE;
        final boolean isDefaultChannel = mSingleNotificationChannel != null &&
                mSingleNotificationChannel.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID);
        if (disabled) {
            mChannelDisabledView.setVisibility(View.VISIBLE);
            mNumChannelsView.setVisibility(View.GONE);
        } else {
            mChannelDisabledView.setVisibility(View.GONE);
            mNumChannelsView.setVisibility(View.VISIBLE);
            mNumChannelsView.setVisibility(isDefaultChannel ? View.INVISIBLE : View.VISIBLE);
        }
    }

+2 −4
Original line number Diff line number Diff line
@@ -314,16 +314,14 @@ public class NotificationInfoTest extends SysuiTestCase {
    }

    @Test
    public void testBindNotification_NumChannelsTextUniqueWhenDefaultChannel() throws Exception {
    public void testBindNotification_NumChannelsTextHiddenWhenDefaultChannel() throws Exception {
        mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
                TEST_PACKAGE_NAME, Arrays.asList(mDefaultNotificationChannel),
                mNotificationChannel.getImportance(), mSbn, null, null,
                null, null, null);
        final TextView numChannelsView =
                (TextView) mNotificationInfo.findViewById(R.id.num_channels_desc);
        assertEquals(View.VISIBLE, numChannelsView.getVisibility());
        assertEquals(mContext.getString(R.string.notification_default_channel_desc),
                numChannelsView.getText());
        assertEquals(View.INVISIBLE, numChannelsView.getVisibility());
    }

    @Test