1 /* 2 * Copyright (c) 2025 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 HCAMERA_SERVICE_CALLBACK_STUB_FUZZER_H 17 #define HCAMERA_SERVICE_CALLBACK_STUB_FUZZER_H 18 19 #include "hcamera_service_callback_stub.h" 20 #include <memory> 21 22 namespace OHOS { 23 namespace CameraStandard { 24 25 class HCameraServiceCallbackStubFuzz : public HCameraServiceCallbackStub { 26 public: 27 int32_t OnCameraStatusChanged(const std::string& cameraId, const CameraStatus status, 28 const std::string& bundleName = "") override 29 { 30 return 0; 31 } OnFlashlightStatusChanged(const std::string & cameraId,const FlashStatus status)32 int32_t OnFlashlightStatusChanged(const std::string& cameraId, const FlashStatus status) override 33 { 34 return 0; 35 } 36 }; 37 38 class HCameraMuteServiceCallbackStubFuzz : public HCameraMuteServiceCallbackStub { 39 public: OnCameraMute(bool muteMode)40 int32_t OnCameraMute(bool muteMode) override 41 { 42 return 0; 43 } 44 }; 45 46 class HTorchServiceCallbackStubFuzz : public HTorchServiceCallbackStub { 47 public: OnTorchStatusChange(const TorchStatus status)48 int32_t OnTorchStatusChange(const TorchStatus status) override 49 { 50 return 0; 51 } 52 }; 53 54 class HFoldServiceCallbackStubFuzz : public HFoldServiceCallbackStub { 55 public: OnFoldStatusChanged(const FoldStatus status)56 int32_t OnFoldStatusChanged(const FoldStatus status) override 57 { 58 return 0; 59 } 60 }; 61 62 class HCameraServiceCallbackStubFuzzer { 63 public: 64 static void HCameraServiceCallbackStubFuzzTest(int32_t code); 65 static void HCameraMuteServiceCallbackStuFuzzTest(int32_t code); 66 static void HTorchServiceCallbackStubFuzzTest(int32_t code); 67 static void HFoldServiceCallbackStubFuzzTest(int32_t code); 68 }; 69 } //CameraStandard 70 } //OHOS 71 #endif //HCAMERA_SERVICE_CALLBACK_STUB_FUZZER_H