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

Commit 6ae8647e authored by Henrik Baard's avatar Henrik Baard Committed by Mattias Nilsson
Browse files

Allow permission pre-grant files on OEM partition

If there are apps on /oem, permission pregrant xmls should
be there too. Remove the old embedded check that stopped
oem pre-grants.

Test: Add pre-grant xml on /oem and check in Settings
Bug: 300042518
Change-Id: Id50c1d77f12734f044b221f80a39f3c253fa51fb
parent d4da63fc
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1480,13 +1480,10 @@ final class DefaultPermissionGrantPolicy {
        if (dir.isDirectory() && dir.canRead()) {
            Collections.addAll(ret, dir.listFiles());
        }
        // For IoT devices, we check the oem partition for default permissions for each app.
        if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED, 0)) {
        dir = new File(Environment.getOemDirectory(), "etc/default-permissions");
        if (dir.isDirectory() && dir.canRead()) {
            Collections.addAll(ret, dir.listFiles());
        }
        }
        return ret.isEmpty() ? null : ret.toArray(new File[0]);
    }