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_HDI_DRM_V1_0_OEMCERTIFICATESTUB_H 17 #define OHOS_HDI_DRM_V1_0_OEMCERTIFICATESTUB_H 18 19 #include <ipc_object_stub.h> 20 #include <message_option.h> 21 #include <message_parcel.h> 22 #include <object_collector.h> 23 #include <refbase.h> 24 #include "v1_0/ioem_certificate.h" 25 26 namespace OHOS { 27 namespace HDI { 28 namespace Drm { 29 namespace V1_0 { 30 31 using namespace OHOS; 32 class OemCertificateStub : public IPCObjectStub { 33 public: 34 explicit OemCertificateStub(const sptr<IOemCertificate> &impl); 35 virtual ~OemCertificateStub(); 36 37 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 38 39 static int32_t OemCertificateStubGenerateOemKeySystemRequest_(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption, sptr<OHOS::HDI::Drm::V1_0::IOemCertificate> impl); 40 41 static int32_t OemCertificateStubProcessOemKeySystemResponse_(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption, sptr<OHOS::HDI::Drm::V1_0::IOemCertificate> impl); 42 43 static int32_t OemCertificateStubGetVersion_(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption, sptr<OHOS::HDI::Drm::V1_0::IOemCertificate> impl); 44 45 private: 46 int32_t OemCertificateStubGenerateOemKeySystemRequest(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption); 47 48 int32_t OemCertificateStubProcessOemKeySystemResponse(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption); 49 50 int32_t OemCertificateStubGetVersion(MessageParcel& oemCertificateData, MessageParcel& oemCertificateReply, MessageOption& oemCertificateOption); 51 52 53 static inline ObjectDelegator<OHOS::HDI::Drm::V1_0::OemCertificateStub, OHOS::HDI::Drm::V1_0::IOemCertificate> objDelegator_; 54 sptr<OHOS::HDI::Drm::V1_0::IOemCertificate> impl_; 55 }; 56 } // V1_0 57 } // Drm 58 } // HDI 59 } // OHOS 60 61 #endif // OHOS_HDI_DRM_V1_0_OEMCERTIFICATESTUB_H