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

Commit df99853b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Allow injection jar to be located in system_ext folder"

parents b20630b9 f1778fc7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -81,6 +81,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;
@@ -90,7 +91,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() {
@@ -99,7 +100,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.