• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2024 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 #pragma once
18 
19 #include <map>
20 #include <string>
21 #include <vector>
22 
23 #include <binder/Parcelable.h>
24 
25 namespace android {
26 
27 class FeatureConfig : public Parcelable {
28 public:
29     FeatureConfig() = default;
30     FeatureConfig(const FeatureConfig&) = default;
31     virtual ~FeatureConfig() = default;
32     virtual status_t writeToParcel(Parcel* parcel) const;
33     virtual status_t readFromParcel(const Parcel* parcel);
34     std::string toString() const;
35 
36     std::string mFeatureName;
37     bool mEnabled;
38     std::vector<uint32_t> mGpuVendorIDs;
39 };
40 
41 /*
42  * Class for transporting OpenGL ES Feature configurations from GpuService to authorized
43  * recipients.
44  */
45 class FeatureOverrides : public Parcelable {
46 public:
47     FeatureOverrides() = default;
48     FeatureOverrides(const FeatureOverrides&) = default;
49     virtual ~FeatureOverrides() = default;
50     virtual status_t writeToParcel(Parcel* parcel) const;
51     virtual status_t readFromParcel(const Parcel* parcel);
52     std::string toString() const;
53 
54     std::vector<FeatureConfig> mGlobalFeatures;
55     /* Key: Package Name, Value: Package's Feature Configs */
56     std::map<std::string, std::vector<FeatureConfig>> mPackageFeatures;
57 };
58 
59 } // namespace android
60