As b/328787031, we make the MagnificationAlwaysOnPreferenceController observe the magnification capabilities then update the preference enabled state. Therefore, when changing the capabilities to window mode only, the preference will become unavailable.
We use the bug-fix flag to verify the fix with rollout process.
Bug: 328787031
Flag: ACONFIG com.android.settings.accessibility.hide_magnification_always_on_toggle_when_window_mode_only DEVELOPMENT
Test: manually flip the flag
atest MagnificationCapabilitiesTest
atest ToggleScreenMagnificationPreferenceFragmentTest
atest MagnificationAlwaysOnPreferenceControllerTest
Change-Id: I1a25f80131d84ecdd927030e40a18ebb32b7862f
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
Hide behind feature flag so no one sees the preference unless its enabled.
Defaults to enabled.
Bug: b/265086261
Test: manual
Change-Id: Ic32353f2b139772fe905137c9ec137925ef6ebb9