Remove unnecessary onDeveloperOptionsSwitchEnabled/Disabled override.
- default implementation has been added in the super class to handle enabling/disabling the preference when the master developer options switch it turned on/off. Removing all subclass that originally implemented the methods that only contains the default behavior. Bug: 73955632 Test: make RunSettingsRoboTests Change-Id: I13c372c2ab498a5786b40cdc1ad3b5f3424abb5a
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.development;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -63,7 +64,7 @@ public class LogPersistPreferenceControllerTest {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mLifecycleOwner = () -> mLifecycle;
|
||||
mLifecycle = new Lifecycle(mLifecycleOwner);
|
||||
mController = new LogPersistPreferenceController(mContext, mFragment, mLifecycle);
|
||||
mController = spy(new LogPersistPreferenceController(mContext, mFragment, mLifecycle));
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
||||
SystemProperties.set("ro.debuggable", "1");
|
||||
mController.displayPreference(mScreen);
|
||||
@@ -75,16 +76,9 @@ public class LogPersistPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onDeveloperOptionsSwitchDisabled_shouldDisablePreference() {
|
||||
public void onDeveloperOptionsSwitchDisabled_shouldResetLogOption() {
|
||||
mController.onDeveloperOptionsSwitchDisabled();
|
||||
|
||||
verify(mPreference).setEnabled(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onDeveloperOptionsSwitchEnabled_shouldEnablePreference() {
|
||||
mController.onDeveloperOptionsSwitchEnabled();
|
||||
|
||||
verify(mPreference).setEnabled(true);
|
||||
verify(mController).writeLogpersistOption(null, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user