1 /*
2 * Copyright (c) 2021-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
16 #include "accesstoken_kit.h"
17 #include "account_log_wrapper.h"
18 #include "tokenid_kit.h"
19
20 using namespace OHOS::AccountSA;
21
22 namespace OHOS {
23 namespace Security {
24 namespace AccessToken {
VerifyAccessToken(unsigned int tokenID,const std::string & permissionName)25 int AccessTokenKit::VerifyAccessToken(unsigned int tokenID, const std::string &permissionName)
26 {
27 ACCOUNT_LOGI("mock permissionName = %{public}s", permissionName.c_str());
28
29 return PERMISSION_GRANTED;
30 }
31
GetHapTokenInfo(AccessTokenID tokenID,HapTokenInfo & hapTokenInfoRes)32 int AccessTokenKit::GetHapTokenInfo(AccessTokenID tokenID, HapTokenInfo& hapTokenInfoRes)
33 {
34 ACCOUNT_LOGI("mock GetHapTokenInfo enter");
35 hapTokenInfoRes.instIndex = 0;
36 return 0;
37 }
38
GetTokenType(AccessTokenID tokenID)39 ATokenTypeEnum AccessTokenKit::GetTokenType(AccessTokenID tokenID)
40 {
41 ACCOUNT_LOGI("mock GetHapTokenInfo enter");
42 return TOKEN_SHELL;
43 }
44
IsSystemAppByFullTokenID(uint64_t tokenId)45 bool TokenIdKit::IsSystemAppByFullTokenID(uint64_t tokenId)
46 {
47 return true;
48 }
49 } // namespace AccessToken
50 } // namespace Security
51 } // namespace OHOS
52