From 9f6f9ca935befddea4674d2490d5cc198a98dc55 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Thu, 11 Apr 2019 16:50:12 -0700 Subject: [PATCH] Fix RelativeLayout checking of resource ids greater than 0x80 For splits with package id 0x80 and higher, the resource ids are negative. RelativeLayout builds a dependency graph to indicate in which order the layout height and width need to be processed. Since the ids are less than 0, RelativeLayout is incorrectly assuming the layouts are not order dependent. Bug: 72869300 Test: manual Change-Id: I98f58f11733c2976fc5c1b4152949cf80660f657 --- core/java/android/widget/RelativeLayout.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index 37bed6538a26b..4c32f03f6cb35 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -21,6 +21,7 @@ import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; import android.annotation.NonNull; import android.annotation.UnsupportedAppUsage; import android.content.Context; +import android.content.res.ResourceId; import android.content.res.TypedArray; import android.graphics.Rect; import android.os.Build; @@ -1991,7 +1992,7 @@ public class RelativeLayout extends ViewGroup { // dependencies for a specific set of rules for (int j = 0; j < rulesCount; j++) { final int rule = rules[rulesFilter[j]]; - if (rule > 0) { + if (ResourceId.isValid(rule)) { // The node this node depends on final Node dependency = keyNodes.get(rule); // Skip unknowns and self dependencies