Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddc64f3b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correct parsing of application/profileable tag + cts."

parents 61a580cf 50d99e60
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -1704,13 +1704,6 @@ public class PackageParser {
                        minSdkVersion = attrs.getAttributeIntValue(i, DEFAULT_MIN_SDK_VERSION);
                    }
                }
            } else if (TAG_PROFILEABLE.equals(parser.getName())) {
                for (int i = 0; i < attrs.getAttributeCount(); ++i) {
                    final String attr = attrs.getAttributeName(i);
                    if ("shell".equals(attr)) {
                        profilableByShell = attrs.getAttributeBooleanValue(i, profilableByShell);
                    }
                }
            }
        }

+24 −7
Original line number Diff line number Diff line
@@ -398,6 +398,30 @@ public class ApkLiteParseUtils {
                            break;
                    }
                }

                final int innerDepth = parser.getDepth();
                int innerType;
                while ((innerType = parser.next()) != XmlPullParser.END_DOCUMENT
                        && (innerType != XmlPullParser.END_TAG || parser.getDepth() > innerDepth)) {
                    if (innerType == XmlPullParser.END_TAG || innerType == XmlPullParser.TEXT) {
                        continue;
                    }

                    if (parser.getDepth() != innerDepth + 1) {
                        // Search only under <application>.
                        continue;
                    }

                    if (PackageParser.TAG_PROFILEABLE.equals(parser.getName())) {
                        for (int i = 0; i < attrs.getAttributeCount(); ++i) {
                            final String attr = attrs.getAttributeName(i);
                            if ("shell".equals(attr)) {
                                profilableByShell = attrs.getAttributeBooleanValue(i,
                                        profilableByShell);
                            }
                        }
                    }
                }
            } else if (PackageParser.TAG_OVERLAY.equals(parser.getName())) {
                for (int i = 0; i < attrs.getAttributeCount(); ++i) {
                    final String attr = attrs.getAttributeName(i);
@@ -435,13 +459,6 @@ public class ApkLiteParseUtils {
                        minSdkVersion = attrs.getAttributeIntValue(i, DEFAULT_MIN_SDK_VERSION);
                    }
                }
            } else if (PackageParser.TAG_PROFILEABLE.equals(parser.getName())) {
                for (int i = 0; i < attrs.getAttributeCount(); ++i) {
                    final String attr = attrs.getAttributeName(i);
                    if ("shell".equals(attr)) {
                        profilableByShell = attrs.getAttributeBooleanValue(i, profilableByShell);
                    }
                }
            }
        }