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: 141003796
Test: adb shell dumpsys gpu
Change-Id: I2907065a55d03a6c1494737e6f0a77f6e94272eb
Merged-In: I2907065a55d03a6c1494737e6f0a77f6e94272eb
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index 4a39069..bb9e263 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -269,14 +269,14 @@
return interface_cast<IGpuService>(binder);
}
-void GraphicsEnv::setCpuVulkanInUse() {
+void GraphicsEnv::setTargetStats(const Stats stats, const uint64_t value) {
ATRACE_CALL();
- // Use the same stats lock to protect getGpuService() as well.
std::lock_guard<std::mutex> lock(mStatsLock);
const sp<IGpuService> gpuService = getGpuService();
if (gpuService) {
- gpuService->setCpuVulkanInUse(mGpuStats.appPackageName, mGpuStats.driverVersionCode);
+ gpuService->setTargetStats(mGpuStats.appPackageName, mGpuStats.driverVersionCode, stats,
+ value);
}
}