From 512a723aaec6df4d4520637670c317a16a48b20f Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 15 Feb 2019 16:04:41 -0800 Subject: 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 --- libs/graphicsenv/IGpuService.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libs/graphicsenv/IGpuService.cpp') diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp index 2a57caf739..a8a07c2863 100644 --- a/libs/graphicsenv/IGpuService.cpp +++ b/libs/graphicsenv/IGpuService.cpp @@ -29,20 +29,22 @@ public: 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(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 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep 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 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep int64_t driverLoadingTime; if ((status = data.readInt64(&driverLoadingTime)) != OK) return status; - setGpuStats(driverPackageName, driverVersionName, driverVersionCode, appPackageName, - static_cast(driver), isDriverLoaded, + setGpuStats(driverPackageName, driverVersionName, driverVersionCode, driverBuildDate, + appPackageName, static_cast(driver), isDriverLoaded, driverLoadingTime); return OK; -- cgit v1.2.3-59-g8ed1b