1 /* 2 * Copyright (c) 2024 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_KIA_INTERCEPTOR_STUB_H 17 #define OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_STUB_H 18 19 #include "kia_interceptor_interface.h" 20 21 #include <iremote_object.h> 22 #include <iremote_stub.h> 23 24 namespace OHOS { 25 namespace AppExecFwk { 26 /** 27 * @class KiaInterceptorStub 28 * IPC stub of IKiaInterceptor. 29 */ 30 class KiaInterceptorStub : public IRemoteStub<IKiaInterceptor> { 31 public: 32 /** 33 * KiaInterceptorStub, constructor. 34 * 35 */ 36 KiaInterceptorStub(); 37 38 /** 39 * KiaInterceptorStub, destructor. 40 * 41 */ 42 virtual ~KiaInterceptorStub(); 43 44 /** 45 * OnRemoteRequest, IPC method. 46 * 47 * @param code The IPC code. 48 * @param data The message parcel data. 49 * @param reply The message parcel reply. 50 * @param option The message parcel option. 51 * @return Error code of calling the function. 52 */ 53 virtual int OnRemoteRequest( 54 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 55 56 private: 57 /** 58 * OnInterceptInner, inner processing method from KIA. 59 * 60 * @param data The message parcel data. 61 * @param reply The message parcel reply. 62 * @return Error code of calling the function. 63 */ 64 int OnInterceptInner(MessageParcel &data, MessageParcel &reply); 65 }; 66 } // namespace AppExecFwk 67 } // namespace OHOS 68 #endif // OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_STUB_H 69