mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-12-02 13:28:59 +00:00
cpp check告警问题修复
Signed-off-by: liuxiyao223 <liuxiyao223@huawei.com>
This commit is contained in:
parent
67ca8fa93a
commit
bac6bde82f
@ -642,7 +642,7 @@ bool SimFileManager::IsCTSimCard()
|
||||
bool isCTCardType = IsCTCardType(cardType);
|
||||
std::string iccId = simFile_->ObtainIccId();
|
||||
if (!iccId.empty() && iccId.length() >= ICCID_LEN_MINIMUM) {
|
||||
iccId = iccId.substr(0, ICCID_LEN_MINIMUM);
|
||||
iccId.resize(ICCID_LEN_MINIMUM);
|
||||
}
|
||||
if (isCTCardType && IsCTIccId(iccId)) {
|
||||
TELEPHONY_LOGI("[slot%{public}d] result = 1", slotId_);
|
||||
@ -692,7 +692,7 @@ bool SimFileManager::IsCTIccId(std::string iccId)
|
||||
bool isCTIccId = false;
|
||||
if (!iccId.empty() && iccId.length() >= ICCID_LEN_MINIMUM) {
|
||||
if (iccId.compare(0, PREFIX_LOCAL_ICCID_LEN, PREFIX_LOCAL_ICCID) == 0) {
|
||||
iccId = iccId.substr(0, ICCID_LEN_SIX);
|
||||
iccId.resize(ICCID_LEN_SIX);
|
||||
}
|
||||
auto iccIdRet = find(CT_ICCID_ARRAY.begin(), CT_ICCID_ARRAY.end(), iccId);
|
||||
isCTIccId = iccIdRet != CT_ICCID_ARRAY.end();
|
||||
|
@ -430,7 +430,7 @@ HWTEST_F(BranchTest, Telephony_SimFileManager_003, Function | MediumTest | Level
|
||||
EXPECT_FALSE(simFileManager.IsCTCardType(CardType::UNKNOWN_CARD));
|
||||
std::string iccId = "";
|
||||
EXPECT_FALSE(simFileManager.IsCTIccId(iccId));
|
||||
iccId = "8986030";
|
||||
iccId = "8986060";
|
||||
EXPECT_TRUE(simFileManager.IsCTIccId(iccId));
|
||||
iccId = "8985302";
|
||||
EXPECT_TRUE(simFileManager.IsCTIccId(iccId));
|
||||
|
Loading…
Reference in New Issue
Block a user