Loading core/java/android/view/View.java +16 −3 Original line number Diff line number Diff line Loading @@ -2904,7 +2904,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.FlagToString(mask = PFLAG_DRAWN, equals = PFLAG_DRAWN, name = "NOT_DRAWN", outputIf = false), @ViewDebug.FlagToString(mask = PFLAG_DIRTY_MASK, equals = PFLAG_DIRTY_OPAQUE, name = "DIRTY_OPAQUE"), @ViewDebug.FlagToString(mask = PFLAG_DIRTY_MASK, equals = PFLAG_DIRTY, name = "DIRTY") }) }, formatToHexString = true) int mPrivateFlags; int mPrivateFlags2; int mPrivateFlags3; Loading @@ -2923,7 +2923,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.FlagToString(mask = PUBLIC_STATUS_BAR_VISIBILITY_MASK, equals = SYSTEM_UI_FLAG_VISIBLE, name = "SYSTEM_UI_FLAG_VISIBLE", outputIf = true) }) }, formatToHexString = true) int mSystemUiVisibility; /** Loading @@ -2949,7 +2949,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * The view flags hold various views states. * {@hide} */ @ViewDebug.ExportedProperty @ViewDebug.ExportedProperty(formatToHexString = true) int mViewFlags; static class TransformationInfo { Loading Loading @@ -16457,6 +16457,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * @hide */ @ViewDebug.ExportedProperty(category = "layout", indexMapping = { @ViewDebug.IntToString(from = 0, to = "x"), @ViewDebug.IntToString(from = 1, to = "y") }) public int[] getLocationOnScreen() { int[] location = new int[2]; getLocationOnScreen(location); return location; } /** * <p>Computes the coordinates of this view on the screen. The argument * must be an array of two integers. After the method returns, the array core/java/android/view/ViewDebug.java +100 −81 Original line number Diff line number Diff line Loading @@ -180,6 +180,13 @@ public class ViewDebug { * @return the category as String */ String category() default ""; /** * Indicates whether or not to format an {@code int} or {@code byte} value as a hex string. * * @return true if the supported values should be formatted as a hex string. */ boolean formatToHexString() default false; } /** Loading Loading @@ -1041,6 +1048,10 @@ public class ViewDebug { } } private static String formatIntToHexString(int value) { return "0x" + Integer.toHexString(value).toUpperCase(); } private static void exportMethods(Context context, Object view, BufferedWriter out, Class<?> klass, String prefix) throws IOException { Loading @@ -1058,7 +1069,6 @@ public class ViewDebug { property.category().length() != 0 ? property.category() + ":" : ""; if (returnType == int.class) { if (property.resolveId() && context != null) { final int id = (Integer) methodValue; methodValue = resolveId(context, id); Loading Loading @@ -1160,6 +1170,15 @@ public class ViewDebug { fieldValue = intValue; } } if (property.formatToHexString()) { fieldValue = field.get(view); if (type == int.class) { fieldValue = formatIntToHexString((Integer) fieldValue); } else if (type == byte.class) { fieldValue = "0x" + Byte.toHexString((Byte) fieldValue, true); } } } } else if (type == int[].class) { final int[] array = (int[]) field.get(view); Loading Loading @@ -1210,7 +1229,7 @@ public class ViewDebug { final boolean test = maskResult == flagMapping.equals(); if ((test && ifTrue) || (!test && !ifTrue)) { final String name = flagMapping.name(); final String value = "0x" + Integer.toHexString(maskResult); final String value = formatIntToHexString(maskResult); writeEntry(out, prefix, name, "", value); } } Loading Loading @@ -1276,7 +1295,7 @@ public class ViewDebug { fieldValue = resources.getResourceTypeName(id) + '/' + resources.getResourceEntryName(id); } catch (Resources.NotFoundException e) { fieldValue = "id/0x" + Integer.toHexString(id); fieldValue = "id/" + formatIntToHexString(id); } } else { fieldValue = "NO_ID"; Loading core/java/android/view/ViewGroup.java +2 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager name = "CLIP_TO_PADDING"), @ViewDebug.FlagToString(mask = FLAG_PADDING_NOT_NULL, equals = FLAG_PADDING_NOT_NULL, name = "PADDING_NOT_NULL") }) }, formatToHexString = true) protected int mGroupFlags; /** Loading Loading @@ -6430,7 +6430,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager equals = RTL_COMPATIBILITY_MODE_MASK, name = "RTL_COMPATIBILITY_MODE_MASK"), @ViewDebug.FlagToString(mask = NEED_RESOLUTION_MASK, equals = NEED_RESOLUTION_MASK, name = "NEED_RESOLUTION_MASK") }) }, formatToHexString = true) byte mMarginFlags; private static final int LAYOUT_DIRECTION_MASK = 0x00000003; Loading core/java/android/view/WindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1020,7 +1020,7 @@ public interface WindowManager extends ViewManager { name = "FLAG_TRANSLUCENT_NAVIGATION"), @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS") }) }, formatToHexString = true) public int flags; /** Loading core/java/android/widget/LinearLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class LinearLayout extends ViewGroup { equals = Gravity.FILL, name = "FILL"), @ViewDebug.FlagToString(mask = Gravity.RELATIVE_LAYOUT_DIRECTION, equals = Gravity.RELATIVE_LAYOUT_DIRECTION, name = "RELATIVE") }) }, formatToHexString = true) private int mGravity = Gravity.START | Gravity.TOP; @ViewDebug.ExportedProperty(category = "measurement") Loading Loading
core/java/android/view/View.java +16 −3 Original line number Diff line number Diff line Loading @@ -2904,7 +2904,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.FlagToString(mask = PFLAG_DRAWN, equals = PFLAG_DRAWN, name = "NOT_DRAWN", outputIf = false), @ViewDebug.FlagToString(mask = PFLAG_DIRTY_MASK, equals = PFLAG_DIRTY_OPAQUE, name = "DIRTY_OPAQUE"), @ViewDebug.FlagToString(mask = PFLAG_DIRTY_MASK, equals = PFLAG_DIRTY, name = "DIRTY") }) }, formatToHexString = true) int mPrivateFlags; int mPrivateFlags2; int mPrivateFlags3; Loading @@ -2923,7 +2923,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.FlagToString(mask = PUBLIC_STATUS_BAR_VISIBILITY_MASK, equals = SYSTEM_UI_FLAG_VISIBLE, name = "SYSTEM_UI_FLAG_VISIBLE", outputIf = true) }) }, formatToHexString = true) int mSystemUiVisibility; /** Loading @@ -2949,7 +2949,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * The view flags hold various views states. * {@hide} */ @ViewDebug.ExportedProperty @ViewDebug.ExportedProperty(formatToHexString = true) int mViewFlags; static class TransformationInfo { Loading Loading @@ -16457,6 +16457,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * @hide */ @ViewDebug.ExportedProperty(category = "layout", indexMapping = { @ViewDebug.IntToString(from = 0, to = "x"), @ViewDebug.IntToString(from = 1, to = "y") }) public int[] getLocationOnScreen() { int[] location = new int[2]; getLocationOnScreen(location); return location; } /** * <p>Computes the coordinates of this view on the screen. The argument * must be an array of two integers. After the method returns, the array
core/java/android/view/ViewDebug.java +100 −81 Original line number Diff line number Diff line Loading @@ -180,6 +180,13 @@ public class ViewDebug { * @return the category as String */ String category() default ""; /** * Indicates whether or not to format an {@code int} or {@code byte} value as a hex string. * * @return true if the supported values should be formatted as a hex string. */ boolean formatToHexString() default false; } /** Loading Loading @@ -1041,6 +1048,10 @@ public class ViewDebug { } } private static String formatIntToHexString(int value) { return "0x" + Integer.toHexString(value).toUpperCase(); } private static void exportMethods(Context context, Object view, BufferedWriter out, Class<?> klass, String prefix) throws IOException { Loading @@ -1058,7 +1069,6 @@ public class ViewDebug { property.category().length() != 0 ? property.category() + ":" : ""; if (returnType == int.class) { if (property.resolveId() && context != null) { final int id = (Integer) methodValue; methodValue = resolveId(context, id); Loading Loading @@ -1160,6 +1170,15 @@ public class ViewDebug { fieldValue = intValue; } } if (property.formatToHexString()) { fieldValue = field.get(view); if (type == int.class) { fieldValue = formatIntToHexString((Integer) fieldValue); } else if (type == byte.class) { fieldValue = "0x" + Byte.toHexString((Byte) fieldValue, true); } } } } else if (type == int[].class) { final int[] array = (int[]) field.get(view); Loading Loading @@ -1210,7 +1229,7 @@ public class ViewDebug { final boolean test = maskResult == flagMapping.equals(); if ((test && ifTrue) || (!test && !ifTrue)) { final String name = flagMapping.name(); final String value = "0x" + Integer.toHexString(maskResult); final String value = formatIntToHexString(maskResult); writeEntry(out, prefix, name, "", value); } } Loading Loading @@ -1276,7 +1295,7 @@ public class ViewDebug { fieldValue = resources.getResourceTypeName(id) + '/' + resources.getResourceEntryName(id); } catch (Resources.NotFoundException e) { fieldValue = "id/0x" + Integer.toHexString(id); fieldValue = "id/" + formatIntToHexString(id); } } else { fieldValue = "NO_ID"; Loading
core/java/android/view/ViewGroup.java +2 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager name = "CLIP_TO_PADDING"), @ViewDebug.FlagToString(mask = FLAG_PADDING_NOT_NULL, equals = FLAG_PADDING_NOT_NULL, name = "PADDING_NOT_NULL") }) }, formatToHexString = true) protected int mGroupFlags; /** Loading Loading @@ -6430,7 +6430,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager equals = RTL_COMPATIBILITY_MODE_MASK, name = "RTL_COMPATIBILITY_MODE_MASK"), @ViewDebug.FlagToString(mask = NEED_RESOLUTION_MASK, equals = NEED_RESOLUTION_MASK, name = "NEED_RESOLUTION_MASK") }) }, formatToHexString = true) byte mMarginFlags; private static final int LAYOUT_DIRECTION_MASK = 0x00000003; Loading
core/java/android/view/WindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1020,7 +1020,7 @@ public interface WindowManager extends ViewManager { name = "FLAG_TRANSLUCENT_NAVIGATION"), @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS") }) }, formatToHexString = true) public int flags; /** Loading
core/java/android/widget/LinearLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class LinearLayout extends ViewGroup { equals = Gravity.FILL, name = "FILL"), @ViewDebug.FlagToString(mask = Gravity.RELATIVE_LAYOUT_DIRECTION, equals = Gravity.RELATIVE_LAYOUT_DIRECTION, name = "RELATIVE") }) }, formatToHexString = true) private int mGravity = Gravity.START | Gravity.TOP; @ViewDebug.ExportedProperty(category = "measurement") Loading