1 /* 2 * Copyright (c) 2022 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_DISTRIBUTED_ABILITY_MANAGER_INTERFACE_H 17 #define OHOS_DISTRIBUTED_ABILITY_MANAGER_INTERFACE_H 18 19 #include "continuation_extra_params.h" 20 #include "continuation_result.h" 21 #include "device_connect_status.h" 22 #include "iremote_broker.h" 23 24 namespace OHOS { 25 namespace DistributedSchedule { 26 namespace { 27 constexpr int32_t VALUE_NULL = -1; // no object in parcel 28 constexpr int32_t VALUE_OBJECT = 1; // object exist in parcel 29 30 constexpr const char* DMS_NAME = "dmsfwk"; 31 constexpr const char* DMS_VERSION = "3.2.0"; 32 } 33 class IDistributedAbilityManager : public OHOS::IRemoteBroker { 34 public: 35 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DistributedSchedule.IDistributedAbilityManager"); 36 37 virtual int32_t Register( 38 const std::shared_ptr<ContinuationExtraParams>& continuationExtraParams, int32_t& token) = 0; 39 virtual int32_t Unregister(int32_t token) = 0; 40 virtual int32_t RegisterDeviceSelectionCallback( 41 int32_t token, const std::string& cbType, const sptr<IRemoteObject>& notifier) = 0; 42 virtual int32_t UnregisterDeviceSelectionCallback(int32_t token, const std::string& cbType) = 0; 43 virtual int32_t UpdateConnectStatus(int32_t token, const std::string& deviceId, 44 const DeviceConnectStatus& deviceConnectStatus) = 0; 45 virtual int32_t StartDeviceManager( 46 int32_t token, const std::shared_ptr<ContinuationExtraParams>& continuationExtraParams = nullptr) = 0; 47 48 enum { 49 // request code for continuation manager 50 REGISTER = 500, 51 UNREGISTER = 501, 52 REGISTER_DEVICE_SELECTION_CALLBACK = 502, 53 UNREGISTER_DEVICE_SELECTION_CALLBACK = 503, 54 UPDATE_CONNECT_STATUS = 504, 55 START_DEVICE_MANAGER = 505, 56 }; 57 }; 58 } // namespace DistributedSchedule 59 } // namespace OHOS 60 #endif // OHOS_DISTRIBUTED_ABILITY_MANAGER_INTERFACE_H