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_APP_DEVICE_CALLBACK_STUB_H 17 #define OHOS_DISTRIBUTED_ABILITY_MANAGER_APP_DEVICE_CALLBACK_STUB_H 18 19 #include <iosfwd> 20 #include <vector> 21 22 #include "continuation_result.h" 23 #include "dms_notifier.h" 24 #include "app_device_callback_interface.h" 25 #include "iremote_stub.h" 26 #include "message_option.h" 27 #include "message_parcel.h" 28 #include "nocopyable.h" 29 #include "refbase.h" 30 31 namespace OHOS { 32 namespace DistributedSchedule { 33 class AppDeviceCallbackStub : public IRemoteStub<AppDeviceCallbackInterface> { 34 public: 35 explicit AppDeviceCallbackStub(const sptr<DmsNotifier>& dmsNotifier); 36 virtual ~AppDeviceCallbackStub() = default; 37 38 virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, 39 MessageParcel& reply, MessageOption& option) override; 40 41 private: 42 DISALLOW_COPY_AND_MOVE(AppDeviceCallbackStub); 43 int32_t OnDeviceConnect(int32_t token, const std::vector<ContinuationResult>& continuationResults) override; 44 int32_t OnDeviceDisconnect(int32_t token, const std::vector<ContinuationResult>& continuationResults) override; 45 int32_t OnDeviceCancel() override; 46 47 sptr<DmsNotifier> dmsNotifier_; 48 }; 49 } // namespace DistributedSchedule 50 } // namespace OHOS 51 #endif // OHOS_DISTRIBUTED_ABILITY_MANAGER_APP_DEVICE_CALLBACK_STUB_H