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 #include "cardEmulation.h"
16 #include "loghelper.h"
17 #include "nfc_sdk_common.h"
18 
19 namespace OHOS {
20 namespace NFC {
21 namespace KITS {
22 
CardEmulation()23 CardEmulation::CardEmulation()
24 {
25     DebugLog("[cardEmulation::cardEmulation] new ability manager");
26 }
27 
~CardEmulation()28 CardEmulation::~CardEmulation()
29 {
30     DebugLog("destruct cardEmulation");
31 }
32 
GetInstance()33 CardEmulation &CardEmulation::GetInstance()
34 {
35     static CardEmulation instance;
36     return instance;
37 }
38 
IsSupported(FeatureType feature)39 bool CardEmulation::IsSupported(FeatureType feature)
40 {
41     DebugLog("cardEmulation::IsSupported in.");
42     switch (feature) {
43         case HCE: {
44             DebugLog("cardEmulation::HCE card emulation is supported.");
45             break;
46         }
47         case UICC: {
48             DebugLog("cardEmulation::UICC card emulation is supported.");
49             break;
50         }
51         case ESE: {
52             DebugLog("cardEmulation::ESE card emulation is supported.");
53             break;
54         }
55         default:
56             DebugLog("cardEmulation:: card emulation is not supported.");
57             return false;
58     }
59     return true;
60 }
61 }  // namespace KITS
62 }  // namespace NFC
63 }  // namespace OHOS