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

Commit 85eb8e18 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 qt-dev

am: ab9e4629

Change-Id: I159d94164342644e30ced29c091a3611ec9b0b8a
parents c775e762 ab9e4629
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@

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

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

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

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