Loading services/gpuservice/GpuService.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -75,11 +75,23 @@ void GpuService::setTargetStats(const std::string& appPackageName, const uint64_ } void GpuService::setUpdatableDriverPath(const std::string& driverPath) { developerDriverPath = driverPath; IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); // only system_server is allowed to set updatable driver path if (uid != AID_SYSTEM) { ALOGE("Permission Denial: can't set updatable driver path from pid=%d, uid=%d\n", pid, uid); return; } std::lock_guard<std::mutex> lock(mLock); mDeveloperDriverPath = driverPath; } std::string GpuService::getUpdatableDriverPath() { return developerDriverPath; std::lock_guard<std::mutex> lock(mLock); return mDeveloperDriverPath; } status_t GpuService::shellCommand(int /*in*/, int out, int err, std::vector<String16>& args) { Loading services/gpuservice/GpuService.h +2 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ private: std::shared_ptr<GpuMem> mGpuMem; std::unique_ptr<GpuStats> mGpuStats; std::unique_ptr<GpuMemTracer> mGpuMemTracer; std::string developerDriverPath; std::mutex mLock; std::string mDeveloperDriverPath; }; } // namespace android Loading Loading
services/gpuservice/GpuService.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -75,11 +75,23 @@ void GpuService::setTargetStats(const std::string& appPackageName, const uint64_ } void GpuService::setUpdatableDriverPath(const std::string& driverPath) { developerDriverPath = driverPath; IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); // only system_server is allowed to set updatable driver path if (uid != AID_SYSTEM) { ALOGE("Permission Denial: can't set updatable driver path from pid=%d, uid=%d\n", pid, uid); return; } std::lock_guard<std::mutex> lock(mLock); mDeveloperDriverPath = driverPath; } std::string GpuService::getUpdatableDriverPath() { return developerDriverPath; std::lock_guard<std::mutex> lock(mLock); return mDeveloperDriverPath; } status_t GpuService::shellCommand(int /*in*/, int out, int err, std::vector<String16>& args) { Loading
services/gpuservice/GpuService.h +2 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ private: std::shared_ptr<GpuMem> mGpuMem; std::unique_ptr<GpuStats> mGpuStats; std::unique_ptr<GpuMemTracer> mGpuMemTracer; std::string developerDriverPath; std::mutex mLock; std::string mDeveloperDriverPath; }; } // namespace android Loading