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 #include "privacy_param.h" 23 24 namespace OHOS { 25 namespace Security { 26 namespace AccessToken { 27 class ICameraService : public IRemoteBroker { 28 public: 29 DECLARE_INTERFACE_DESCRIPTOR(u"ICameraService"); 30 31 virtual int32_t MuteCameraPersist(PolicyType policyType, bool muteMode) = 0; 32 virtual int32_t IsCameraMuted(bool &muteMode) = 0; 33 }; 34 35 class CameraManagerPrivacyProxy : public IRemoteProxy<ICameraService> { 36 public: CameraManagerPrivacyProxy(const sptr<IRemoteObject> & impl)37 explicit CameraManagerPrivacyProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<ICameraService>(impl) {} 38 39 virtual ~CameraManagerPrivacyProxy() = default; 40 41 int32_t MuteCameraPersist(PolicyType policyType, bool muteMode) override; 42 int32_t IsCameraMuted(bool &muteMode) override; 43 private: 44 static inline BrokerDelegator<CameraManagerPrivacyProxy> delegator_; 45 }; 46 } 47 } 48 } 49 #endif // OHOS_CAMERA_MANAGER_PRIVACY_PROXY_H 50