@@ -1324,21 +1324,7 @@ static jboolean android_content_AssetManager_applyStyle(JNIEnv* env, jobject cla
13241324 config.density = 0 ;
13251325
13261326 // Skip through XML attributes until the end or the next possible match.
1327- // We make two assumptions about the order of attributes:
1328- // 1) Among attributes with the same package ID, the attributes are
1329- // sorted by increasing resource ID.
1330- // 2) Groups of attributes with the same package ID are in the same
1331- // order.
1332- // 3) The same sorting is applied to the input attributes as is
1333- // to the attributes in the XML.
1334- //
1335- // ex: 02010000, 02010001, 010100f4, 010100f5
1336- //
1337- // The total order of attributes (including package ID) can not be linear
1338- // as shared libraries get assigned dynamic package IDs at runtime, which
1339- // may break the sort order established at build time.
1340- while (ix < NX && (Res_GETPACKAGE (curIdent) != Res_GETPACKAGE (curXmlAttr) ||
1341- curIdent > curXmlAttr)) {
1327+ while (ix < NX && curIdent > curXmlAttr) {
13421328 ix++;
13431329 curXmlAttr = xmlParser->getAttributeNameResID (ix);
13441330 }
@@ -1353,9 +1339,7 @@ static jboolean android_content_AssetManager_applyStyle(JNIEnv* env, jobject cla
13531339 }
13541340
13551341 // Skip through the style values until the end or the next possible match.
1356- while (styleEnt < endStyleEnt &&
1357- (Res_GETPACKAGE (curIdent) != Res_GETPACKAGE (styleEnt->map .name .ident ) ||
1358- curIdent > styleEnt->map .name .ident )) {
1342+ while (styleEnt < endStyleEnt && curIdent > styleEnt->map .name .ident ) {
13591343 styleEnt++;
13601344 }
13611345 // Retrieve the current style attribute if it matches, and step to next.
@@ -1371,9 +1355,7 @@ static jboolean android_content_AssetManager_applyStyle(JNIEnv* env, jobject cla
13711355 }
13721356
13731357 // Skip through the default style values until the end or the next possible match.
1374- while (defStyleEnt < endDefStyleEnt &&
1375- (Res_GETPACKAGE (curIdent) != Res_GETPACKAGE (defStyleEnt->map .name .ident ) ||
1376- curIdent > defStyleEnt->map .name .ident )) {
1358+ while (defStyleEnt < endDefStyleEnt && curIdent > defStyleEnt->map .name .ident ) {
13771359 defStyleEnt++;
13781360 }
13791361 // Retrieve the current default style attribute if it matches, and step to next.
@@ -1535,8 +1517,7 @@ static jboolean android_content_AssetManager_retrieveAttributes(JNIEnv* env, job
15351517 config.density = 0 ;
15361518
15371519 // Skip through XML attributes until the end or the next possible match.
1538- while (ix < NX && (Res_GETPACKAGE (curIdent) != Res_GETPACKAGE (curXmlAttr) ||
1539- curIdent > curXmlAttr)) {
1520+ while (ix < NX && curIdent > curXmlAttr) {
15401521 ix++;
15411522 curXmlAttr = xmlParser->getAttributeNameResID (ix);
15421523 }
0 commit comments