Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +4 −6 Original line number Diff line number Diff line Loading @@ -262,17 +262,15 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G private boolean hasImportanceChanged() { return mSingleNotificationChannel != null && mChannelEnabledSwitch != null && mStartingUserImportance != getSelectedImportance(); } private void saveImportance() { if (mSingleNotificationChannel == null) { return; } int selectedImportance = getSelectedImportance(); if (selectedImportance == mStartingUserImportance) { if (!hasImportanceChanged()) { return; } final int selectedImportance = getSelectedImportance(); MetricsLogger.action(mContext, MetricsEvent.ACTION_SAVE_IMPORTANCE, selectedImportance - mStartingUserImportance); mSingleNotificationChannel.setImportance(selectedImportance); Loading Loading @@ -386,7 +384,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G @Override public boolean willBeRemoved() { return !mChannelEnabledSwitch.isChecked(); return mChannelEnabledSwitch != null && !mChannelEnabledSwitch.isChecked(); } @Override Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -778,4 +778,9 @@ public class NotificationInfoTest extends SysuiTestCase { enabledSwitch.setChecked(true); assertEquals(View.VISIBLE, settingsLink.getVisibility()); } @Test public void testWillBeRemovedReturnsFalseBeforeBind() throws Exception { assertFalse(mNotificationInfo.willBeRemoved()); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +4 −6 Original line number Diff line number Diff line Loading @@ -262,17 +262,15 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G private boolean hasImportanceChanged() { return mSingleNotificationChannel != null && mChannelEnabledSwitch != null && mStartingUserImportance != getSelectedImportance(); } private void saveImportance() { if (mSingleNotificationChannel == null) { return; } int selectedImportance = getSelectedImportance(); if (selectedImportance == mStartingUserImportance) { if (!hasImportanceChanged()) { return; } final int selectedImportance = getSelectedImportance(); MetricsLogger.action(mContext, MetricsEvent.ACTION_SAVE_IMPORTANCE, selectedImportance - mStartingUserImportance); mSingleNotificationChannel.setImportance(selectedImportance); Loading Loading @@ -386,7 +384,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G @Override public boolean willBeRemoved() { return !mChannelEnabledSwitch.isChecked(); return mChannelEnabledSwitch != null && !mChannelEnabledSwitch.isChecked(); } @Override Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -778,4 +778,9 @@ public class NotificationInfoTest extends SysuiTestCase { enabledSwitch.setChecked(true); assertEquals(View.VISIBLE, settingsLink.getVisibility()); } @Test public void testWillBeRemovedReturnsFalseBeforeBind() throws Exception { assertFalse(mNotificationInfo.willBeRemoved()); } }