From bcba4117941a0506971654331d89961b6fbfd3c0 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 3 Jul 2019 13:39:32 -0700 Subject: GpuStats: refactor single stats pieces into a uniform way This change makes it easy for adding single stats pieces into GpuService without adding or modifying the binder interface each time. Bug: 135210726 Test: adb shell dumpsys gpu Change-Id: I2907065a55d03a6c1494737e6f0a77f6e94272eb --- libs/graphicsenv/GraphicsEnv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/graphicsenv/GraphicsEnv.cpp') diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index a411dd56f6..c5d5f71800 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -267,14 +267,14 @@ static sp getGpuService() { return interface_cast(binder); } -void GraphicsEnv::setCpuVulkanInUse() { +void GraphicsEnv::setTargetStats(const GpuStatsInfo::Stats stats, const uint64_t value) { ATRACE_CALL(); - // Use the same stats lock to protect getGpuService() as well. std::lock_guard lock(mStatsLock); const sp gpuService = getGpuService(); if (gpuService) { - gpuService->setCpuVulkanInUse(mGpuStats.appPackageName, mGpuStats.driverVersionCode); + gpuService->setTargetStats(mGpuStats.appPackageName, mGpuStats.driverVersionCode, stats, + value); } } -- cgit v1.2.3-59-g8ed1b