12d43be4eSopenharmony_ci/* 22d43be4eSopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd. 32d43be4eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 42d43be4eSopenharmony_ci * you may not use this file except in compliance with the License. 52d43be4eSopenharmony_ci * You may obtain a copy of the License at 62d43be4eSopenharmony_ci * 72d43be4eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 82d43be4eSopenharmony_ci * 92d43be4eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 102d43be4eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 112d43be4eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 122d43be4eSopenharmony_ci * See the License for the specific language governing permissions and 132d43be4eSopenharmony_ci * limitations under the License. 142d43be4eSopenharmony_ci */ 152d43be4eSopenharmony_ci 162d43be4eSopenharmony_ci#include "state_notification.h" 172d43be4eSopenharmony_ci 182d43be4eSopenharmony_ci#include "core_manager_inner.h" 192d43be4eSopenharmony_ci#include "telephony_ext_wrapper.h" 202d43be4eSopenharmony_ci#include "telephony_log_wrapper.h" 212d43be4eSopenharmony_ci#include "telephony_state_registry_client.h" 222d43be4eSopenharmony_ci 232d43be4eSopenharmony_cinamespace OHOS { 242d43be4eSopenharmony_cinamespace Telephony { 252d43be4eSopenharmony_ciStateNotification StateNotification::stateNotification_; 262d43be4eSopenharmony_ciStateNotification &StateNotification::GetInstance() 272d43be4eSopenharmony_ci{ 282d43be4eSopenharmony_ci return stateNotification_; 292d43be4eSopenharmony_ci} 302d43be4eSopenharmony_ci 312d43be4eSopenharmony_civoid StateNotification::UpdateCellularDataConnectState(int32_t slotId, ApnProfileState dataState, int32_t networkType) 322d43be4eSopenharmony_ci{ 332d43be4eSopenharmony_ci int32_t state = CellularDataStateAdapter(dataState); 342d43be4eSopenharmony_ci int32_t wrapState = WrapCellularDataState(state); 352d43be4eSopenharmony_ci TELEPHONY_LOGI( 362d43be4eSopenharmony_ci "slotId = %{public}d, wrapState = %{public}d, networkType = %{public}d", slotId, wrapState, networkType); 372d43be4eSopenharmony_ci TelephonyStateRegistryClient::GetInstance().UpdateCellularDataConnectState(slotId, wrapState, networkType); 382d43be4eSopenharmony_ci} 392d43be4eSopenharmony_ci 402d43be4eSopenharmony_civoid StateNotification::OnUpDataFlowtype(int32_t slotId, CellDataFlowType flowType) 412d43be4eSopenharmony_ci{ 422d43be4eSopenharmony_ci TELEPHONY_LOGI("slotId = %{public}d, flowType = %{public}d", slotId, flowType); 432d43be4eSopenharmony_ci TelephonyStateRegistryClient::GetInstance().UpdateCellularDataFlow(slotId, static_cast<int32_t>(flowType)); 442d43be4eSopenharmony_ci} 452d43be4eSopenharmony_ci} // namespace Telephony 462d43be4eSopenharmony_ci} // namespace OHOS