update services/storage_daemon/mtp/src/mtp_device_manager.cpp.

Signed-off-by: 李尚 <lishang21@huawei.com>
This commit is contained in:
李尚 2024-10-10 13:39:41 +00:00 committed by Gitee
parent d2561226d4
commit fbc9ad345a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -35,8 +35,7 @@ MtpDeviceManager::MtpDeviceManager() {}
MtpDeviceManager::~MtpDeviceManager()
{
LOGI("MtpDeviceManager Destructor.");
LOGI("MtpDeviceManager Destructor.");
}
int32_t MtpDeviceManager::MountDevice(const MtpDeviceInfo &device)
@ -76,6 +75,8 @@ int32_t MtpDeviceManager::MountDevice(const MtpDeviceInfo &device)
}
if (!success || (result.size() != 0)) {
LOGE("Run mtpfs cmd to mount mtp device failed.");
std::vector<std::string> result;
CmdUtils::GetInstance().RunCmd("umount " + device.path, result);
DelFolder(device.path);
isMounting = false;
return E_MTP_MOUNT_FAILED;
@ -84,7 +85,7 @@ int32_t MtpDeviceManager::MountDevice(const MtpDeviceInfo &device)
LOGI("Run mtpfs cmd to mount mtp device success.");
isMounting = false;
StorageManagerClient client;
client.NotifyMtpMounted(device.id, device.path);
client.NotifyMtpMounted(device.id, device.path, device.vendor + " " + device.product);
return E_OK;
}