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 #pragma once 17 18 #include <string> 19 #include <vector> 20 21 #include <linker_config.pb.h> 22 23 #include "linkerconfig/apex.h" 24 #include "linkerconfig/namespace.h" 25 26 namespace android { 27 namespace linkerconfig { 28 namespace modules { 29 30 class BaseContext { 31 public: 32 BaseContext(); 33 virtual ~BaseContext() = default; 34 35 void AddApexModule(ApexInfo apex_module); 36 const std::vector<ApexInfo>& GetApexModules() const; 37 38 void SetStrictMode(bool strict); 39 bool IsStrictMode() const; 40 41 virtual Namespace BuildApexNamespace(const ApexInfo& apex_info, 42 bool visible) const; 43 44 void SetSystemConfig(const android::linkerconfig::proto::LinkerConfig& config); 45 const std::vector<std::string>& GetSystemProvideLibs() const; 46 const std::vector<std::string>& GetSystemRequireLibs() const; 47 48 void SetVendorConfig(const android::linkerconfig::proto::LinkerConfig& config); 49 const std::vector<std::string>& GetVendorProvideLibs() const; 50 const std::vector<std::string>& GetVendorRequireLibs() const; 51 52 void SetProductConfig(const android::linkerconfig::proto::LinkerConfig& config); 53 const std::vector<std::string>& GetProductProvideLibs() const; 54 const std::vector<std::string>& GetProductRequireLibs() const; 55 56 private: 57 bool strict_; 58 59 // Available APEX Modules which contains binary and/or library 60 std::vector<ApexInfo> apex_modules_; 61 62 std::vector<std::string> system_provide_libs_; 63 std::vector<std::string> system_require_libs_; 64 std::vector<std::string> vendor_provide_libs_; 65 std::vector<std::string> vendor_require_libs_; 66 std::vector<std::string> product_provide_libs_; 67 std::vector<std::string> product_require_libs_; 68 }; 69 70 } // namespace modules 71 } // namespace linkerconfig 72 } // namespace android 73