Expose window type MAGNIFCATION_OVERLAY to AccessibilityService

This window type is for distinguishing the windows used for
magnification. Accessibility apps could move the window magnifier
to follow accessibility focus, but they need to exclude the case that
the focus is on the window magnfier with this information

Bug: 188136191
Test: manual test , will add cts when the public api is ready
Change-Id: Ic2598d25ead5b1d74ebb2c0ea181bfe139675750
This commit is contained in:
ryanlwlin
2021-12-03 18:23:09 +08:00
parent 154e4da68d
commit 53844535aa
3 changed files with 15 additions and 2 deletions

View File

@@ -51779,6 +51779,7 @@ package android.view.accessibility {
field public static final int TYPE_ACCESSIBILITY_OVERLAY = 4; // 0x4
field public static final int TYPE_APPLICATION = 1; // 0x1
field public static final int TYPE_INPUT_METHOD = 2; // 0x2
field public static final int TYPE_MAGNIFICATION_OVERLAY = 6; // 0x6
field public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5; // 0x5
field public static final int TYPE_SYSTEM = 3; // 0x3
}

View File

@@ -84,6 +84,12 @@ public final class AccessibilityWindowInfo implements Parcelable {
*/
public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5;
/**
* Window type: A system window used to show the UI for the interaction with
* window-based magnification, which includes the magnified content and the option menu.
*/
public static final int TYPE_MAGNIFICATION_OVERLAY = 6;
/* Special values for window IDs */
/** @hide */
public static final int ACTIVE_WINDOW_ID = Integer.MAX_VALUE;
@@ -801,6 +807,9 @@ public final class AccessibilityWindowInfo implements Parcelable {
case TYPE_SPLIT_SCREEN_DIVIDER: {
return "TYPE_SPLIT_SCREEN_DIVIDER";
}
case TYPE_MAGNIFICATION_OVERLAY: {
return "TYPE_MAGNIFICATION_OVERLAY";
}
default:
return "<UNKNOWN:" + type + ">";
}

View File

@@ -735,8 +735,7 @@ public class AccessibilityWindowManager {
case WindowManager.LayoutParams.TYPE_SYSTEM_ERROR:
case WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY:
case WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY:
case WindowManager.LayoutParams.TYPE_SCREENSHOT:
case WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY: {
case WindowManager.LayoutParams.TYPE_SCREENSHOT: {
return AccessibilityWindowInfo.TYPE_SYSTEM;
}
@@ -748,6 +747,10 @@ public class AccessibilityWindowManager {
return AccessibilityWindowInfo.TYPE_ACCESSIBILITY_OVERLAY;
}
case WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY: {
return AccessibilityWindowInfo.TYPE_MAGNIFICATION_OVERLAY;
}
default: {
return -1;
}