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

Commit d786d687 authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

Merge changes from topic "presubmit-am-2355cba6040b4ac28f66e83feb674a33" into...

Merge changes from topic "presubmit-am-2355cba6040b4ac28f66e83feb674a33" into tm-mainline-prod am: 12670f2b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17546797



Change-Id: I18ebac21a0381c3e265b69ecfb48593de09973d6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7155c60d 12670f2b
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -1487,7 +1486,7 @@ public class SystemConfig {
            addFeature(PackageManager.FEATURE_IPSEC_TUNNELS, 0);
        }

        if (isFilesystemSupported("erofs")) {
        if (isErofsSupported()) {
            if (isKernelVersionAtLeast(5, 10)) {
                addFeature(PackageManager.FEATURE_EROFS, 0);
            } else if (isKernelVersionAtLeast(4, 19)) {
@@ -1865,11 +1864,10 @@ public class SystemConfig {
        return Process.myUid() == Process.SYSTEM_UID;
    }

    private static boolean isFilesystemSupported(String fs) {
    private static boolean isErofsSupported() {
        try {
            final byte[] fsTableData = Files.readAllBytes(Paths.get("/proc/filesystems"));
            final String fsTable = new String(fsTableData, StandardCharsets.UTF_8);
            return fsTable.contains("\t" + fs + "\n");
            final Path path = Paths.get("/sys/fs/erofs");
            return Files.exists(path);
        } catch (Exception e) {
            return false;
        }