Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ShadowMagnificationController for N+ #6140

Merged
merged 1 commit into from Jan 22, 2021
Merged

Add ShadowMagnificationController for N+ #6140

merged 1 commit into from Jan 22, 2021

Conversation

copybara-service[bot]
Copy link

Add ShadowMagnificationController for N+

A single instance of MagnificationController exists per AccessibilityService.
It abstracts over sending commands to the framework over Binder. These commands
allow the client to magnify areas of the screen, and to query if the screen is
currently being magnified.

Before this shadow existed, using MagnificationController from Robolectric
would have no visible effects. i.e., if you were to call .setScale(n, animate)
to modify the magnification scale, then calling .getScale() would not return n:
it would instead return the default scale (1f). This shadow keeps internal
magnification state, so that the APIs behave as expected.

Currently an assumption baked into this code is that only one
AccessibilityService is active at once. This should be a safe assumption in
general, as there are various disadvantages to having multiple services in an
apk (from both the performance perspective, but also from user convenience, as
each service has to be activated separately, from a deeply buried Settings page).

PiperOrigin-RevId: 350651958
@hoisie hoisie merged commit 910b9c7 into master Jan 22, 2021
@hoisie hoisie deleted the piper_350651958 branch January 22, 2021 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant