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 "linkerconfig/sectionbuilder.h"
18 
19 #include "linkerconfig/common.h"
20 #include "linkerconfig/namespacebuilder.h"
21 #include "linkerconfig/section.h"
22 
23 using android::linkerconfig::contents::SectionType;
24 using android::linkerconfig::modules::Namespace;
25 using android::linkerconfig::modules::Section;
26 
27 namespace android {
28 namespace linkerconfig {
29 namespace contents {
30 Section BuildLegacySection(Context& ctx) {
31   ctx.SetCurrentSection(SectionType::System);
32   std::vector<Namespace> namespaces;
33 
34   namespaces.emplace_back(BuildSystemDefaultNamespace(ctx));
35 
36   return BuildSection(ctx,
37                       "legacy",
38                       std::move(namespaces),
39                       {
40                           "com.android.art",
41                           "com.android.neuralnetworks",
42                           "com.android.runtime",
43                           "com.android.cronet",
44                           "com.android.media",
45                           "com.android.conscrypt",
46                           "com.android.os.statsd",
47                       });
48 }
49 }  // namespace contents
50 }  // namespace linkerconfig
51 }  // namespace android
52