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

Commit 5d597c81 authored by Steven Moreland's avatar Steven Moreland Committed by Evelyn Torres
Browse files

PM: Restrict subclass construction.

Don't construct a random class just because you were asked to.

Bug: 373467684
Test: atest PackageParsingPerfTest
Flag: EXEMPT bugfix
(cherry picked from commit 65c1a90b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b6af52a75354b862781c7b46466c3356791c5599)
Merged-In: I328eca7b8de1eab637e3991adeb2e1d147c30268
Change-Id: I328eca7b8de1eab637e3991adeb2e1d147c30268
parent e11c7941
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7776,6 +7776,10 @@ public class PackageParser {
            final ArrayList<T> intentsList;
            try {
                final Class<T> cls = (Class<T>) Class.forName(componentName);
                if (!IntentInfo.class.isAssignableFrom(cls)) {
                    throw new AssertionError("Intent list requires subclass of IntentInfo, not: "
                            + componentName);
                }
                final Constructor<T> cons = cls.getConstructor(Parcel.class);

                intentsList = new ArrayList<>(N);