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

Commit 249d1122 authored by Steven Moreland's avatar Steven Moreland Committed by TYM Tsai
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
Change-Id: I328eca7b8de1eab637e3991adeb2e1d147c30268
(cherry picked from commit 65c1a90b)
Merged-In: I328eca7b8de1eab637e3991adeb2e1d147c30268
parent 1ca358e2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7753,6 +7753,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);