mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-26 16:53:57 +00:00
update services/storage_daemon/mtp/src/mtp_device_monitor.cpp.
Signed-off-by: 李尚 <lishang21@huawei.com>
This commit is contained in:
parent
e724904133
commit
61b8d5142d
@ -72,6 +72,9 @@ void MtpDeviceMonitor::MonitorDevice()
|
||||
{
|
||||
LOGI("MonitorDevice: mtp device monitor thread begin.");
|
||||
while (g_keepMonitoring) {
|
||||
if (IsNeedDisableMtp()) {
|
||||
break;
|
||||
}
|
||||
sleep(SLEEP_TIME);
|
||||
CheckAndUmountRemovedMtpDevice();
|
||||
|
||||
@ -152,6 +155,10 @@ void MtpDeviceMonitor::MountMtpDevice(const std::vector<MtpDeviceInfo> &monitorD
|
||||
LOGE("MountMtpDevice: invalid mtp device, no need to mount.");
|
||||
continue;
|
||||
}
|
||||
if (lastestMtpDevList_.size() > 0) {
|
||||
LOGW("Multiple devices detected. Only one device is supported. Ignoring additional devices.");
|
||||
return;
|
||||
}
|
||||
int32_t ret = DelayedSingleton<MtpDeviceManager>::GetInstance()->MountDevice(device);
|
||||
if (ret == E_OK) {
|
||||
lastestMtpDevList_.push_back(device);
|
||||
|
Loading…
Reference in New Issue
Block a user