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

Commit 24694c39 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Allow injection jar to be located in system_ext folder" am: df99853b...

Merge "Allow injection jar to be located in system_ext folder" am: df99853b am: 5346a798 am: cba2d4d2 am: 314e8c9d

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1402367

Change-Id: Id34add4c5653806b260f95b5dc43a92e2ecdbc29
parents dbbbafff 314e8c9d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class TelephonyComponentFactory {
        private static final String TAG_COMPONENT = "component";
        private static final String SYSTEM = "/system/";
        private static final String PRODUCT = "/product/";
        private static final String SYSTEM_EXT = "/system_ext/";

        private final Set<String> mComponentNames = new HashSet<>();
        private TelephonyComponentFactory mInjectedInstance;
@@ -88,7 +89,7 @@ public class TelephonyComponentFactory {
        /**
         * @return paths correctly configured to inject.
         * 1) PackageName and JarPath mustn't be empty.
         * 2) JarPath is restricted under /system or /product only.
         * 2) JarPath is restricted under /system or /product or /system_ext only.
         * 3) JarPath is on a READ-ONLY partition.
         */
        private @Nullable String getValidatedPaths() {
@@ -97,7 +98,8 @@ public class TelephonyComponentFactory {
            }
            // filter out invalid paths
            return Arrays.stream(mJarPath.split(File.pathSeparator))
                    .filter(s -> (s.startsWith(SYSTEM) || s.startsWith(PRODUCT)))
                    .filter(s -> (s.startsWith(SYSTEM) || s.startsWith(PRODUCT)
                            || s.startsWith(SYSTEM_EXT)))
                    .filter(s -> {
                        try {
                            // This will also throw an error if the target doesn't exist.