Commit Graph

2 Commits

Author SHA1 Message Date
Daniel Hsieh
55bc49860b Refactor SettingsContentObserver and add it to follow typing feature.
Refactor SettingsContentObserver and rename it to
AccessibilitySettingsContentObserver. Besides, we register it to observe
follow typing feature preference value.

The reasons behind refactor:
1. We change callback signature due to the consistency for register it
by preference key, not by Uri.
2. We refactor the default preference key to a seperate method. Since
the default value is related to accessibility, we rename it with
accessibility prefix.
3. We can register different callback for difference collections of
preference keys.

Default preference keys: They existed in the previous constructor.
1. Settings.Secure.ACCESSIBILITY_ENABLED
2. Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
           AccessibilitySettingsTest
           AccessibilitySettingsContentObserverTest
           AccessibilityShortcutPreferenceFragmentTest
           MagnificationFollowTypingPreferenceControllerTest
           ToggleFeaturePreferenceFragmentTest
           ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Iafd27e044ebe2536ae7ae55c1c80af54f7f0f822
2022-01-20 08:38:27 +00:00
Daniel Hsieh
6f4fb88538 Support following typing focus in window mode [3/n].
There are 3 milestones in this feature.
1. Refactor the callbacks for Accessibility in WindowManagerInternal.
2. Implement this feature in such new architecture.
3. Implement the setting choice in preference page.

This CL is for the 3rd milestone.

We add a preference key "magnification_follow_typing" to access and
update the ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED value
which controls its corresponding preference page UI.

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
	MagnificationFollowTypingPreferenceControllerTest
	ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Ib2602c997a535c1acca6a7ddd7bb2c25921f9280
2022-01-14 07:11:05 +00:00