Loading src/com/android/settings/notification/ZenModeStarredContactsPreferenceController.java +4 −1 Original line number Diff line number Diff line Loading @@ -68,8 +68,11 @@ public class ZenModeStarredContactsPreferenceController extends public void displayPreference(PreferenceScreen screen) { super.displayPreference(screen); mPreference = screen.findPreference(KEY); if (mPreference != null) { mPreference.setOnPreferenceClickListener(this); } } @Override public String getPreferenceKey() { Loading tests/robotests/src/com/android/settings/notification/ZenModeStarredContactsPreferenceControllerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -190,4 +190,13 @@ public class ZenModeStarredContactsPreferenceControllerTest { assertThat(contacts.get(i)).isNotNull(); } } @Test public void nullPreference_displayPreference() { when(mPreferenceScreen.findPreference(mMessagesController.getPreferenceKey())) .thenReturn(null); // should not throw a null pointer mMessagesController.displayPreference(mPreferenceScreen); } } Loading
src/com/android/settings/notification/ZenModeStarredContactsPreferenceController.java +4 −1 Original line number Diff line number Diff line Loading @@ -68,8 +68,11 @@ public class ZenModeStarredContactsPreferenceController extends public void displayPreference(PreferenceScreen screen) { super.displayPreference(screen); mPreference = screen.findPreference(KEY); if (mPreference != null) { mPreference.setOnPreferenceClickListener(this); } } @Override public String getPreferenceKey() { Loading
tests/robotests/src/com/android/settings/notification/ZenModeStarredContactsPreferenceControllerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -190,4 +190,13 @@ public class ZenModeStarredContactsPreferenceControllerTest { assertThat(contacts.get(i)).isNotNull(); } } @Test public void nullPreference_displayPreference() { when(mPreferenceScreen.findPreference(mMessagesController.getPreferenceKey())) .thenReturn(null); // should not throw a null pointer mMessagesController.displayPreference(mPreferenceScreen); } }