[MainSwitchPreference] Remove SettingsMainSwitchPreferenceController

NO_IFTTT=Update base class

Bug: 401406987
Flag: EXEMPT refactor
Test: manual
Change-Id: I68093366f63fa5b4184aa7b3dde8bc2609f17dfb
This commit is contained in:
Jacky Wang
2025-03-07 22:51:57 +08:00
parent 7867f29788
commit 6f684c73e0
11 changed files with 55 additions and 95 deletions

View File

@@ -31,7 +31,6 @@ import static org.mockito.Mockito.when;
import android.app.ActivityManager;
import android.content.Context;
import android.provider.Settings;
import android.widget.Switch;
import androidx.preference.PreferenceScreen;
import androidx.test.core.app.ApplicationProvider;
@@ -66,9 +65,6 @@ public class BubbleNotificationPreferenceControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private PreferenceScreen mScreen;
@Mock
private Switch mSwitch;
private BubbleNotificationPreferenceController mController;
private MainSwitchPreference mPreference;
@@ -113,7 +109,7 @@ public class BubbleNotificationPreferenceControllerTest {
public void onSwitchChanged_true_settingIsOff_flagShouldOn() {
Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, OFF);
mController.onCheckedChanged(mSwitch, true);
mController.setChecked(true);
assertThat(Settings.Global.getInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, OFF)).isEqualTo(ON);
@@ -123,7 +119,7 @@ public class BubbleNotificationPreferenceControllerTest {
public void onSwitchChanged_false_settingIsOn_flagShouldOff() {
Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, ON);
mController.onCheckedChanged(mSwitch, false);
mController.setChecked(false);
assertThat(Settings.Global.getInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, ON)).isEqualTo(OFF);