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_ABILITY_RUNTIME_SERVICE_ROUTER_FRAMEWORK_SERVICES_INCLUDE_SERVICE_ROUTER_MANAGER_STUB_H 17 #define OHOS_ABILITY_RUNTIME_SERVICE_ROUTER_FRAMEWORK_SERVICES_INCLUDE_SERVICE_ROUTER_MANAGER_STUB_H 18 19 #include "iremote_stub.h" 20 #include "nocopyable.h" 21 #include "parcel_macro.h" 22 #include "service_router_mgr_interface.h" 23 24 namespace OHOS { 25 namespace AbilityRuntime { 26 /** 27 * @class ServiceRouterMgrStub 28 * ServiceRouterMgrStub. 29 */ 30 class ServiceRouterMgrStub : public IRemoteStub<IServiceRouterManager> { 31 public: 32 ServiceRouterMgrStub(); 33 virtual ~ServiceRouterMgrStub(); 34 35 int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 36 37 private: 38 int HandleQueryBusinessAbilityInfos(MessageParcel &data, MessageParcel &reply); 39 int HandleQueryPurposeInfos(MessageParcel &data, MessageParcel &reply); 40 int HandleStartUIExtensionAbility(MessageParcel &data, MessageParcel &reply); 41 int HandleConnectUIExtensionAbility(MessageParcel &data, MessageParcel &reply); 42 bool VerifyCallingPermission(const std::string &permissionName); 43 bool VerifySystemApp(); 44 template <typename T> 45 bool WriteParcelableVector(std::vector<T> &parcelableVector, Parcel &data); 46 47 DISALLOW_COPY_AND_MOVE(ServiceRouterMgrStub); 48 }; 49 } // namespace AbilityRuntime 50 } // namespace OHOS 51 #endif // OHOS_ABILITY_RUNTIME_SERVICE_ROUTER_FRAMEWORK_SERVICES_INCLUDE_SERVICE_ROUTER_MANAGER_STUB_H