summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/accessibilityservice/AccessibilityService.java24
-rw-r--r--core/java/android/view/WindowManagerInternal.java17
2 files changed, 23 insertions, 18 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 56728ad881e1..8b277b2a12ea 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -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);
diff --git a/core/java/android/view/WindowManagerInternal.java b/core/java/android/view/WindowManagerInternal.java
index 3ad730b08590..4b188c4e35c1 100644
--- a/core/java/android/view/WindowManagerInternal.java
+++ b/core/java/android/view/WindowManagerInternal.java
@@ -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.