1 /* 2 * Copyright (c) 2023-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 INTERFACES_INNER_API_USB_MANAGER_INCLUDE_USB_MANAGER_PROXY_H 17 #define INTERFACES_INNER_API_USB_MANAGER_INCLUDE_USB_MANAGER_PROXY_H 18 19 #include "enterprise_device_mgr_proxy.h" 20 #include "usb_device_id.h" 21 #ifdef USB_EDM_ENABLE 22 #include "usb_interface_type.h" 23 #endif 24 25 namespace OHOS { 26 namespace EDM { 27 class UsbManagerProxy { 28 public: 29 static std::shared_ptr<UsbManagerProxy> GetUsbManagerProxy(); 30 int32_t SetUsbReadOnly(MessageParcel &data); 31 int32_t DisableUsb(MessageParcel &data); 32 int32_t IsUsbDisabled(MessageParcel &data, bool &result); 33 int32_t AddAllowedUsbDevices(MessageParcel &data); 34 int32_t RemoveAllowedUsbDevices(MessageParcel &data); 35 int32_t GetAllowedUsbDevices(MessageParcel &data, std::vector<UsbDeviceId> &result); 36 int32_t SetUsbStorageDeviceAccessPolicy(MessageParcel &data); 37 int32_t GetUsbStorageDeviceAccessPolicy(MessageParcel &data, int32_t &result); 38 #ifdef USB_EDM_ENABLE 39 int32_t AddOrRemoveDisallowedUsbDevices(MessageParcel &data, bool isAdd); 40 int32_t GetDisallowedUsbDevices(MessageParcel &data, 41 std::vector<OHOS::USB::UsbDeviceType> &result); 42 #endif 43 44 private: 45 static std::shared_ptr<UsbManagerProxy> instance_; 46 static std::once_flag flag_; 47 }; 48 } // namespace EDM 49 } // namespace OHOS 50 51 #endif // INTERFACES_INNER_API_USB_MANAGER_INCLUDE_USB_MANAGER_PROXY_H 52