1 /* 2 * Copyright (c) 2022 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_CAMERA_MANAGER_PRIVACY_PROXY_H 17 #define OHOS_CAMERA_MANAGER_PRIVACY_PROXY_H 18 19 #include <iremote_proxy.h> 20 21 #include "privacy_camera_service_ipc_interface_code.h" 22 23 namespace OHOS { 24 namespace Security { 25 namespace AccessToken { 26 class ICameraMuteServiceCallback : public IRemoteBroker { 27 public: 28 virtual int32_t OnCameraMute(bool muteMode) = 0; 29 30 DECLARE_INTERFACE_DESCRIPTOR(u"ICameraMuteServiceCallback"); 31 }; 32 33 class ICameraService : public IRemoteBroker { 34 public: 35 DECLARE_INTERFACE_DESCRIPTOR(u"ICameraService"); 36 37 virtual int32_t SetMuteCallback(const sptr<ICameraMuteServiceCallback>& callback) = 0; 38 virtual int32_t MuteCamera(bool muteMode) = 0; 39 virtual int32_t IsCameraMuted(bool &muteMode) = 0; 40 }; 41 42 class CameraManagerPrivacyProxy : public IRemoteProxy<ICameraService> { 43 public: CameraManagerPrivacyProxy(const sptr<IRemoteObject> & impl)44 explicit CameraManagerPrivacyProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<ICameraService>(impl) {}; 45 46 virtual ~CameraManagerPrivacyProxy() = default; 47 48 int32_t SetMuteCallback(const sptr<ICameraMuteServiceCallback>& callback) override; 49 int32_t MuteCamera(bool muteMode) override; 50 int32_t IsCameraMuted(bool &muteMode) override; 51 private: 52 static inline BrokerDelegator<CameraManagerPrivacyProxy> delegator_; 53 }; 54 } 55 } 56 } 57 #endif // OHOS_CAMERA_MANAGER_PRIVACY_PROXY_H 58