• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ROSEN_WINDOW_SCENE_DISTRIBUTED_CLIENT_H
17 #define OHOS_ROSEN_WINDOW_SCENE_DISTRIBUTED_CLIENT_H
18 
19 
20 #include <string>
21 
22 #include "mission_info.h"
23 #include "mission_snapshot.h"
24 #include "iremote_broker.h"
25 
26 namespace OHOS {
27 namespace Rosen {
28 class DistributedClient {
29 public:
30     DistributedClient() = default;
31     virtual ~DistributedClient() = default;
32     int32_t GetMissionInfos(const std::string& deviceId, int32_t numMissions,
33                             std::vector<AAFwk::MissionInfo>& missionInfos);
34     int32_t GetRemoteMissionSnapshotInfo(const std::string& deviceId, int32_t missionId,
35                                          std::unique_ptr<AAFwk::MissionSnapshot>& missionSnapshot);
36     int32_t SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState &state);
37     enum {
38         START_REMOTE_ABILITY = 1,
39         CONNECT_REMOTE_ABILITY = 6,
40         DISCONNECT_REMOTE_ABILITY = 7,
41         START_CONTINUATION = 11,
42         NOTIFY_COMPLETE_CONTINUATION = 12,
43         CONTINUE_MISSION = 36,
44         CONTINUE_MISSION_OF_BUNDLENAME = 37,
45         GET_MISSION_INFOS = 80,
46         REGISTER_MISSION_LISTENER = 84,
47         UNREGISTER_MISSION_LISTENER = 85,
48         START_SYNC_MISSIONS = 92,
49         STOP_SYNC_MISSIONS = 98,
50         GET_REMOTE_MISSION_SNAPSHOT_INFO = 99,
51         START_REMOTE_ABILITY_BY_CALL = 150,
52         RELEASE_REMOTE_ABILITY = 151,
53         START_REMOTE_FREE_INSTALL = 200,
54         STOP_REMOTE_EXTERNSION_ABILITY = 225,
55         REGISTER_ON_LISTENER = 260,
56         REGISTER_OFF_LISTENER = 261,
57         SET_MISSION_CONTINUE_STATE = 300
58     };
59 private:
60     sptr<IRemoteObject> GetDmsProxy();
61     bool ReadMissionInfosFromParcel(Parcel& parcel, std::vector<AAFwk::MissionInfo>& missionInfos);
62 };
63 } // namespace Rosen
64 } // namespace OHOS
65 #endif // OHOS_ROSEN_WINDOW_SCENE_DISTRIBUTED_CLIENT_H
66