Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e7689af authored by Gavin Williams's avatar Gavin Williams
Browse files

a11y: Fix autoclick indicator positioning when magnified

When magnification is enabled there becomes two sets of onscreen
coordinates, magnified and non-magnified. This changes guarantees the
indicator remains in the non-magnified space so it'll awlays match the
cursor's actual location.

Screenshot: http://b/393191656#comment2

Bug: b/393191656
Test: AutoclickControllerTest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: Id5d2f1631f5b38b684d5769e901d80acc425a0c7
parent 2a2f062d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -97,7 +97,9 @@ public class AutoclickIndicatorView extends View {
                WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                        | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                        | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
        layoutParams.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
        layoutParams.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS
                | WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION
                | WindowManager.LayoutParams.PRIVATE_FLAG_NOT_MAGNIFIABLE;
        layoutParams.setFitInsetsTypes(WindowInsets.Type.statusBars());
        layoutParams.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        layoutParams.format = PixelFormat.TRANSLUCENT;