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 HSTREAM_METADATA_STUB_FUZZER_H 17 #define HSTREAM_METADATA_STUB_FUZZER_H 18 19 #include "stream_metadata_stub.h" 20 #include "icamera_ipc_checker.h" 21 22 namespace OHOS { 23 namespace CameraStandard { 24 25 class HStreamMetadataStubFuzz : public StreamMetadataStub, public ICameraIpcChecker { 26 public: Start()27 int32_t Start() override 28 { 29 return 0; 30 } Stop()31 int32_t Stop() override 32 { 33 return 0; 34 } SetCallback(const sptr<IStreamMetadataCallback> & callback)35 int32_t SetCallback(const sptr<IStreamMetadataCallback>& callback) override 36 { 37 return 0; 38 } UnSetCallback()39 int32_t UnSetCallback() override 40 { 41 return 0; 42 } Release()43 int32_t Release() override 44 { 45 return 0; 46 } OperatePermissionCheck(uint32_t interfaceCode)47 int32_t OperatePermissionCheck(uint32_t interfaceCode) override 48 { 49 return 0; 50 } EnableMetadataType(const std::vector<int32_t> & metadataTypes)51 int32_t EnableMetadataType(const std::vector<int32_t>& metadataTypes) override 52 { 53 return 0; 54 } DisableMetadataType(const std::vector<int32_t> & metadataTypes)55 int32_t DisableMetadataType(const std::vector<int32_t>& metadataTypes) override 56 { 57 return 0; 58 } CallbackEnter(uint32_t code)59 int32_t CallbackEnter([[maybe_unused]] uint32_t code) override 60 { 61 return 0; 62 } CallbackExit(uint32_t code,int32_t result)63 int32_t CallbackExit([[maybe_unused]] uint32_t code, [[maybe_unused]] int32_t result) override 64 { 65 return 0; 66 } 67 }; 68 69 class HStreamMetadataStubFuzzer { 70 public: 71 static std::shared_ptr<HStreamMetadataStubFuzz> fuzz_; 72 static void OnRemoteRequest(int32_t code); 73 }; 74 } //CameraStandard 75 } //OHOS 76 #endif //HSTREAM_METADATA_STUB_FUZZER_H