已开启
接口做内外部slotId转换 #1307
yyxnju创建于 8月26日
接口做内外部slotId转换 #1307
已开启
共 1 个文件变更+8-4
| @@ -246,9 +246,11 @@ int32_t CellularDataService::GetApnState(int32_t slotId, const std::string &apnT | |||
| 246 | return TELEPHONY_ERR_PERMISSION_ERR; | 246 | return TELEPHONY_ERR_PERMISSION_ERR; |
| 247 | } | 247 | } |
| 248 | // LCOV_EXCL_STOP | 248 | // LCOV_EXCL_STOP |
| 249 | - std::shared_ptr<CellularDataController> cellularDataController = GetCellularDataController(slotId); | 249 | + int32_t internalSlotId = slotId; |
| 250 | + internalSlotId = GetInternalSlotIdForDefaultData(internalSlotId); | ||
| 251 | + std::shared_ptr<CellularDataController> cellularDataController = GetCellularDataController(internalSlotId); | ||
| 250 | if (cellularDataController == nullptr) { | 252 | if (cellularDataController == nullptr) { |
| 251 | - TELEPHONY_LOGE("cellularDataControllers is null, slotId=%{public}d", slotId); | 253 | + TELEPHONY_LOGE("cellularDataControllers is null, slotId=%{public}d", internalSlotId); |
| 252 | return CELLULAR_DATA_INVALID_PARAM; | 254 | return CELLULAR_DATA_INVALID_PARAM; |
| 253 | } | 255 | } |
| 254 | state = static_cast<int32_t>(cellularDataController->GetCellularDataState(apnType)); | 256 | state = static_cast<int32_t>(cellularDataController->GetCellularDataState(apnType)); |
| @@ -678,9 +680,11 @@ int32_t CellularDataService::GetDataConnApnAttr(int32_t slotId, ApnAttribute &ap | |||
| 678 | TELEPHONY_LOGE("Permission denied!"); | 680 | TELEPHONY_LOGE("Permission denied!"); |
| 679 | return TELEPHONY_ERR_PERMISSION_ERR; | 681 | return TELEPHONY_ERR_PERMISSION_ERR; |
| 680 | } | 682 | } |
| 681 | - std::shared_ptr<CellularDataController> cellularDataController = GetCellularDataController(slotId); | 683 | + int32_t internalSlotId = slotId; |
| 684 | + internalSlotId = GetInternalSlotIdForDefaultData(internalSlotId); | ||
| 685 | + std::shared_ptr<CellularDataController> cellularDataController = GetCellularDataController(internalSlotId); | ||
| 682 | if (cellularDataController == nullptr) { | 686 | if (cellularDataController == nullptr) { |
| 683 | - TELEPHONY_LOGE("cellularDataControllers is null, slotId=%{public}d", slotId); | 687 | + TELEPHONY_LOGE("cellularDataControllers is null, slotId=%{public}d", internalSlotId); |
| 684 | return CELLULAR_DATA_INVALID_PARAM; | 688 | return CELLULAR_DATA_INVALID_PARAM; |
| 685 | } | 689 | } |
| 686 | ApnItem::Attribute apn; | 690 | ApnItem::Attribute apn; |