Loading core/java/android/util/DebugUtils.java +10 −2 Original line number Diff line number Diff line Loading @@ -219,7 +219,7 @@ public class DebugUtils { && field.getType().equals(int.class) && field.getName().startsWith(prefix)) { try { if (value == field.getInt(null)) { return field.getName().substring(prefix.length()); return constNameWithoutPrefix(prefix, field); } } catch (IllegalAccessException ignored) { } Loading @@ -236,6 +236,7 @@ public class DebugUtils { */ public static String flagsToString(Class<?> clazz, String prefix, int flags) { final StringBuilder res = new StringBuilder(); boolean flagsWasZero = flags == 0; for (Field field : clazz.getDeclaredFields()) { final int modifiers = field.getModifiers(); Loading @@ -243,9 +244,12 @@ public class DebugUtils { && field.getType().equals(int.class) && field.getName().startsWith(prefix)) { try { final int value = field.getInt(null); if (value == 0 && flagsWasZero) { return constNameWithoutPrefix(prefix, field); } if ((flags & value) != 0) { flags &= ~value; res.append(field.getName().substring(prefix.length())).append('|'); res.append(constNameWithoutPrefix(prefix, field)).append('|'); } } catch (IllegalAccessException ignored) { } Loading @@ -258,4 +262,8 @@ public class DebugUtils { } return res.toString(); } private static String constNameWithoutPrefix(String prefix, Field field) { return field.getName().substring(prefix.length()); } } services/core/java/com/android/server/wm/AccessibilityController.java +9 −11 Original line number Diff line number Diff line Loading @@ -1096,10 +1096,7 @@ final class AccessibilityController { // Add windows of certain types not covered by modal windows. if (isReportedWindowType(windowState.mAttrs.type)) { // Add the window to the ones to be reported. WindowInfo window = obtainPopulatedWindowInfo(windowState, boundsInScreen); window.layer = addedWindows.size(); addedWindows.add(window.token); windows.add(window); addPopulatedWindowInfo(windowState, boundsInScreen, windows, addedWindows); if (windowState.isFocused()) { focusedWindowAdded = true; } Loading Loading @@ -1150,10 +1147,8 @@ final class AccessibilityController { computeWindowBoundsInScreen(windowState, boundsInScreen); // Add the window to the ones to be reported. WindowInfo window = obtainPopulatedWindowInfo(windowState, boundsInScreen); addedWindows.add(window.token); windows.add(window); addPopulatedWindowInfo( windowState, boundsInScreen, windows, addedWindows); break; } } Loading Loading @@ -1244,11 +1239,14 @@ final class AccessibilityController { (int) windowFrame.right, (int) windowFrame.bottom); } private static WindowInfo obtainPopulatedWindowInfo( WindowState windowState, Rect boundsInScreen) { private static void addPopulatedWindowInfo( WindowState windowState, Rect boundsInScreen, List<WindowInfo> out, Set<IBinder> tokenOut) { final WindowInfo window = windowState.getWindowInfo(); window.boundsInScreen.set(boundsInScreen); return window; window.layer = tokenOut.size(); out.add(window); tokenOut.add(window.token); } private void cacheWindows(List<WindowInfo> windows) { Loading Loading
core/java/android/util/DebugUtils.java +10 −2 Original line number Diff line number Diff line Loading @@ -219,7 +219,7 @@ public class DebugUtils { && field.getType().equals(int.class) && field.getName().startsWith(prefix)) { try { if (value == field.getInt(null)) { return field.getName().substring(prefix.length()); return constNameWithoutPrefix(prefix, field); } } catch (IllegalAccessException ignored) { } Loading @@ -236,6 +236,7 @@ public class DebugUtils { */ public static String flagsToString(Class<?> clazz, String prefix, int flags) { final StringBuilder res = new StringBuilder(); boolean flagsWasZero = flags == 0; for (Field field : clazz.getDeclaredFields()) { final int modifiers = field.getModifiers(); Loading @@ -243,9 +244,12 @@ public class DebugUtils { && field.getType().equals(int.class) && field.getName().startsWith(prefix)) { try { final int value = field.getInt(null); if (value == 0 && flagsWasZero) { return constNameWithoutPrefix(prefix, field); } if ((flags & value) != 0) { flags &= ~value; res.append(field.getName().substring(prefix.length())).append('|'); res.append(constNameWithoutPrefix(prefix, field)).append('|'); } } catch (IllegalAccessException ignored) { } Loading @@ -258,4 +262,8 @@ public class DebugUtils { } return res.toString(); } private static String constNameWithoutPrefix(String prefix, Field field) { return field.getName().substring(prefix.length()); } }
services/core/java/com/android/server/wm/AccessibilityController.java +9 −11 Original line number Diff line number Diff line Loading @@ -1096,10 +1096,7 @@ final class AccessibilityController { // Add windows of certain types not covered by modal windows. if (isReportedWindowType(windowState.mAttrs.type)) { // Add the window to the ones to be reported. WindowInfo window = obtainPopulatedWindowInfo(windowState, boundsInScreen); window.layer = addedWindows.size(); addedWindows.add(window.token); windows.add(window); addPopulatedWindowInfo(windowState, boundsInScreen, windows, addedWindows); if (windowState.isFocused()) { focusedWindowAdded = true; } Loading Loading @@ -1150,10 +1147,8 @@ final class AccessibilityController { computeWindowBoundsInScreen(windowState, boundsInScreen); // Add the window to the ones to be reported. WindowInfo window = obtainPopulatedWindowInfo(windowState, boundsInScreen); addedWindows.add(window.token); windows.add(window); addPopulatedWindowInfo( windowState, boundsInScreen, windows, addedWindows); break; } } Loading Loading @@ -1244,11 +1239,14 @@ final class AccessibilityController { (int) windowFrame.right, (int) windowFrame.bottom); } private static WindowInfo obtainPopulatedWindowInfo( WindowState windowState, Rect boundsInScreen) { private static void addPopulatedWindowInfo( WindowState windowState, Rect boundsInScreen, List<WindowInfo> out, Set<IBinder> tokenOut) { final WindowInfo window = windowState.getWindowInfo(); window.boundsInScreen.set(boundsInScreen); return window; window.layer = tokenOut.size(); out.add(window); tokenOut.add(window.token); } private void cacheWindows(List<WindowInfo> windows) { Loading