diff --git a/services/native/src/usb_service.cpp b/services/native/src/usb_service.cpp index 1b44a5d297267bc798e4222ac4c31331f08d4824..0c58688d77aef5e6c3e3727d519e591856f97732 100644 --- a/services/native/src/usb_service.cpp +++ b/services/native/src/usb_service.cpp @@ -74,6 +74,7 @@ constexpr uint32_t EDM_SA_TIME_OUT_CODE = 9200007; constexpr int32_t BASECLASS_INDEX = 0; constexpr int32_t SUBCLASS_INDEX = 1; constexpr int32_t PROTOCAL_INDEX = 2; +constexpr int32_t GET_EDM_STORAGE_DISABLE_TYPE = 2; constexpr int32_t RANDOM_VALUE_INDICATE = -1; std::unordered_map> typeMap = { @@ -934,6 +935,7 @@ int32_t UsbService::GetEdmGlobalPolicy(sptr remote, bool &IsGloba int32_t UsbService::GetEdmTypePolicy(sptr remote, std::unordered_map &typeDisableMap) { + int32_t StorageDisableType = 0; bool IsStorageDisabled = false; MessageParcel data; MessageParcel reply; @@ -952,7 +954,10 @@ int32_t UsbService::GetEdmTypePolicy(sptr remote, return UEC_SERVICE_EDM_SEND_REQUEST_FAILED; } - reply.ReadBool(IsStorageDisabled); + reply.ReadInt32(StorageDisableType); + if (StorageDisableType == GET_EDM_STORAGE_DISABLE_TYPE) { + IsStorageDisabled = true; + } typeDisableMap[InterfaceType::TYPE_STORAGE] = IsStorageDisabled; return UEC_OK; }