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 #pragma once
17 
18 #include "linkerconfig/apex.h"
19 #include "linkerconfig/context.h"
20 #include "linkerconfig/namespace.h"
21 
22 namespace android {
23 namespace linkerconfig {
24 namespace contents {
25 
26 enum class VndkUserPartition {
27   Vendor,
28   Product,
29 };
30 
31 typedef modules::Namespace NamespaceBuilder(const Context& ctx);
32 
33 NamespaceBuilder BuildSystemDefaultNamespace;
34 NamespaceBuilder BuildSphalNamespace;
35 NamespaceBuilder BuildRsNamespace;
36 NamespaceBuilder BuildVendorDefaultNamespace;
37 NamespaceBuilder BuildSystemNamespace;
38 NamespaceBuilder BuildVndkInSystemNamespace;
39 NamespaceBuilder BuildProductDefaultNamespace;
40 NamespaceBuilder BuildUnrestrictedDefaultNamespace;
41 NamespaceBuilder BuildPostInstallNamespace;
42 NamespaceBuilder BuildRecoveryDefaultNamespace;
43 NamespaceBuilder BuildIsolatedDefaultNamespace;
44 
45 modules::Namespace BuildVndkNamespace(const Context& ctx,
46                                       VndkUserPartition vndk_user);
47 
48 modules::Namespace BuildArtNamespace(const Context& ctx,
49                                      const modules::ApexInfo& apex_info);
50 
51 // Namespaces for APEX binaries
52 modules::Namespace BuildApexDefaultNamespace(const Context& ctx,
53                                              const modules::ApexInfo& apex_info);
54 NamespaceBuilder BuildApexPlatformNamespace;
55 NamespaceBuilder BuildApexArtDefaultNamespace;
56 
57 void RegisterApexNamespaceBuilders(Context& ctx);
58 }  // namespace contents
59 }  // namespace linkerconfig
60 }  // namespace android
61