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

Commit 4b86c078 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Merge "Fix several accessibility magnification issues." into nyc-dev

am: 1f70f0b7

* commit '1f70f0b7':
  Fix several accessibility magnification issues.

Change-Id: I27ff667fd57dcde82ba92342641f2c83e08762be
parents 4c0956d6 1f70f0b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2699,7 +2699,7 @@ package android.accessibilityservice {
    method public void addListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, android.os.Handler);
    method public float getCenterX();
    method public float getCenterY();
    method public android.graphics.Region getMagnifiedRegion();
    method public android.graphics.Region getMagnificationRegion();
    method public float getScale();
    method public boolean removeListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public boolean reset(boolean);
+1 −1
Original line number Diff line number Diff line
@@ -2810,7 +2810,7 @@ package android.accessibilityservice {
    method public void addListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, android.os.Handler);
    method public float getCenterX();
    method public float getCenterY();
    method public android.graphics.Region getMagnifiedRegion();
    method public android.graphics.Region getMagnificationRegion();
    method public float getScale();
    method public boolean removeListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public boolean reset(boolean);
+1 −1
Original line number Diff line number Diff line
@@ -2699,7 +2699,7 @@ package android.accessibilityservice {
    method public void addListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, android.os.Handler);
    method public float getCenterX();
    method public float getCenterY();
    method public android.graphics.Region getMagnifiedRegion();
    method public android.graphics.Region getMagnificationRegion();
    method public float getScale();
    method public boolean removeListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public boolean reset(boolean);
+16 −8
Original line number Diff line number Diff line
@@ -925,18 +925,25 @@ public abstract class AccessibilityService extends Service {
        }

        /**
         * Returns the region of the screen currently being magnified. If
         * magnification is not enabled, the returned region will be empty.
         * Returns the region of the screen currently active for magnification. Changes to
         * magnification scale and center only affect this portion of the screen. The rest of the
         * screen, for example input methods, cannot be magnified. This region is relative to the
         * unscaled screen and is independent of the scale and center point.
         * <p>
         * The returned region will be empty if magnification is not active. Magnification is active
         * if magnification gestures are enabled or if a service is running that can control
         * magnification.
         * <p>
         * <strong>Note:</strong> If the service is not yet connected (e.g.
         * {@link AccessibilityService#onServiceConnected()} has not yet been
         * called) or the service has been disconnected, this method will
         * return an empty region.
         *
         * @return the screen-relative bounds of the magnified region
         * @return the region of the screen currently active for magnification, or an empty region
         * if magnification is not active.
         */
        @NonNull
        public Region getMagnifiedRegion() {
        public Region getMagnificationRegion() {
            final IAccessibilityServiceConnection connection =
                    AccessibilityInteractionClient.getInstance().getConnection(
                            mService.mConnectionId);
@@ -1049,11 +1056,12 @@ public abstract class AccessibilityService extends Service {
             * Called when the magnified region, scale, or center changes.
             *
             * @param controller the magnification controller
             * @param region the new magnified region, may be empty if
             *               magnification is not enabled (e.g. scale is 1)
             * @param region the magnification region
             * @param scale the new scale
             * @param centerX the new X coordinate around which magnification is focused
             * @param centerY the new Y coordinate around which magnification is focused
             * @param centerX the new X coordinate, in unscaled coordinates, around which
             * magnification is focused
             * @param centerY the new Y coordinate, in unscaled coordinates, around which
             * magnification is focused
             */
            void onMagnificationChanged(@NonNull MagnificationController controller,
                    @NonNull Region region, float scale, float centerX, float centerY);
+7 −10
Original line number Diff line number Diff line
@@ -54,13 +54,12 @@ public abstract class WindowManagerInternal {
    public interface MagnificationCallbacks {

        /**
         * Called when the bounds of the screen content that is magnified changed.
         * Note that not the entire screen is magnified.
         * Called when the region where magnification operates changes. Note that this isn't the
         * entire screen. For example, IMEs are not magnified.
         *
         * @param magnifiedBounds the currently magnified region
         * @param availableBounds the region available for magnification
         * @param magnificationRegion the current magnification region
         */
        public void onMagnifiedBoundsChanged(Region magnifiedBounds, Region availableBounds);
        public void onMagnificationRegionChanged(Region magnificationRegion);

        /**
         * Called when an application requests a rectangle on the screen to allow
@@ -158,13 +157,11 @@ public abstract class WindowManagerInternal {
    public abstract void setMagnificationSpec(MagnificationSpec spec);

    /**
     * Obtains the magnified and available regions.
     * Obtains the magnification regions.
     *
     * @param outMagnified the currently magnified region
     * @param outAvailable the region available for magnification
     * @param magnificationRegion the current magnification region
     */
    public abstract void getMagnificationRegions(@NonNull Region outMagnified,
            @NonNull Region outAvailable);
    public abstract void getMagnificationRegion(@NonNull Region magnificationRegion);

    /**
     * Gets the magnification and translation applied to a window given its token.
Loading