blob: 5304fa127966383b9fa0b53d5dc513c04533d1a7 [file] [log] [blame]
Jesse Hallfc038bd2016-03-26 22:20:22 -07001/*
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 Zhangcb9d4e42019-02-06 20:22:59 -080022#include <graphicsenv/IGpuService.h>
23
24#include <mutex>
25#include <vector>
Jesse Hallfc038bd2016-03-26 22:20:22 -070026
27namespace android {
28
Peiyong Lin2c37e202018-11-01 10:34:57 -070029class GpuService : public BnGpuService {
Jesse Hallfc038bd2016-03-26 22:20:22 -070030public:
31 static const char* const SERVICE_NAME ANDROID_API;
32
33 GpuService() ANDROID_API;
34
35protected:
Yiwei Zhangcb9d4e42019-02-06 20:22:59 -080036 status_t shellCommand(int in, int out, int err, std::vector<String16>& args) override;
37
38private:
39 // IGpuService interface
Greg Kaiser210bb7e2019-02-12 12:40:05 -080040 void setGpuStats(const std::string& driverPackageName, const std::string& driverVersionName,
41 const uint64_t driverVersionCode, const std::string& appPackageName);
Yiwei Zhangcb9d4e42019-02-06 20:22:59 -080042
43 // GpuStats access must be protected by mStateLock
44 std::mutex mStateLock;
Jesse Hallfc038bd2016-03-26 22:20:22 -070045};
46
47} // namespace android
48
49#endif // ANDROID_GPUSERVICE_H