1bc2ed2b3Sopenharmony_ci/* 2bc2ed2b3Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 3bc2ed2b3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bc2ed2b3Sopenharmony_ci * you may not use this file except in compliance with the License. 5bc2ed2b3Sopenharmony_ci * You may obtain a copy of the License at 6bc2ed2b3Sopenharmony_ci * 7bc2ed2b3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bc2ed2b3Sopenharmony_ci * 9bc2ed2b3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bc2ed2b3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bc2ed2b3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bc2ed2b3Sopenharmony_ci * See the License for the specific language governing permissions and 13bc2ed2b3Sopenharmony_ci * limitations under the License. 14bc2ed2b3Sopenharmony_ci */ 15bc2ed2b3Sopenharmony_ci#ifndef NFC_PERMISSION_CHECKER_H 16bc2ed2b3Sopenharmony_ci#define NFC_PERMISSION_CHECKER_H 17bc2ed2b3Sopenharmony_ci#include <string> 18bc2ed2b3Sopenharmony_ci 19bc2ed2b3Sopenharmony_cinamespace OHOS { 20bc2ed2b3Sopenharmony_cinamespace NFC { 21bc2ed2b3Sopenharmony_ci// the app need request the permission for open/close nfc operations. 22bc2ed2b3Sopenharmony_ciconst std::string SYS_PERM = "ohos.permission.MANAGE_SECURE_SETTINGS"; 23bc2ed2b3Sopenharmony_ci 24bc2ed2b3Sopenharmony_ci// the app need request the permission for tag operations. 25bc2ed2b3Sopenharmony_ciconst std::string TAG_PERM = "ohos.permission.NFC_TAG"; 26bc2ed2b3Sopenharmony_ci 27bc2ed2b3Sopenharmony_ci// the app need request the permission for card emulation operations. 28bc2ed2b3Sopenharmony_ciconst std::string CARD_EMU_PERM = "ohos.permission.NFC_CARD_EMULATION"; 29bc2ed2b3Sopenharmony_ci 30bc2ed2b3Sopenharmony_ciclass NfcPermissionChecker { 31bc2ed2b3Sopenharmony_cipublic: 32bc2ed2b3Sopenharmony_ci /** 33bc2ed2b3Sopenharmony_ci * @Description : Check the Permission. 34bc2ed2b3Sopenharmony_ci * @param permission - the permission to be checked 35bc2ed2b3Sopenharmony_ci * @return true: granted; false: not granted 36bc2ed2b3Sopenharmony_ci */ 37bc2ed2b3Sopenharmony_ci static bool IsGranted(std::string permission); 38bc2ed2b3Sopenharmony_ci}; 39bc2ed2b3Sopenharmony_ci} // namespace NFC 40bc2ed2b3Sopenharmony_ci} // namespace OHOS 41bc2ed2b3Sopenharmony_ci#endif // NFC_PERMISSION_CHECKER_H 42