• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 #include "nfc_service_mock.h"
16 #include "nfc_service.h"
17 #include <unistd.h>
18 #include "app_data_parser.h"
19 #include "infc_controller_callback.h"
20 #include "iservice_registry.h"
21 #include "loghelper.h"
22 #include "nfc_preferences.h"
23 #include "nfc_event_handler.h"
24 #include "nfc_event_publisher.h"
25 #include "nfc_hisysevent.h"
26 #include "nfc_polling_params.h"
27 #include "nfc_sdk_common.h"
28 #include "nfc_timer.h"
29 #include "nfc_watch_dog.h"
30 #include "tag_session.h"
31 #include "external_deps_proxy.h"
32 #include "want.h"
33 #include "nci_nfcc_proxy.h"
34 #include "nci_tag_proxy.h"
35 #include "nci_ce_proxy.h"
36 #include "hce_session.h"
37 
38 namespace OHOS {
39 namespace NFC {
NfcService()40 NfcService::NfcService() {}
~NfcService()41 NfcService::~NfcService() {}
Initialize()42 bool NfcService::Initialize()
43 {
44     nciTagProxy_ = std::make_shared<NFC::NCI::NciTagProxy>();
45     return true;
46 }
47 
GetInstance() const48 std::weak_ptr<NfcService> NfcService::GetInstance() const
49 {
50     auto nfcService = std::make_shared<NfcService>();
51     std::weak_ptr<NfcService> ret = nfcService;
52     return nfcService;
53 }
54 
OnTagDiscovered(uint32_t tagDiscId)55 void NfcService::OnTagDiscovered(uint32_t tagDiscId)
56 {
57 }
58 
OnTagLost(uint32_t tagDiscId)59 void NfcService::OnTagLost(uint32_t tagDiscId)
60 {
61 }
62 
FieldActivated()63 void NfcService::FieldActivated()
64 {
65 }
66 
FieldDeactivated()67 void NfcService::FieldDeactivated()
68 {
69 }
70 
OnVendorEvent(int eventType,int arg1,std::string arg2)71 void NfcService::OnVendorEvent(int eventType, int arg1, std::string arg2)
72 {
73 }
74 
OnCardEmulationData(const std::vector<uint8_t> & data)75 void NfcService::OnCardEmulationData(const std::vector<uint8_t>& data)
76 {
77 }
78 
OnCardEmulationActivated()79 void NfcService::OnCardEmulationActivated()
80 {
81 }
82 
OnCardEmulationDeactivated()83 void NfcService::OnCardEmulationDeactivated()
84 {
85 }
86 
GetTagServiceIface()87 OHOS::sptr<IRemoteObject> NfcService::GetTagServiceIface()
88 {
89     return nullptr;
90 }
91 
GetHceServiceIface()92 OHOS::sptr<IRemoteObject> NfcService::GetHceServiceIface()
93 {
94     return nullptr;
95 }
96 
IsNfcEnabled()97 bool NfcService::IsNfcEnabled()
98 {
99     return true;
100 }
101 
GetNfcState()102 int NfcService::GetNfcState()
103 {
104     return 0;
105 }
106 
GetScreenState()107 int NfcService::GetScreenState()
108 {
109     return 0;
110 }
111 
GetNciVersion()112 int NfcService::GetNciVersion()
113 {
114     return 0;
115 }
116 
GetNciNfccProxy(void)117 std::weak_ptr<NCI::INciNfccInterface> NfcService::GetNciNfccProxy(void)
118 {
119     std::weak_ptr<NCI::INciNfccInterface> ret;
120     return ret;
121 }
122 
GetNciTagProxy(void)123 std::weak_ptr<NCI::INciTagInterface> NfcService::GetNciTagProxy(void)
124 {
125     return nciTagProxy_;
126 }
127 
GetNfcPollingManager()128 std::weak_ptr<NfcPollingManager> NfcService::GetNfcPollingManager()
129 {
130     std::weak_ptr<NfcPollingManager> ret;
131     return ret;
132 }
133 
GetNfcRoutingManager()134 std::weak_ptr<NfcRoutingManager> NfcService::GetNfcRoutingManager()
135 {
136     std::weak_ptr<NfcRoutingManager> ret;
137     return ret;
138 }
139 
GetCeService()140 std::weak_ptr<CeService> NfcService::GetCeService()
141 {
142     std::weak_ptr<CeService> ret;
143     return ret;
144 }
145 
GetSimVendorBundleName()146 std::string NfcService::GetSimVendorBundleName()
147 {
148     return "";
149 }
150 
GetTagDispatcher()151 std::weak_ptr<TAG::TagDispatcher> NfcService::GetTagDispatcher()
152 {
153     std::weak_ptr<TAG::TagDispatcher> ret;
154     return ret;
155 }
156 
NotifyMessageToVendor(int key,const std::string & value)157 void NfcService::NotifyMessageToVendor(int key, const std::string &value)
158 {
159 }
160 }  // namespace NFC
161 }  // namespace OHOS