Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_GPUSERVICE_H |
| 18 | #define ANDROID_GPUSERVICE_H |
| 19 | |
| 20 | #include <binder/IInterface.h> |
| 21 | #include <cutils/compiler.h> |
Yiwei Zhang | cb9d4e4 | 2019-02-06 20:22:59 -0800 | [diff] [blame^] | 22 | #include <graphicsenv/IGpuService.h> |
| 23 | |
| 24 | #include <mutex> |
| 25 | #include <vector> |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 26 | |
| 27 | namespace android { |
| 28 | |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 29 | class GpuService : public BnGpuService { |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 30 | public: |
| 31 | static const char* const SERVICE_NAME ANDROID_API; |
| 32 | |
| 33 | GpuService() ANDROID_API; |
| 34 | |
| 35 | protected: |
Yiwei Zhang | cb9d4e4 | 2019-02-06 20:22:59 -0800 | [diff] [blame^] | 36 | status_t shellCommand(int in, int out, int err, std::vector<String16>& args) override; |
| 37 | |
| 38 | private: |
| 39 | // IGpuService interface |
| 40 | void setGpuStats(const std::string driverPackageName, const std::string driverVersionName, |
| 41 | const uint64_t driverVersionCode, const std::string appPackageName); |
| 42 | |
| 43 | // GpuStats access must be protected by mStateLock |
| 44 | std::mutex mStateLock; |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } // namespace android |
| 48 | |
| 49 | #endif // ANDROID_GPUSERVICE_H |