• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
RegisterImsCall()26 void ImsTestHandler::RegisterImsCall()
27 {
28     std::shared_ptr<ImsCallClient> imsCallClient = DelayedSingleton<ImsCallClient>::GetInstance();
29     if (imsCallClient != nullptr) {
30         imsCallClient->RegisterImsCallCallbackHandler(DEFAULT_SLOT_ID, shared_from_this());
31     }
32 }
33 
RegisterImsSms()34 void ImsTestHandler::RegisterImsSms()
35 {
36     std::shared_ptr<ImsSmsClient> imsSmsClient = DelayedSingleton<ImsSmsClient>::GetInstance();
37     if (imsSmsClient != nullptr) {
38         imsSmsClient->RegisterImsSmsCallbackHandler(DEFAULT_SLOT_ID, shared_from_this());
39     }
40 }
41 
RegisterImsCoreService()42 void ImsTestHandler::RegisterImsCoreService()
43 {
44     std::shared_ptr<ImsCoreServiceClient> imsCoreServiceClient = DelayedSingleton<ImsCoreServiceClient>::GetInstance();
45     if (imsCoreServiceClient != nullptr) {
46         imsCoreServiceClient->RegisterImsCoreServiceCallbackHandler(DEFAULT_SLOT_ID, shared_from_this());
47     }
48 }
49 
ProcessEvent(const AppExecFwk::InnerEvent::Pointer & event)50 void ImsTestHandler::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
51 {
52     TELEPHONY_LOGE("ImsTestHandler::ProcessEvent!");
53 }
54 } // namespace Telephony
55 } // namespace OHOS