Loading services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,11 @@ public class ParsingPackageUtils { public static final int PARSE_CHATTY = 1 << 31; /** The total maximum number of activities, services, providers and activity-aliases */ private static final int MAX_NUM_COMPONENTS = 30000; private static final String MAX_NUM_COMPONENTS_ERR_MSG = "Total number of components has exceeded the maximum number: " + MAX_NUM_COMPONENTS; @IntDef(flag = true, prefix = { "PARSE_" }, value = { PARSE_CHATTY, PARSE_COLLECT_CERTIFICATES, Loading Loading @@ -837,11 +842,20 @@ public class ParsingPackageUtils { if (result.isError()) { return input.error(result); } if (hasTooManyComponents(pkg)) { return input.error(MAX_NUM_COMPONENTS_ERR_MSG); } } return input.success(pkg); } private static boolean hasTooManyComponents(ParsingPackage pkg) { return pkg.getActivities().size() + pkg.getServices().size() + pkg.getProviders().size() > MAX_NUM_COMPONENTS; } /** * For parsing non-MainComponents. Main ones have an order and some special handling which is * done directly in {@link #parseSplitApplication(ParseInput, ParsingPackage, Resources, Loading Loading @@ -2145,6 +2159,9 @@ public class ParsingPackageUtils { if (result.isError()) { return input.error(result); } if (hasTooManyComponents(pkg)) { return input.error(MAX_NUM_COMPONENTS_ERR_MSG); } } if (TextUtils.isEmpty(pkg.getStaticSharedLibName()) && TextUtils.isEmpty( Loading Loading
services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,11 @@ public class ParsingPackageUtils { public static final int PARSE_CHATTY = 1 << 31; /** The total maximum number of activities, services, providers and activity-aliases */ private static final int MAX_NUM_COMPONENTS = 30000; private static final String MAX_NUM_COMPONENTS_ERR_MSG = "Total number of components has exceeded the maximum number: " + MAX_NUM_COMPONENTS; @IntDef(flag = true, prefix = { "PARSE_" }, value = { PARSE_CHATTY, PARSE_COLLECT_CERTIFICATES, Loading Loading @@ -837,11 +842,20 @@ public class ParsingPackageUtils { if (result.isError()) { return input.error(result); } if (hasTooManyComponents(pkg)) { return input.error(MAX_NUM_COMPONENTS_ERR_MSG); } } return input.success(pkg); } private static boolean hasTooManyComponents(ParsingPackage pkg) { return pkg.getActivities().size() + pkg.getServices().size() + pkg.getProviders().size() > MAX_NUM_COMPONENTS; } /** * For parsing non-MainComponents. Main ones have an order and some special handling which is * done directly in {@link #parseSplitApplication(ParseInput, ParsingPackage, Resources, Loading Loading @@ -2145,6 +2159,9 @@ public class ParsingPackageUtils { if (result.isError()) { return input.error(result); } if (hasTooManyComponents(pkg)) { return input.error(MAX_NUM_COMPONENTS_ERR_MSG); } } if (TextUtils.isEmpty(pkg.getStaticSharedLibName()) && TextUtils.isEmpty( Loading