1 //
2 // Copyright (C) 2023 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 <unordered_set>
20 #include <utility>
21 #include <vector>
22 
23 #include <fruit/fruit.h>
24 
25 #include "common/libs/utils/files.h"
26 #include "common/libs/utils/result.h"
27 #include "host/commands/run_cvd/launch/grpc_socket_creator.h"
28 #include "host/commands/run_cvd/launch/log_tee_creator.h"
29 #include "host/libs/config/command_source.h"
30 #include "host/libs/config/cuttlefish_config.h"
31 #include "host/libs/vm_manager/vm_manager.h"
32 
33 namespace cuttlefish {
34 
35 class WmediumdServer : public vm_manager::VmmDependencyCommand {
36  public:
37   INJECT(
38       WmediumdServer(const CuttlefishConfig::EnvironmentSpecific& environment,
39                      const CuttlefishConfig::InstanceSpecific& instance,
40                      LogTeeCreator& log_tee, GrpcSocketCreator& grpc_socket));
41 
42   // CommandSource
43   Result<std::vector<MonitorCommand>> Commands() override;
44 
45   // SetupFeature
46   std::string Name() const override;
47   bool Enabled() const override;
48 
49   Result<void> WaitForAvailability() const override;
50 
51  private:
52   std::unordered_set<SetupFeature*> Dependencies() const override;
53   Result<void> ResultSetup() override;
54 
55   const CuttlefishConfig::EnvironmentSpecific& environment_;
56   const CuttlefishConfig::InstanceSpecific& instance_;
57   LogTeeCreator& log_tee_;
58   GrpcSocketCreator& grpc_socket_;
59   std::string config_path_;
60 };
61 
62 }  // namespace cuttlefish
63