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