Game Driver: plumb driver build date into GpuStats
Driver build date is used to track graphics driver age of the Android
ecosystem. This change also make the binder transaction async so that
both GL and Vulkan loaders won't be blocked by GpuStats module in the
GpuService.
Bug: 123156461
Test: Build, flash and boot. Verify the GpuService receiver side.
Change-Id: I89fd94613da2f5be7c28e5a5f8c3ec653f85cd2a
diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp
index 2a57caf..a8a07c2 100644
--- a/libs/graphicsenv/IGpuService.cpp
+++ b/libs/graphicsenv/IGpuService.cpp
@@ -29,20 +29,22 @@
virtual void setGpuStats(const std::string& driverPackageName,
const std::string& driverVersionName, uint64_t driverVersionCode,
- const std::string& appPackageName, GraphicsEnv::Driver driver,
- bool isDriverLoaded, int64_t driverLoadingTime) {
+ const std::string& driverBuildDate, const std::string& appPackageName,
+ GraphicsEnv::Driver driver, bool isDriverLoaded,
+ int64_t driverLoadingTime) {
Parcel data, reply;
data.writeInterfaceToken(IGpuService::getInterfaceDescriptor());
data.writeUtf8AsUtf16(driverPackageName);
data.writeUtf8AsUtf16(driverVersionName);
data.writeUint64(driverVersionCode);
+ data.writeUtf8AsUtf16(driverBuildDate);
data.writeUtf8AsUtf16(appPackageName);
data.writeInt32(static_cast<int32_t>(driver));
data.writeBool(isDriverLoaded);
data.writeInt64(driverLoadingTime);
- remote()->transact(BnGpuService::SET_GPU_STATS, data, &reply);
+ remote()->transact(BnGpuService::SET_GPU_STATS, data, &reply, IBinder::FLAG_ONEWAY);
}
};
@@ -66,6 +68,9 @@
uint64_t driverVersionCode;
if ((status = data.readUint64(&driverVersionCode)) != OK) return status;
+ std::string driverBuildDate;
+ if ((status = data.readUtf8FromUtf16(&driverBuildDate)) != OK) return status;
+
std::string appPackageName;
if ((status = data.readUtf8FromUtf16(&appPackageName)) != OK) return status;
@@ -78,8 +83,8 @@
int64_t driverLoadingTime;
if ((status = data.readInt64(&driverLoadingTime)) != OK) return status;
- setGpuStats(driverPackageName, driverVersionName, driverVersionCode, appPackageName,
- static_cast<GraphicsEnv::Driver>(driver), isDriverLoaded,
+ setGpuStats(driverPackageName, driverVersionName, driverVersionCode, driverBuildDate,
+ appPackageName, static_cast<GraphicsEnv::Driver>(driver), isDriverLoaded,
driverLoadingTime);
return OK;