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

Commit 6df14b38 authored by Amit Mahajan's avatar Amit Mahajan Committed by Android (Google) Code Review
Browse files

Merge "Allow injection jar to be located in system_ext folder" into rvc-qpr-dev

parents 9cb48120 cd37e57a
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.