• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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 "linkerconfig/sectionbuilder.h"
18 
19 #include <vector>
20 
21 #include "linkerconfig/namespacebuilder.h"
22 #include "linkerconfig/section.h"
23 
24 using android::linkerconfig::contents::SectionType;
25 using android::linkerconfig::modules::ApexInfo;
26 using android::linkerconfig::modules::Namespace;
27 using android::linkerconfig::modules::Section;
28 
29 namespace android {
30 namespace linkerconfig {
31 namespace contents {
BuildApexArtSection(Context & ctx,const ApexInfo & apex_info)32 Section BuildApexArtSection(Context& ctx, const ApexInfo& apex_info) {
33   std::vector<Namespace> namespaces;
34 
35   ctx.SetCurrentSection(SectionType::Other);
36 
37   namespaces.emplace_back(BuildApexArtDefaultNamespace(ctx));
38   namespaces.emplace_back(BuildApexPlatformNamespace(ctx));
39 
40   return BuildSection(ctx,
41                       apex_info.name,
42                       std::move(namespaces),
43                       {
44                           "com.android.art",
45                           "com.android.conscrypt",
46                           "com.android.neuralnetworks",
47                           "com.android.os.statsd",
48                       });
49 }
50 }  // namespace contents
51 }  // namespace linkerconfig
52 }  // namespace android
53