• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "permission_manager_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedHardware {
22 DM_IMPLEMENT_SINGLE_INSTANCE(PermissionManager);
CheckProcessNameValidOnPinHolder(const std::string & processName)23 bool PermissionManager::CheckProcessNameValidOnPinHolder(const std::string &processName)
24 {
25     return DmPermissionManager::dmPermissionManager->CheckProcessNameValidOnPinHolder(processName);
26 }
27 
CheckProcessNameValidOnAuthCode(const std::string & processName)28 bool PermissionManager::CheckProcessNameValidOnAuthCode(const std::string &processName)
29 {
30     return DmPermissionManager::dmPermissionManager->CheckProcessNameValidOnAuthCode(processName);
31 }
32 
GetCallerProcessName(std::string & processName)33 int32_t PermissionManager::GetCallerProcessName(std::string &processName)
34 {
35     return DmPermissionManager::dmPermissionManager->GetCallerProcessName(processName);
36 }
37 
CheckProcessNameValidOnSetDnPolicy(const std::string & processName)38 bool PermissionManager::CheckProcessNameValidOnSetDnPolicy(const std::string &processName)
39 {
40     return DmPermissionManager::dmPermissionManager->CheckProcessNameValidOnSetDnPolicy(processName);
41 }
42 
CheckProcessNameValidOnGetDeviceInfo(const std::string & processName)43 bool PermissionManager::CheckProcessNameValidOnGetDeviceInfo(const std::string &processName)
44 {
45     return DmPermissionManager::dmPermissionManager->CheckProcessNameValidOnGetDeviceInfo(processName);
46 }
47 } // namespace DistributedHardware
48 } // namespace OHOS