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

Commit 78996672 authored by Yiwei Zhang's avatar Yiwei Zhang Committed by android-build-merger
Browse files

Merge "GpuStats: move the stats send at Activity launch off UI thread" into...

Merge "GpuStats: move the stats send at Activity launch off UI thread" into qt-dev am: ab9e4629 am: 85eb8e18
am: 94719e5e

Change-Id: I2ace919886986c4e224bc5bd93202809bda38fc8
parents 3a949955 94719e5e
Loading
Loading
Loading
Loading
+15 −11
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@


#include <memory>
#include <memory>
#include <string>
#include <string>
#include <thread>


// TODO(b/37049319) Get this from a header once one exists
// TODO(b/37049319) Get this from a header once one exists
extern "C" {
extern "C" {
@@ -163,6 +164,7 @@ void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path,
void GraphicsEnv::hintActivityLaunch() {
void GraphicsEnv::hintActivityLaunch() {
    ATRACE_CALL();
    ATRACE_CALL();


    std::thread trySendGpuStatsThread([this]() {
        // If there's already graphics driver preloaded in the process, just send
        // If there's already graphics driver preloaded in the process, just send
        // the stats info to GpuStats directly through async binder.
        // the stats info to GpuStats directly through async binder.
        std::lock_guard<std::mutex> lock(mStatsLock);
        std::lock_guard<std::mutex> lock(mStatsLock);
@@ -174,6 +176,8 @@ void GraphicsEnv::hintActivityLaunch() {
            mGpuStats.vkDriverToSend = false;
            mGpuStats.vkDriverToSend = false;
            sendGpuStatsLocked(GraphicsEnv::Api::API_VK, true, mGpuStats.vkDriverLoadingTime);
            sendGpuStatsLocked(GraphicsEnv::Api::API_VK, true, mGpuStats.vkDriverLoadingTime);
        }
        }
    });
    trySendGpuStatsThread.detach();
}
}


void GraphicsEnv::setGpuStats(const std::string& driverPackageName,
void GraphicsEnv::setGpuStats(const std::string& driverPackageName,