Loading services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java +20 −18 Original line number Diff line number Diff line Loading @@ -818,7 +818,7 @@ public class AccessibilityWindowManager { } // Don't need to add the embedded hierarchy windows into the accessibility windows list. if (mHostEmbeddedMap.size() > 0 && isEmbeddedHierarchyWindowsLocked(windowId)) { if (isEmbeddedHierarchyWindowsLocked(windowId)) { return null; } final AccessibilityWindowInfo reportedWindow = AccessibilityWindowInfo.obtain(); Loading Loading @@ -866,21 +866,6 @@ public class AccessibilityWindowManager { return reportedWindow; } private boolean isEmbeddedHierarchyWindowsLocked(int windowId) { final IBinder leashToken = mWindowIdMap.get(windowId); if (leashToken == null) { return false; } for (int i = 0; i < mHostEmbeddedMap.size(); i++) { if (mHostEmbeddedMap.keyAt(i).equals(leashToken)) { return true; } } return false; } private int getTypeForWindowManagerWindowType(int windowType) { switch (windowType) { case WindowManager.LayoutParams.TYPE_APPLICATION: Loading Loading @@ -1490,7 +1475,7 @@ public class AccessibilityWindowManager { * @return The windowId of the parent window, or self if no parent exists */ public int resolveParentWindowIdLocked(int windowId) { final IBinder token = getTokenLocked(windowId); final IBinder token = getLeashTokenLocked(windowId); if (token == null) { return windowId; } Loading Loading @@ -2095,7 +2080,7 @@ public class AccessibilityWindowManager { * @param windowId The windowID. * @return The token, or {@code NULL} if this windowID doesn't exist */ IBinder getTokenLocked(int windowId) { IBinder getLeashTokenLocked(int windowId) { return mWindowIdMap.get(windowId); } Loading Loading @@ -2123,6 +2108,23 @@ public class AccessibilityWindowManager { return mHostEmbeddedMap.get(token); } /** * Checks if the window is embedded into another window so that the window should be excluded * from the exposed accessibility windows, and the node tree should be embedded in the host. */ boolean isEmbeddedHierarchyWindowsLocked(int windowId) { if (mHostEmbeddedMap.size() == 0) { return false; } final IBinder leashToken = getLeashTokenLocked(windowId); if (leashToken == null) { return false; } return mHostEmbeddedMap.containsKey(leashToken); } /** * Checks if the window belongs to a proxy display and if so clears the focused window id. * @param focusClearedWindowId the cleared window id. Loading services/tests/servicestests/src/com/android/server/accessibility/AccessibilityWindowManagerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -893,13 +893,13 @@ public class AccessibilityWindowManagerTest { @Test public void getTokenLocked_windowIsRegistered_shouldReturnToken() { final IBinder token = mA11yWindowManager.getTokenLocked(HOST_WINDOW_ID); final IBinder token = mA11yWindowManager.getLeashTokenLocked(HOST_WINDOW_ID); assertEquals(token, mMockHostToken); } @Test public void getTokenLocked_windowIsNotRegistered_shouldReturnNull() { final IBinder token = mA11yWindowManager.getTokenLocked(OTHER_WINDOW_ID); final IBinder token = mA11yWindowManager.getLeashTokenLocked(OTHER_WINDOW_ID); assertNull(token); } Loading Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java +20 −18 Original line number Diff line number Diff line Loading @@ -818,7 +818,7 @@ public class AccessibilityWindowManager { } // Don't need to add the embedded hierarchy windows into the accessibility windows list. if (mHostEmbeddedMap.size() > 0 && isEmbeddedHierarchyWindowsLocked(windowId)) { if (isEmbeddedHierarchyWindowsLocked(windowId)) { return null; } final AccessibilityWindowInfo reportedWindow = AccessibilityWindowInfo.obtain(); Loading Loading @@ -866,21 +866,6 @@ public class AccessibilityWindowManager { return reportedWindow; } private boolean isEmbeddedHierarchyWindowsLocked(int windowId) { final IBinder leashToken = mWindowIdMap.get(windowId); if (leashToken == null) { return false; } for (int i = 0; i < mHostEmbeddedMap.size(); i++) { if (mHostEmbeddedMap.keyAt(i).equals(leashToken)) { return true; } } return false; } private int getTypeForWindowManagerWindowType(int windowType) { switch (windowType) { case WindowManager.LayoutParams.TYPE_APPLICATION: Loading Loading @@ -1490,7 +1475,7 @@ public class AccessibilityWindowManager { * @return The windowId of the parent window, or self if no parent exists */ public int resolveParentWindowIdLocked(int windowId) { final IBinder token = getTokenLocked(windowId); final IBinder token = getLeashTokenLocked(windowId); if (token == null) { return windowId; } Loading Loading @@ -2095,7 +2080,7 @@ public class AccessibilityWindowManager { * @param windowId The windowID. * @return The token, or {@code NULL} if this windowID doesn't exist */ IBinder getTokenLocked(int windowId) { IBinder getLeashTokenLocked(int windowId) { return mWindowIdMap.get(windowId); } Loading Loading @@ -2123,6 +2108,23 @@ public class AccessibilityWindowManager { return mHostEmbeddedMap.get(token); } /** * Checks if the window is embedded into another window so that the window should be excluded * from the exposed accessibility windows, and the node tree should be embedded in the host. */ boolean isEmbeddedHierarchyWindowsLocked(int windowId) { if (mHostEmbeddedMap.size() == 0) { return false; } final IBinder leashToken = getLeashTokenLocked(windowId); if (leashToken == null) { return false; } return mHostEmbeddedMap.containsKey(leashToken); } /** * Checks if the window belongs to a proxy display and if so clears the focused window id. * @param focusClearedWindowId the cleared window id. Loading
services/tests/servicestests/src/com/android/server/accessibility/AccessibilityWindowManagerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -893,13 +893,13 @@ public class AccessibilityWindowManagerTest { @Test public void getTokenLocked_windowIsRegistered_shouldReturnToken() { final IBinder token = mA11yWindowManager.getTokenLocked(HOST_WINDOW_ID); final IBinder token = mA11yWindowManager.getLeashTokenLocked(HOST_WINDOW_ID); assertEquals(token, mMockHostToken); } @Test public void getTokenLocked_windowIsNotRegistered_shouldReturnNull() { final IBinder token = mA11yWindowManager.getTokenLocked(OTHER_WINDOW_ID); final IBinder token = mA11yWindowManager.getLeashTokenLocked(OTHER_WINDOW_ID); assertNull(token); } Loading