Read additional_repos.xml from /product as well

Change-Id: Id4a99204e4be467f4e3b1d6684eeb86a19a614f2
This commit is contained in:
Chirayu Desai 2021-06-11 23:54:50 +05:30 committed by Hans-Christoph Steiner
parent 345915cdf4
commit 240b7af585

View File

@ -322,16 +322,16 @@ public class DBHelper extends SQLiteOpenHelper {
/** /**
* Look for additional, initial repositories from the device's filesystem. * Look for additional, initial repositories from the device's filesystem.
* These can be added as part of the ROM ({@code /system} or included later * These can be added as part of the ROM ({@code /system} or {@code /product}
* by vendors/OEMs ({@code /vendor}, {@code /odm}, {@code /oem}). These are * or included later by vendors/OEMs ({@code /vendor}, {@code /odm}, {@code /oem}).
* always added at a lower priority than the repos embedded in the APK via * These are always added at a lower priority than the repos embedded in the APK via
* {@code default_repos.xml}. * {@code default_repos.xml}.
* <p> * <p>
* ROM has the lowest priority, then Vendor, ODM, and OEM. * ROM (System) has the lowest priority, then Product, Vendor, ODM, and OEM.
*/ */
private static List<String> loadAdditionalRepos(String packageName) { private static List<String> loadAdditionalRepos(String packageName) {
List<String> repoItems = new LinkedList<>(); List<String> repoItems = new LinkedList<>();
for (String root : Arrays.asList("/system", "/vendor", "/odm", "/oem")) { for (String root : Arrays.asList("/system", "/product", "/vendor", "/odm", "/oem")) {
File additionalReposFile = new File(root + "/etc/" + packageName + "/additional_repos.xml"); File additionalReposFile = new File(root + "/etc/" + packageName + "/additional_repos.xml");
try { try {
if (additionalReposFile.isFile()) { if (additionalReposFile.isFile()) {