From 02296d74d568432999f8dd2a86181722d20d607a Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 17 Jan 2017 09:36:59 -0800 Subject: [PATCH] Fixed check for generated ids on onProvideStructureForAssistOrAutoFill(). BUG: 33197203 Test: CtsAutoFillServiceTestCases passes Change-Id: I7dc45b2f68881e2a718b5d704ff4c3c3e5d9527b --- core/java/android/view/View.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 9d1af5027f72a..37dfdb92996bc 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -6934,8 +6934,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, & (View.AUTO_FILL_FLAG_TYPE_FILL | View.AUTO_FILL_FLAG_TYPE_SAVE)) != 0; final int id = mID; - if (id > 0 && (id&0xff000000) != 0 && (id&0x00ff0000) != 0 - && (id&0x0000ffff) != 0) { + if (id != NO_ID && !isViewIdGenerated(id)) { String pkg, type, entry; try { final Resources res = getResources(); @@ -22640,6 +22639,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } + private static boolean isViewIdGenerated(int id) { + return (id & 0xFF000000) == 0 && (id & 0x00FFFFFF) != 0; + } + /** * Gets the Views in the hierarchy affected by entering and exiting Activity Scene transitions. * @param transitioningViews This View will be added to transitioningViews if it is VISIBLE and