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

Commit 3af73158 authored by Isaac Manjarres's avatar Isaac Manjarres Committed by Automerger Merge Worker
Browse files

Merge "ashmem: Remove backwards compatibility for R APEXes running on Q" into...

Merge "ashmem: Remove backwards compatibility for R APEXes running on Q" into main am: 1dc1edfd am: f8805194

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3521631



Change-Id: I803bfa8c7e69278bd0772730d82bada9c9f327cf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4920ec51 f8805194
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -182,20 +182,10 @@ static int __ashmem_open_locked() {
    }

    android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(ashmem_device_path.c_str(), O_RDWR | O_CLOEXEC)));
    int errno1 = errno;
    // fallback for APEX w/ use_vendor on Q, which would have still used /dev/ashmem
    // TODO: remove this?
    if (!fd.ok()) {
        fd.reset(TEMP_FAILURE_RETRY(open("/dev/ashmem", O_RDWR | O_CLOEXEC)));
        int errno2 = errno;
        if (!fd.ok()) {
            /* Q launching devices and newer must not reach here since they should have been
             * able to open ashmem_device_path */
            ALOGE("Unable to open ashmem device %s (%s) and /dev/ashmem (%s)",
                  ashmem_device_path.c_str(), strerror(errno1), strerror(errno2));
        ALOGE("Unable to open ashmem device: %m");
        return -1;
    }
    }

    struct stat st;
    if (TEMP_FAILURE_RETRY(fstat(fd, &st)) == -1) {