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

Commit 5e93a1ab authored by Michael Hoisie's avatar Michael Hoisie Committed by Automerger Merge Worker
Browse files

Merge "Update libEGL to use android::base properties instead of cutils" into...

Merge "Update libEGL to use android::base properties instead of cutils" into rvc-dev am: 9c6dd35a am: c4661093

Change-Id: If9fc614e309ab678a448613f4bcd17fc7e5897b3
parents ad70246d c4661093
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ cc_defaults {
        "libgraphicsenv",
        "libnativewindow",
        "libbacktrace",
        "libbase",
    ],
    target: {
        vendor: {
+10 −10
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <errno.h>
#include <inttypes.h>

#include <cutils/properties.h>
#include <android-base/properties.h>
#include <log/log.h>
#include <chrono>

@@ -165,7 +165,8 @@ static inline size_t align4(size_t size) {
}

size_t BlobCache::getFlattenedSize() const {
    size_t size = align4(sizeof(Header) + PROPERTY_VALUE_MAX);
    auto buildId = base::GetProperty("ro.build.id", "");
    size_t size = align4(sizeof(Header) + buildId.size());
    for (const CacheEntry& e :  mCacheEntries) {
        std::shared_ptr<Blob> const& keyBlob = e.getKey();
        std::shared_ptr<Blob> const& valueBlob = e.getValue();
@@ -185,9 +186,9 @@ int BlobCache::flatten(void* buffer, size_t size) const {
    header->mBlobCacheVersion = blobCacheVersion;
    header->mDeviceVersion = blobCacheDeviceVersion;
    header->mNumEntries = mCacheEntries.size();
    char buildId[PROPERTY_VALUE_MAX];
    header->mBuildIdLength = property_get("ro.build.id", buildId, "");
    memcpy(header->mBuildId, buildId, header->mBuildIdLength);
    auto buildId = base::GetProperty("ro.build.id", "");
    header->mBuildIdLength = buildId.size();
    memcpy(header->mBuildId, buildId.c_str(), header->mBuildIdLength);

    // Write cache entries
    uint8_t* byteBuffer = reinterpret_cast<uint8_t*>(buffer);
@@ -238,12 +239,11 @@ int BlobCache::unflatten(void const* buffer, size_t size) {
        ALOGE("unflatten: bad magic number: %" PRIu32, header->mMagicNumber);
        return -EINVAL;
    }
    char buildId[PROPERTY_VALUE_MAX];
    int len = property_get("ro.build.id", buildId, "");
    auto buildId = base::GetProperty("ro.build.id", "");
    if (header->mBlobCacheVersion != blobCacheVersion ||
        header->mDeviceVersion != blobCacheDeviceVersion ||
            len != header->mBuildIdLength ||
            strncmp(buildId, header->mBuildId, len)) {
        buildId.size() != header->mBuildIdLength ||
        strncmp(buildId.c_str(), header->mBuildId, buildId.size())) {
        // We treat version mismatches as an empty cache.
        return 0;
    }
+6 −6
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@
#include <dirent.h>
#include <dlfcn.h>

#include <android-base/properties.h>
#include <android/dlext.h>
#include <cutils/properties.h>
#include <log/log.h>
#include <utils/Timers.h>

@@ -241,12 +241,12 @@ void* Loader::open(egl_connection_t* cnx)
        // i.e.:
        //      libGLES_${prop}.so, or:
        //      libEGL_${prop}.so, libGLESv1_CM_${prop}.so, libGLESv2_${prop}.so
        char prop[PROPERTY_VALUE_MAX + 1];
        for (auto key : HAL_SUBNAME_KEY_PROPERTIES) {
            if (property_get(key, prop, nullptr) <= 0) {
            auto prop = base::GetProperty(key, "");
            if (prop.empty()) {
                continue;
            }
            hnd = attempt_to_load_system_driver(cnx, prop, true);
            hnd = attempt_to_load_system_driver(cnx, prop.c_str(), true);
            if (hnd) {
                break;
            } else if (strcmp(key, DRIVER_SUFFIX_PROPERTY) == 0) {
@@ -510,9 +510,9 @@ static void* load_updated_driver(const char* kind, android_namespace_t* ns) {
        .library_namespace = ns,
    };
    void* so = nullptr;
    char prop[PROPERTY_VALUE_MAX + 1];
    for (auto key : HAL_SUBNAME_KEY_PROPERTIES) {
        if (property_get(key, prop, nullptr) <= 0) {
        auto prop = base::GetProperty(key, "");
        if (prop.empty()) {
            continue;
        }
        std::string name = std::string("lib") + kind + "_" + prop + ".so";
+3 −7
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@

#include <EGL/egl.h>

#include <cutils/properties.h>
#include <android-base/properties.h>

#include <log/log.h>

@@ -58,9 +58,7 @@ static int gl_no_context() {
        } else {
            LOG_ALWAYS_FATAL(error);
        }
        char value[PROPERTY_VALUE_MAX];
        property_get("debug.egl.callstack", value, "0");
        if (atoi(value)) {
        if (base::GetBoolProperty("debug.egl.callstack", false)) {
            CallStack::log(LOG_TAG);
        }
    }
@@ -224,9 +222,7 @@ void gl_unimplemented() {
    pthread_mutex_unlock(&sLogPrintMutex);
    if (printLog) {
        ALOGE("called unimplemented OpenGL ES API");
        char value[PROPERTY_VALUE_MAX];
        property_get("debug.egl.callstack", value, "0");
        if (atoi(value)) {
        if (base::GetBoolProperty("debug.egl.callstack", false)) {
            CallStack::log(LOG_TAG);
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#if defined(__ANDROID__)

#include <cutils/properties.h>
#include "Loader.h"
#include "egl_angle_platform.h"

Loading