• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 "host/commands/cvd/parser/cf_configs_instances.h"
18 
19 #include <android-base/logging.h>
20 #include <iostream>
21 
22 #include "host/commands/cvd/parser/cf_configs_common.h"
23 #include "host/commands/cvd/parser/instance/cf_boot_configs.h"
24 #include "host/commands/cvd/parser/instance/cf_graphics_configs.h"
25 #include "host/commands/cvd/parser/instance/cf_metrics_configs.h"
26 #include "host/commands/cvd/parser/instance/cf_security_configs.h"
27 #include "host/commands/cvd/parser/instance/cf_vm_configs.h"
28 
29 namespace cuttlefish {
30 
InitInstancesConfigs(Json::Value & root)31 void InitInstancesConfigs(Json::Value& root) {
32   InitVmConfigs(root);
33   InitBootConfigs(root);
34   InitSecurityConfigs(root);
35   InitGraphicsConfigs(root);
36 }
37 
GenerateInstancesFlags(const Json::Value & root)38 std::vector<std::string> GenerateInstancesFlags(const Json::Value& root) {
39   std::vector<std::string> result = GenerateVmFlags(root);
40   if (!GENERATE_MVP_FLAGS_ONLY) {
41     result = MergeResults(result, GenerateBootFlags(root));
42   }
43   result = MergeResults(result, GenerateSecurityFlags(root));
44   result = MergeResults(result, GenerateGraphicsFlags(root));
45   result = MergeResults(result, GenerateMetricsFlags(root));
46 
47   return result;
48 }
49 
50 }  // namespace cuttlefish
51