!1950 添加维测

Merge pull request !1950 from dadoudou/master
This commit is contained in:
openharmony_ci 2024-05-30 14:01:54 +00:00 committed by Gitee
commit df99d97527
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -402,6 +402,9 @@ void MultiSimController::SortCache()
sortCache[localCacheInfo_[j].slotIndex] = localCacheInfo_[j];
}
localCacheInfo_ = sortCache;
count = localCacheInfo_.size();
TELEPHONY_LOGI("localCacheInfo_.size() = %{public}lu, maxCount_ = %{public}d",
static_cast<unsigned long>(count), maxCount_);
}
/*
@ -648,7 +651,9 @@ int32_t MultiSimController::GetDefaultVoiceSlotId()
}
std::unique_lock<std::mutex> lock(mutex_);
if (localCacheInfo_.size() != static_cast<size_t>(maxCount_)) {
TELEPHONY_LOGE("localCacheInfo_ is empty or invalid");
size_t count = localCacheInfo_.size();
TELEPHONY_LOGE("localCacheInfo_.size() = %{public}lu, maxCount_ = %{public}d",
static_cast<unsigned long>(count), maxCount_);
return INVALID_VALUE;
}
int32_t i = DEFAULT_SIM_SLOT_ID;
@ -709,7 +714,9 @@ int32_t MultiSimController::SetDefaultVoiceSlotId(int32_t slotId)
int32_t i = DEFAULT_SIM_SLOT_ID;
std::unique_lock<std::mutex> lock(mutex_);
if (localCacheInfo_.size() != static_cast<size_t>(maxCount_)) {
TELEPHONY_LOGE("no sim card");
size_t count = localCacheInfo_.size();
TELEPHONY_LOGE("localCacheInfo_.size() = %{public}lu, maxCount_ = %{public}d",
static_cast<unsigned long>(count), maxCount_);
return TELEPHONY_ERR_NO_SIM_CARD;
}
for (; i < maxCount_; i++) { // save to cache
@ -744,7 +751,9 @@ int32_t MultiSimController::GetDefaultSmsSlotId()
}
std::unique_lock<std::mutex> lock(mutex_);
if (localCacheInfo_.size() != static_cast<size_t>(maxCount_)) {
TELEPHONY_LOGE("localCacheInfo_ is empty or invalid");
size_t count = localCacheInfo_.size();
TELEPHONY_LOGE("localCacheInfo_.size() = %{public}lu, maxCount_ = %{public}d",
static_cast<unsigned long>(count), maxCount_);
return INVALID_VALUE;
}
int32_t i = DEFAULT_SIM_SLOT_ID;
@ -777,7 +786,9 @@ int32_t MultiSimController::SetDefaultSmsSlotId(int32_t slotId)
int32_t i = DEFAULT_SIM_SLOT_ID;
std::unique_lock<std::mutex> lock(mutex_);
if (localCacheInfo_.size() != static_cast<size_t>(maxCount_)) {
TELEPHONY_LOGE("localCacheInfo_ is empty");
size_t count = localCacheInfo_.size();
TELEPHONY_LOGE("localCacheInfo_.size() = %{public}lu, maxCount_ = %{public}d",
static_cast<unsigned long>(count), maxCount_);
return TELEPHONY_ERR_NO_SIM_CARD;
}
for (; i < maxCount_; i++) { // save to cache