1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "ims_test_handler.h" 17 18 #include "ims_call_client.h" 19 #include "ims_core_service_client.h" 20 #include "ims_sms_client.h" 21 #include "singleton.h" 22 #include "telephony_log_wrapper.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 const int32_t DEFAULT_SLOT_ID = 0; 27 RegisterImsCall()28void ImsTestHandler::RegisterImsCall() 29 { 30 std::shared_ptr<ImsCallClient> imsCallClient = DelayedSingleton<ImsCallClient>::GetInstance(); 31 if (imsCallClient != nullptr) { 32 imsCallClient->RegisterImsCallCallbackHandler(DEFAULT_SLOT_ID, shared_from_this()); 33 } 34 } 35 RegisterImsSms()36void ImsTestHandler::RegisterImsSms() 37 { 38 std::shared_ptr<ImsSmsClient> imsSmsClient = DelayedSingleton<ImsSmsClient>::GetInstance(); 39 if (imsSmsClient != nullptr) { 40 imsSmsClient->RegisterImsSmsCallbackHandler(DEFAULT_SLOT_ID, shared_from_this()); 41 } 42 } 43 RegisterImsCoreService()44void ImsTestHandler::RegisterImsCoreService() 45 { 46 std::shared_ptr<ImsCoreServiceClient> imsCoreServiceClient = DelayedSingleton<ImsCoreServiceClient>::GetInstance(); 47 if (imsCoreServiceClient != nullptr) { 48 imsCoreServiceClient->RegisterImsCoreServiceCallbackHandler(DEFAULT_SLOT_ID, shared_from_this()); 49 } 50 } 51 ProcessEvent(const AppExecFwk::InnerEvent::Pointer & event)52void ImsTestHandler::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) 53 { 54 TELEPHONY_LOGE("ImsTestHandler::ProcessEvent!"); 55 } 56 } // namespace Telephony 57 } // namespace OHOS