chore(magnification): remove onResume overrides for controllers in ToggleScreenMagnificationPreferenceFragment
As b/186731461, so far MagnificationModePreferenceController and other
magnification preference controllers are only used in
ToggleScreenMagnificationPreferenceFragment, which is DashboardFragment.
Since DashboardFragment already updates preference state in its
onResume, so we can remove the onResume overrides in those controllers.
Besides, we can also remove the LifeCycle dependency for the controllers
since it's not used anymore.
Bug: 186731461
Flag: NA
Test: manually
atest ToggleScreenMagnificationPreferenceFragmentTest
atest MagnificationAlwaysOnPreferenceControllerTest
atest MagnificationFollowTypingPreferenceControllerTest
atest MagnificationJoystickPreferenceControllerTest
atest MagnificationModePreferenceControllerTest
Change-Id: I379a6a3a985c9d8b7a37bbb878b84cee1bd6adfb
This commit is contained in:
@@ -47,7 +47,6 @@ import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.utils.AnnotationSpan;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnCreate;
|
||||
import com.android.settingslib.core.lifecycle.events.OnResume;
|
||||
import com.android.settingslib.core.lifecycle.events.OnSaveInstanceState;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -55,7 +54,7 @@ import java.util.List;
|
||||
|
||||
/** Controller that shows the magnification area mode summary and the preference click behavior. */
|
||||
public class MagnificationModePreferenceController extends BasePreferenceController implements
|
||||
DialogCreatable, LifecycleObserver, OnCreate, OnResume, OnSaveInstanceState {
|
||||
DialogCreatable, LifecycleObserver, OnCreate, OnSaveInstanceState {
|
||||
|
||||
static final String PREF_KEY = "screen_magnification_mode";
|
||||
private static final int DIALOG_ID_BASE = 10;
|
||||
@@ -297,12 +296,6 @@ public class MagnificationModePreferenceController extends BasePreferenceControl
|
||||
updateCapabilitiesAndSummary(mModeCache);
|
||||
}
|
||||
|
||||
// TODO(b/186731461): Remove it when this controller is used in DashBoardFragment only.
|
||||
@Override
|
||||
public void onResume() {
|
||||
updateState(mModePreference);
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface to help the delegate to show the dialog. It will be injected to the delegate.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user