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

Commit 7f6f008e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5301221 from 8381914f to qt-release

Change-Id: I27d45555cbb6bd9fbb7012b964014fd7d2263b34
parents d708fa86 8381914f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -80,8 +80,6 @@ static std::vector<apex::ApexFile> ActivateApexPackages() {
    // system/apex/apexd/apexd_main.cpp.
    //
    // Only scan the APEX directory under /system (within the chroot dir).
    // Note that this leaves around the loop devices created and used by
    // libapexd's code, but this is fine, as we expect to reboot soon after.
    apex::scanPackagesDirAndActivate(apex::kApexPackageSystemDir);
    return apex::getActivePackages();
}
+10 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <sys/cdefs.h>

#include <android/data_space.h>
#include <android/hardware_buffer.h>
#include <android/hdr_metadata.h>
#include <android/native_window.h>
@@ -316,6 +317,15 @@ void ASurfaceTransaction_setBufferAlpha(ASurfaceTransaction* transaction,
                                        ASurfaceControl* surface_control, float alpha)
                                        __INTRODUCED_IN(29);

/**
 * Sets the data space of the surface_control's buffers.
 *
 * If no data space is set, the surface control defaults to ADATASPACE_SRGB.
 */
void ASurfaceTransaction_setBufferDataSpace(ASurfaceTransaction* transaction,
                                            ASurfaceControl* surface_control, ADataSpace data_space)
                                            __INTRODUCED_IN(29);

/*
 * SMPTE ST 2086 "Mastering Display Color Volume" static metadata
 *
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ void BBinder::setRequestingSid(bool requestingSid)
        if (!e) return; // out of memory
    }

    e->mRequestingSid = true;
    e->mRequestingSid = requestingSid;
}

BBinder::~BBinder()
+3 −0
Original line number Diff line number Diff line
@@ -17,14 +17,17 @@ cc_library_shared {

    srcs: [
        "GraphicsEnv.cpp",
        "IGpuService.cpp"
    ],

    cflags: ["-Wall", "-Werror"],

    shared_libs: [
        "libbase",
        "libbinder",
        "libcutils",
        "liblog",
        "libutils",
    ],

    export_include_dirs: ["include"],
+42 −5
Original line number Diff line number Diff line
@@ -14,8 +14,11 @@
 * limitations under the License.
 */

#define ATRACE_TAG ATRACE_TAG_GRAPHICS

//#define LOG_NDEBUG 1
#define LOG_TAG "GraphicsEnv"

#include <graphicsenv/GraphicsEnv.h>

#include <dlfcn.h>
@@ -25,15 +28,16 @@
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android/dlext.h>
#include <binder/IServiceManager.h>
#include <cutils/properties.h>
#include <graphicsenv/IGpuService.h>
#include <log/log.h>
#include <sys/prctl.h>
#include <utils/Trace.h>

#include <memory>
#include <string>

#include <dlfcn.h>

// TODO(b/37049319) Get this from a header once one exists
extern "C" {
android_namespace_t* android_get_exported_namespace(const char*);
@@ -155,9 +159,16 @@ void GraphicsEnv::setDriverPath(const std::string path) {
void GraphicsEnv::setGpuStats(const std::string driverPackageName,
                              const std::string driverVersionName, const uint64_t driverVersionCode,
                              const std::string appPackageName) {
    ALOGV("setGpuStats: drvPkgName[%s], drvVerName[%s], drvVerCode[%lld], appPkgName[%s]",
          driverPackageName.c_str(), driverVersionName.c_str(), (long long)driverVersionCode,
          appPackageName.c_str());
    ATRACE_CALL();

    ALOGV("setGpuStats:\n"
          "\tdriverPackageName[%s]\n"
          "\tdriverVersionName[%s]\n"
          "\tdriverVersionCode[%llu]\n"
          "\tappPackageName[%s]\n",
          driverPackageName.c_str(), driverVersionName.c_str(),
          (unsigned long long)driverVersionCode, appPackageName.c_str());

    mGpuStats = {
            .driverPackageName = driverPackageName,
            .driverVersionName = driverVersionName,
@@ -166,6 +177,32 @@ void GraphicsEnv::setGpuStats(const std::string driverPackageName,
    };
}

void GraphicsEnv::sendGpuStats() {
    ATRACE_CALL();

    // Do not sendGpuStats for those skipping the GraphicsEnvironment setup
    if (mGpuStats.appPackageName.empty()) return;

    ALOGV("sendGpuStats:\n"
          "\tdriverPackageName[%s]\n"
          "\tdriverVersionName[%s]\n"
          "\tdriverVersionCode[%llu]\n"
          "\tappPackageName[%s]\n",
          mGpuStats.driverPackageName.c_str(), mGpuStats.driverVersionName.c_str(),
          (unsigned long long)mGpuStats.driverVersionCode, mGpuStats.appPackageName.c_str());

    const sp<IBinder> binder = defaultServiceManager()->checkService(String16("gpu"));
    if (!binder) {
        ALOGE("Failed to get gpu service for [%s]", mGpuStats.appPackageName.c_str());
        return;
    }

    interface_cast<IGpuService>(binder)->setGpuStats(mGpuStats.driverPackageName,
                                                     mGpuStats.driverVersionName,
                                                     mGpuStats.driverVersionCode,
                                                     mGpuStats.appPackageName);
}

void* GraphicsEnv::loadLibrary(std::string name) {
    const android_dlextinfo dlextinfo = {
            .flags = ANDROID_DLEXT_USE_NAMESPACE,
Loading