• 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 #pragma once
17 
18 #include <fruit/fruit.h>
19 #include <cstdint>
20 #include <optional>
21 #include <string>
22 #include <vector>
23 
24 #include "common/libs/utils/environment.h"
25 #include "common/libs/utils/result.h"
26 #include "host/libs/config/cuttlefish_config.h"
27 #include "host/libs/config/fetcher_config.h"
28 
29 namespace cuttlefish {
30 
31 struct GuestConfig {
32   Arch target_arch;
33   bool bootconfig_supported;
34   bool hctr2_supported;
35   std::string android_version_number;
36 };
37 
38 Result<std::vector<GuestConfig>> GetGuestConfigAndSetDefaults();
39 // Must be called after ParseCommandLineFlags.
40 Result<CuttlefishConfig> InitializeCuttlefishConfiguration(
41     const std::string& root_dir,
42     const std::vector<GuestConfig>& guest_configs,
43     fruit::Injector<>& injector, const FetcherConfig& fetcher_config);
44 
45 std::string GetConfigFilePath(const CuttlefishConfig& config);
46 std::string GetCuttlefishEnvPath();
47 std::string GetSeccompPolicyDir();
48 
49 } // namespace cuttlefish
50