• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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 #include <vintf/Level.h>
18 #include <vintf/Version.h>
19 #include <vintf/VersionRange.h>
20 #include <vintf/constants.h>
21 
22 namespace android {
23 namespace vintf {
24 namespace details {
25 
26 // All <version> tags in <hal format="aidl"> tags are ignored, and an implicit version
27 // is inserted so that compatibility checks for different HAL formats can be unified.
28 // This is an implementation detail of libvintf and won't be written to actual XML files.
29 // 0.0 is not used because FQName / FqInstance consider it an invalid value.
30 static constexpr size_t kFakeAidlMajorVersion = SIZE_MAX;
31 static constexpr VersionRange kDefaultAidlVersionRange{kFakeAidlMajorVersion,
32                                                        kDefaultAidlMinorVersion};
33 static constexpr Version kDefaultAidlVersion = kDefaultAidlVersionRange.minVer();
34 
35 #define SYSTEM_VINTF_DIR "/system/etc/vintf/"
36 constexpr const char* kSystemVintfDir = SYSTEM_VINTF_DIR;
37 #define VENDOR_VINTF_DIR "/vendor/etc/vintf/"
38 constexpr const char* kVendorVintfDir = VENDOR_VINTF_DIR;
39 #define ODM_VINTF_DIR "/odm/etc/vintf/"
40 constexpr const char* kOdmVintfDir = ODM_VINTF_DIR;
41 #define PRODUCT_VINTF_DIR "/product/etc/vintf/"
42 constexpr const char* kProductVintfDir = PRODUCT_VINTF_DIR;
43 #define SYSTEM_EXT_VINTF_DIR "/system_ext/etc/vintf/"
44 constexpr const char* kSystemExtVintfDir = SYSTEM_EXT_VINTF_DIR;
45 
46 constexpr const char* kVendorManifest = VENDOR_VINTF_DIR "manifest.xml";
47 constexpr const char* kSystemManifest = SYSTEM_VINTF_DIR "manifest.xml";
48 constexpr const char* kVendorMatrix = VENDOR_VINTF_DIR "compatibility_matrix.xml";
49 constexpr const char* kOdmManifest = ODM_VINTF_DIR "manifest.xml";
50 constexpr const char* kProductMatrix = PRODUCT_VINTF_DIR "compatibility_matrix.xml";
51 constexpr const char* kProductManifest = PRODUCT_VINTF_DIR "manifest.xml";
52 constexpr const char* kSystemExtManifest = SYSTEM_EXT_VINTF_DIR "manifest.xml";
53 
54 constexpr const char* kVendorManifestFragmentDir = VENDOR_VINTF_DIR "manifest/";
55 constexpr const char* kSystemManifestFragmentDir = SYSTEM_VINTF_DIR "manifest/";
56 constexpr const char* kOdmManifestFragmentDir = ODM_VINTF_DIR "manifest/";
57 constexpr const char* kProductManifestFragmentDir = PRODUCT_VINTF_DIR "manifest/";
58 constexpr const char* kSystemExtManifestFragmentDir = SYSTEM_EXT_VINTF_DIR "manifest/";
59 
60 constexpr const char* kVendorLegacyManifest = "/vendor/manifest.xml";
61 constexpr const char* kVendorLegacyMatrix = "/vendor/compatibility_matrix.xml";
62 constexpr const char* kSystemLegacyManifest = "/system/manifest.xml";
63 constexpr const char* kSystemLegacyMatrix = "/system/compatibility_matrix.xml";
64 #define ODM_LEGACY_VINTF_DIR "/odm/etc/"
65 constexpr const char* kOdmLegacyVintfDir = ODM_LEGACY_VINTF_DIR;
66 constexpr const char* kOdmLegacyManifest = ODM_LEGACY_VINTF_DIR "manifest.xml";
67 
68 #undef SYSTEM_VINTF_DIR
69 #undef VENDOR_VINTF_DIR
70 #undef ODM_VINTF_DIR
71 #undef PRODUCT_VINTF_DIR
72 #undef SYSTEM_EXT_VINTF_DIR
73 #undef ODM_LEGACY_VINTF_DIR
74 
75 // Device manifest with level T must not set kernel level.
76 constexpr Level kEnforceDeviceManifestNoKernelLevel = Level::T;
77 
78 }  // namespace details
79 }  // namespace vintf
80 }  // namespace android
81