Lines Matching refs:UsbService
87 auto g_serviceInstance = DelayedSpSingleton<UsbService>::GetInstance();
89 SystemAbility::MakeAndRegisterAbility(DelayedSpSingleton<UsbService>::GetInstance().GetRefPtr());
91 UsbService::UsbService() : SystemAbility(USB_SYSTEM_ABILITY_ID, true)
103 UsbService::~UsbService() {}
106 int32_t UsbService::SetUsbd(const sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> &usbd)
109 USB_HILOGE(MODULE_USB_SERVICE, "UsbService usbd is nullptr");
130 UsbService::SystemAbilityStatusChangeListener::SystemAbilityStatusChangeListener(
138 void UsbService::SystemAbilityStatusChangeListener::OnAddSystemAbility(
146 void UsbService::SystemAbilityStatusChangeListener::OnRemoveSystemAbility(
160 void UsbService::OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId)
171 void UsbService::OnStart()
225 bool UsbService::Init()
248 bool UsbService::InitUsbd()
275 void UsbService::OnStop()
284 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
296 bool UsbService::IsCommonEventServiceAbilityExist()
315 int32_t UsbService::OpenDevice(uint8_t busNum, uint8_t devAddr)
317 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
323 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
336 int32_t UsbService::ResetDevice(uint8_t busNum, uint8_t devAddr)
342 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
357 std::string UsbService::GetDeviceVidPidSerialNumber(std::string deviceName)
373 int32_t UsbService::GetDeviceVidPidSerialNumber(std::string deviceName, std::string& strDesc)
390 bool UsbService::CheckDevicePermission(uint8_t busNum, uint8_t devAddr)
393 if (!UsbService::HasRight(name)) {
402 bool UsbService::HasRight(std::string deviceName)
439 int32_t UsbService::RequestRight(std::string deviceName)
470 int32_t UsbService::RemoveRight(std::string deviceName)
509 int32_t UsbService::GetDevices(std::vector<UsbDevice> &deviceList)
530 int32_t UsbService::GetCurrentFunctions(int32_t &functions)
540 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
549 int32_t UsbService::SetCurrentFunctions(int32_t functions)
569 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
578 int32_t UsbService::UsbFunctionsFromString(std::string_view funcs)
593 std::string UsbService::UsbFunctionsToString(int32_t funcs)
608 int32_t UsbService::GetPorts(std::vector<UsbPort> &ports)
627 int32_t UsbService::GetSupportedModes(int32_t portId, int32_t &supportedModes)
646 int32_t UsbService::SetPortRole(int32_t portId, int32_t powerRole, int32_t dataRole)
657 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
670 int32_t UsbService::ClaimInterface(uint8_t busNum, uint8_t devAddr, uint8_t interface, uint8_t force)
672 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
678 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
691 int32_t UsbService::UsbAttachKernelDriver(uint8_t busNum, uint8_t devAddr, uint8_t interface)
693 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
699 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
712 int32_t UsbService::UsbDetachKernelDriver(uint8_t busNum, uint8_t devAddr, uint8_t interface)
714 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
720 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
733 int32_t UsbService::ReleaseInterface(uint8_t busNum, uint8_t devAddr, uint8_t interface)
735 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
741 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
754 int32_t UsbService::BulkTransferRead(
757 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
761 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
774 int32_t UsbService::BulkTransferReadwithLength(const UsbDev &devInfo, const UsbPipe &pipe,
777 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
781 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
794 int32_t UsbService::BulkTransferWrite(
797 if (!UsbService::CheckDevicePermission(dev.busNum, dev.devAddr)) {
801 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
813 int32_t UsbService::ControlTransfer(const UsbDev &dev, const UsbCtrlTransfer &ctrl, std::vector<uint8_t> &bufferData)
815 if (!UsbService::CheckDevicePermission(dev.busNum, dev.devAddr)) {
820 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
842 int32_t UsbService::UsbControlTransfer(
845 if (!UsbService::CheckDevicePermission(dev.busNum, dev.devAddr)) {
851 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
875 int32_t UsbService::SetActiveConfig(uint8_t busNum, uint8_t devAddr, uint8_t configIndex)
877 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
883 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
891 int32_t UsbService::GetActiveConfig(uint8_t busNum, uint8_t devAddr, uint8_t &configIndex)
893 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
899 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
908 int32_t UsbService::SetInterface(uint8_t busNum, uint8_t devAddr, uint8_t interfaceid, uint8_t altIndex)
910 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
916 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
924 int32_t UsbService::GetRawDescriptor(uint8_t busNum, uint8_t devAddr, std::vector<uint8_t> &bufferData)
926 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
932 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
944 int32_t UsbService::GetFileDescriptor(uint8_t busNum, uint8_t devAddr, int32_t &fd)
946 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
952 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
964 int32_t UsbService::RequestQueue(const UsbDev &dev, const UsbPipe &pipe, const std::vector<uint8_t> &clientData,
967 if (!UsbService::CheckDevicePermission(dev.busNum, dev.devAddr)) {
972 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
984 int32_t UsbService::RequestWait(
987 if (!UsbService::CheckDevicePermission(dev.busNum, dev.devAddr)) {
992 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1004 int32_t UsbService::RequestCancel(uint8_t busNum, uint8_t devAddr, uint8_t interfaceId, uint8_t endpointId)
1006 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
1013 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1021 int32_t UsbService::Close(uint8_t busNum, uint8_t devAddr)
1023 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
1029 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1037 std::string UsbService::GetDevStringValFromIdx(uint8_t busNum, uint8_t devAddr, uint8_t idx)
1048 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1095 int32_t UsbService::FillDevStrings(UsbDevice &dev)
1135 int32_t UsbService::GetDeviceInfoDescriptor(const UsbDev &uDev, std::vector<uint8_t> &descriptor, UsbDevice &dev)
1138 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1168 int32_t UsbService::GetConfigDescriptor(UsbDevice &dev, std::vector<uint8_t> &descriptor)
1184 int32_t UsbService::GetDeviceInfo(uint8_t busNum, uint8_t devAddr, UsbDevice &dev)
1190 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1224 int32_t UsbService::GetEdmGlobalPolicy(sptr<IRemoteObject> remote, bool &IsGlobalDisabled)
1253 int32_t UsbService::GetEdmStroageTypePolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceType> &disableType)
1289 int32_t UsbService::GetEdmTypePolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceType> &disableType)
1331 int32_t UsbService::GetEdmWhiteListPolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceId> &trustUsbDeviceIds)
1371 int32_t UsbService::GetEdmPolicy(bool &IsGlobalDisabled, std::vector<UsbDeviceType> &disableType,
1409 int32_t UsbService::GetUsbPolicy(bool &IsGlobalDisabled, std::vector<UsbDeviceType> &disableType,
1436 int32_t UsbService::ExecuteManageInterfaceType(const std::vector<UsbDeviceType> &disableType, bool disable)
1466 void UsbService::ExecuteManageDeviceType(const std::vector<UsbDeviceType> &disableType, bool disable,
1512 int32_t UsbService::ExecuteManageDevicePolicy(std::vector<UsbDeviceId> &whiteList)
1542 bool UsbService::IsEdmEnabled()
1551 void UsbService::ExecuteStrategy(UsbDevice *devInfo)
1597 bool UsbService::AddDevice(uint8_t busNum, uint8_t devAddr)
1633 bool UsbService::DelDevice(uint8_t busNum, uint8_t devAddr)
1666 int32_t UsbService::InitUsbRight()
1691 void UsbService::UpdateUsbPort(int32_t portId, int32_t powerRole, int32_t dataRole, int32_t mode)
1703 void UsbService::UpdateDeviceState(int32_t status)
1715 bool UsbService::GetBundleName(std::string &bundleName)
1747 bool UsbService::GetCallingInfo(std::string &bundleName, std::string &tokenId, int32_t &userId)
1767 bool UsbService::GetBundleInfo(std::string &tokenId, int32_t &userId)
1783 int32_t UsbService::RegBulkCallback(const UsbDev &devInfo, const UsbPipe &pipe, const sptr<IRemoteObject> &cb)
1785 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
1798 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1811 int32_t UsbService::UnRegBulkCallback(const UsbDev &devInfo, const UsbPipe &pipe)
1813 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
1818 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1832 int32_t UsbService::BulkRead(const UsbDev &devInfo, const UsbPipe &pipe, sptr<Ashmem> &ashmem)
1834 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
1844 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1856 int32_t UsbService::BulkWrite(const UsbDev &devInfo, const UsbPipe &pipe, sptr<Ashmem> &ashmem)
1858 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
1868 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1880 int32_t UsbService::BulkCancel(const UsbDev &devInfo, const UsbPipe &pipe)
1882 if (!UsbService::CheckDevicePermission(devInfo.busNum, devInfo.devAddr)) {
1887 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
1899 int32_t UsbService::AddRight(const std::string &bundleName, const std::string &deviceName)
1933 int32_t UsbService::AddAccessRight(const std::string &tokenId, const std::string &deviceName)
1959 int UsbService::Dump(int fd, const std::vector<std::u16string> &args)
1997 void UsbService::DumpHelp(int32_t fd)
2014 void UsbService::UnLoadSelf(UnLoadSaType type)
2065 void UsbService::UsbdDeathRecipient::OnRemoteDied(const wptr<IRemoteObject> &object)
2081 sptr<UsbService> UsbService::GetGlobalInstance()
2088 int32_t UsbService::PreCallFunction()
2112 int32_t UsbService::ManageGlobalInterface(bool disable)
2124 int32_t UsbService::ManageDevice(int32_t vendorId, int32_t productId, bool disable)
2136 int32_t UsbService::ManageInterfaceType(const std::vector<UsbDeviceType> &disableType, bool disable)
2147 int32_t UsbService::ManageGlobalInterfaceImpl(bool disable)
2189 int32_t UsbService::ManageDeviceImpl(int32_t vendorId, int32_t productId, bool disable)
2233 int32_t UsbService::ManageInterfaceTypeImpl(InterfaceType interfaceType, bool disable)
2237 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::not find interface type");
2278 int32_t UsbService::CheckUecValue()
2293 int32_t UsbService::ManageDeviceTypeImpl(InterfaceType interfaceType, bool disable)
2297 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::not find interface type");
2319 int32_t UsbService::ManageInterface(const HDI::Usb::V1_0::UsbDev &dev, uint8_t interfaceId, bool disable)
2330 int32_t UsbService::ClearHalt(uint8_t busNum, uint8_t devAddr, uint8_t interfaceId, uint8_t endpointId)
2337 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
2352 int32_t UsbService::GetInterfaceActiveStatus(uint8_t busNum, uint8_t devAddr, uint8_t interfaceid, bool &unactivated)
2354 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
2364 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
2376 int32_t UsbService::GetDeviceSpeed(uint8_t busNum, uint8_t devAddr, uint8_t &speed)
2378 if (!UsbService::CheckDevicePermission(busNum, devAddr)) {
2388 USB_HILOGE(MODULE_USB_SERVICE, "UsbService::usbd_ is nullptr");
2400 bool UsbService::GetDeviceProductName(const std::string &deviceName, std::string &productName)