diff --git a/frameworks/js/napi/src/cellular_data_service.cpp b/frameworks/js/napi/src/cellular_data_service.cpp index d570cd6719f3f85c482be774cdd721adc43136f1..122f937989afb9df7467f3722a763b724625f42e 100644 --- a/frameworks/js/napi/src/cellular_data_service.cpp +++ b/frameworks/js/napi/src/cellular_data_service.cpp @@ -757,34 +757,6 @@ std::shared_ptr CellularDataService::GetCellularDataCont return item->second; } -int32_t CellularDataService::EstablishAllApnsIfConnectable(const int32_t slotId) -{ - if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) { - TELEPHONY_LOGE("Permission denied!"); - return TELEPHONY_ERR_PERMISSION_ERR; - } - - std::shared_ptr cellularDataController = GetCellularDataController(slotId); - if (cellularDataController == nullptr) { - TELEPHONY_LOGE("slot%{public}d cellularDataControllers is null", slotId); - return CELLULAR_DATA_INVALID_PARAM; - } - - bool hasSim = false; - CoreManagerInner::GetInstance().HasSimCard(slotId, hasSim); - if (!hasSim) { - TELEPHONY_LOGE("slot%{public}d has no sim", slotId); - return TELEPHONY_ERR_NO_SIM_CARD; - } - if (!CoreManagerInner::GetInstance().IsSimActive(slotId)) { - TELEPHONY_LOGE("slot%{public}d sim not active", slotId); - return TELEPHONY_ERR_SLOTID_INVALID; - } - - bool result = cellularDataController->EstablishAllApnsIfConnectable(); - return result ? TELEPHONY_ERR_SUCCESS : TELEPHONY_ERR_FAIL; -} - int32_t CellularDataService::ReleaseCellularDataConnection(int32_t slotId) { if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) { diff --git a/frameworks/native/cellular_data_client.cpp b/frameworks/native/cellular_data_client.cpp index 1465c95c209b39f50b081aef12f6e27e41d92104..6c61292804967abe1204ebb548c1a9873db8fe9b 100644 --- a/frameworks/native/cellular_data_client.cpp +++ b/frameworks/native/cellular_data_client.cpp @@ -452,16 +452,6 @@ bool CellularDataClient::IsCellularDataSysAbilityExist(sptr &obje return true; } -int32_t CellularDataClient::EstablishAllApnsIfConnectable(int32_t slotId) -{ - sptr proxy = GetProxy(); - if (proxy == nullptr) { - TELEPHONY_LOGE("proxy is null"); - return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; - } - return proxy->EstablishAllApnsIfConnectable(slotId); -} - int32_t CellularDataClient::ReleaseCellularDataConnection(int32_t slotId) { sptr proxy = GetProxy(); diff --git a/interfaces/innerkits/cellular_data_client.h b/interfaces/innerkits/cellular_data_client.h index d5f3ff30db0646694edd6c43751667b9d379280d..3179746e76d1725468d7a161ee0e9fbcb13fe215 100644 --- a/interfaces/innerkits/cellular_data_client.h +++ b/interfaces/innerkits/cellular_data_client.h @@ -209,8 +209,6 @@ public: */ int32_t InitCellularDataController(int32_t slotId); - int32_t EstablishAllApnsIfConnectable(int32_t slotId); - /** * @brief Release cellular data connection. * diff --git a/interfaces/innerkits/cellular_data_ipc_interface_code.h b/interfaces/innerkits/cellular_data_ipc_interface_code.h index bededf75cd3307905647d154465e815cc448200c..f60323d5c84e577db98c2196edfab2bdcac0feb9 100644 --- a/interfaces/innerkits/cellular_data_ipc_interface_code.h +++ b/interfaces/innerkits/cellular_data_ipc_interface_code.h @@ -43,7 +43,6 @@ enum class CellularDataInterfaceCode { ENABLE_INTELLIGENCE_SWITCH, INIT_CELLULAR_DATA_CONTROLLER, GET_INTELLIGENCE_SWITCH_STATE, - ESTABLISH_ALL_APNS_IF_CONNECTABLE, RELEASE_CELLULAR_DATA_CONNECTION, GET_CELLULAR_DATA_SUPPLIERID, CORRECT_NET_SUPPLIER_NO_AVAILABLE, diff --git a/services/include/cellular_data_controller.h b/services/include/cellular_data_controller.h index d8429e70e0eed8c6758fdc18b7dc2aff87e94399..7c8e8cb26645daa56d4f75657635bedc0db6f6d2 100644 --- a/services/include/cellular_data_controller.h +++ b/services/include/cellular_data_controller.h @@ -54,7 +54,6 @@ public: void IsNeedDoRecovery(bool needDoRecovery) const; bool ChangeConnectionForDsds(bool enable) const; int32_t GetIntelligenceSwitchState(bool &switchState); - bool EstablishAllApnsIfConnectable() const; bool AddUid(const NetRequest &request); bool RemoveUid(const NetRequest &request); bool ReleaseCellularDataConnection() const; diff --git a/services/include/cellular_data_service.h b/services/include/cellular_data_service.h index c18af7b780334fe06702057b71146784ba98acfb..22c31e686c25b585defbab1a385d7ce64718e676 100644 --- a/services/include/cellular_data_service.h +++ b/services/include/cellular_data_service.h @@ -87,7 +87,6 @@ public: int32_t EnableIntelligenceSwitch(bool enable) override; int32_t InitCellularDataController(int32_t slotId) override; int32_t GetIntelligenceSwitchState(bool &switchState) override; - int32_t EstablishAllApnsIfConnectable(int32_t slotId) override; int32_t ReleaseCellularDataConnection(int32_t slotId) override; int32_t GetCellularDataSupplierId(int32_t slotId, uint64_t capability, uint32_t &supplierId) override; int32_t CorrectNetSupplierNoAvailable(int32_t slotId) override; diff --git a/services/src/cellular_data_controller.cpp b/services/src/cellular_data_controller.cpp index a12aaffb95bbbae2e9273a8d93fbe1693fe5cbe1..29d59918a8d847de259b9eb4cbdd3e1c4fb8c8ba 100644 --- a/services/src/cellular_data_controller.cpp +++ b/services/src/cellular_data_controller.cpp @@ -461,17 +461,6 @@ void CellularDataController::IsNeedDoRecovery(bool needDoRecovery) const cellularDataHandler_->IsNeedDoRecovery(needDoRecovery); } -bool CellularDataController::EstablishAllApnsIfConnectable() const -{ - if (cellularDataHandler_ == nullptr) { - TELEPHONY_LOGE("Slot%{public}d: cellularDataHandler is null", slotId_); - return false; - } - TELEPHONY_LOGI("EstablishAllApnsIfConnectable slot%{public}d", slotId_); - cellularDataHandler_->EstablishAllApnsIfConnectable(); - return true; -} - bool CellularDataController::ReleaseCellularDataConnection() const { if (cellularDataHandler_ == nullptr) { diff --git a/test/cellular_data_client_test.cpp b/test/cellular_data_client_test.cpp index 7327d02c5eb22470e1606e1a6ed8134936dea883..8ab7406cda0fc197eb30c386bd72970f29a66624 100644 --- a/test/cellular_data_client_test.cpp +++ b/test/cellular_data_client_test.cpp @@ -178,17 +178,6 @@ HWTEST_F(CellularDataClientTest, SetDefaultCellularDataSlotId_002, TestSize.Leve EXPECT_NE(result, 0); } -/** - * @tc.number EstablishAllApnsIfConnectable_001 - * @tc.name test function branch - * @tc.desc Function test - */ -HWTEST_F(CellularDataClientTest, EstablishAllApnsIfConnectable_001, TestSize.Level0) -{ - int32_t result = CellularDataClient::GetInstance().EstablishAllApnsIfConnectable(0); - EXPECT_EQ(result, TELEPHONY_ERR_PERMISSION_ERR); -} - /** * @tc.number ReleaseCellularDataConnection_001 * @tc.name test function branch diff --git a/test/zero_branch_test.cpp b/test/zero_branch_test.cpp index ab31cdd17411d2b7c8613f5674bfbb71e04725b8..0a130abd27438806a020441a963e10e1bbabd7e1 100644 --- a/test/zero_branch_test.cpp +++ b/test/zero_branch_test.cpp @@ -1051,7 +1051,6 @@ HWTEST_F(BranchTest, Telephony_CellularDataController_001, Function | MediumTest ASSERT_FALSE(controller.ClearAllConnections(reason)); ASSERT_FALSE(controller.ChangeConnectionForDsds(false)); controller.UnRegisterEvents(); - ASSERT_FALSE(controller.EstablishAllApnsIfConnectable()); ASSERT_FALSE(controller.HandleApnChanged()); ASSERT_FALSE(controller.GetCellularDataFlowType()); } @@ -1104,7 +1103,6 @@ HWTEST_F(BranchTest, Telephony_CellularDataController_002, Function | MediumTest controller.HasInternetCapability(0); DisConnectionReason reason = DisConnectionReason::REASON_NORMAL; ASSERT_TRUE(controller.ClearAllConnections(reason)); - ASSERT_TRUE(controller.EstablishAllApnsIfConnectable()); controller.ChangeConnectionForDsds(false); ASSERT_FALSE(controller.GetCellularDataFlowType()); controller.UnRegisterEvents();