Loading src/com/android/settings/development/NotificationChannelWarningsPreferenceController.java +1 −6 Original line number Diff line number Diff line Loading @@ -38,10 +38,6 @@ public class NotificationChannelWarningsPreferenceController extends final static int SETTING_VALUE_ON = 1; @VisibleForTesting final static int SETTING_VALUE_OFF = 0; @VisibleForTesting final static int DEBUGGING_ENABLED = 1; @VisibleForTesting final static int DEBUGGING_DISABLED = 0; public NotificationChannelWarningsPreferenceController(Context context) { super(context); Loading @@ -64,9 +60,8 @@ public class NotificationChannelWarningsPreferenceController extends @Override public void updateState(Preference preference) { final int defaultWarningEnabled = isDebuggable() ? DEBUGGING_ENABLED : DEBUGGING_DISABLED; final int mode = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled); Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, 0); ((SwitchPreference) mPreference).setChecked(mode != SETTING_VALUE_OFF); } Loading tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class NotificationChannelWarningsPreferenceControllerTest { } @Test public void updateState_settingUndefinedDebuggingEnabled_preferenceShouldBeChecked() { public void updateState_settingUndefinedDebuggingEnabled_preferenceShouldNotBeChecked() { mController = spy(mController); doReturn(true).when(mController).isDebuggable(); Settings.Global.putString(mContext.getContentResolver(), Loading @@ -110,18 +110,6 @@ public class NotificationChannelWarningsPreferenceControllerTest { mController.updateState(mPreference); verify(mPreference).setChecked(true); } @Test public void updateState_settingUndefinedDebuggingDisabled_preferenceShouldNotBeChecked() { mController = spy(mController); doReturn(false).when(mController).isDebuggable(); Settings.Global.putString(mContext.getContentResolver(), Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, "NotAnInteger"); mController.updateState(mPreference); verify(mPreference).setChecked(false); } Loading Loading
src/com/android/settings/development/NotificationChannelWarningsPreferenceController.java +1 −6 Original line number Diff line number Diff line Loading @@ -38,10 +38,6 @@ public class NotificationChannelWarningsPreferenceController extends final static int SETTING_VALUE_ON = 1; @VisibleForTesting final static int SETTING_VALUE_OFF = 0; @VisibleForTesting final static int DEBUGGING_ENABLED = 1; @VisibleForTesting final static int DEBUGGING_DISABLED = 0; public NotificationChannelWarningsPreferenceController(Context context) { super(context); Loading @@ -64,9 +60,8 @@ public class NotificationChannelWarningsPreferenceController extends @Override public void updateState(Preference preference) { final int defaultWarningEnabled = isDebuggable() ? DEBUGGING_ENABLED : DEBUGGING_DISABLED; final int mode = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled); Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, 0); ((SwitchPreference) mPreference).setChecked(mode != SETTING_VALUE_OFF); } Loading
tests/robotests/src/com/android/settings/development/NotificationChannelWarningsPreferenceControllerTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class NotificationChannelWarningsPreferenceControllerTest { } @Test public void updateState_settingUndefinedDebuggingEnabled_preferenceShouldBeChecked() { public void updateState_settingUndefinedDebuggingEnabled_preferenceShouldNotBeChecked() { mController = spy(mController); doReturn(true).when(mController).isDebuggable(); Settings.Global.putString(mContext.getContentResolver(), Loading @@ -110,18 +110,6 @@ public class NotificationChannelWarningsPreferenceControllerTest { mController.updateState(mPreference); verify(mPreference).setChecked(true); } @Test public void updateState_settingUndefinedDebuggingDisabled_preferenceShouldNotBeChecked() { mController = spy(mController); doReturn(false).when(mController).isDebuggable(); Settings.Global.putString(mContext.getContentResolver(), Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, "NotAnInteger"); mController.updateState(mPreference); verify(mPreference).setChecked(false); } Loading