mirror of
https://github.com/openharmony/security_access_token.git
synced 2026-08-24 14:42:49 -04:00
蓝黄差异
Signed-off-by: chennian <chennian1@huawei.com> Change-Id: Icd3604ecabb6f77ea09fc4a7075e66306595a3c5
This commit is contained in:
@@ -102,10 +102,7 @@ ohos_unittest("libaccesstoken_sdk_test") {
|
||||
]
|
||||
if (token_sync_enable == true) {
|
||||
cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ]
|
||||
external_deps += [
|
||||
"device_manager:devicemanagersdk",
|
||||
"json:nlohmann_json_static",
|
||||
]
|
||||
external_deps += [ "device_manager:devicemanagersdk" ]
|
||||
}
|
||||
if (dlp_permission_enable == true) {
|
||||
cflags_cc += [ "-DSUPPORT_SANDBOX_APP" ]
|
||||
|
||||
+3
-3
@@ -77,7 +77,7 @@ HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest001, TestSiz
|
||||
HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest002, TestSize.Level0)
|
||||
{
|
||||
std::vector<std::string> reqPerm;
|
||||
MockHapToken("RequestAppPermOnSettingTest002", reqPerm, false);
|
||||
MockHapToken mock("RequestAppPermOnSettingTest002", reqPerm, false);
|
||||
|
||||
AccessTokenID tokenID = 123;
|
||||
ASSERT_EQ(ERR_NOT_SYSTEM_APP, AccessTokenKit::RequestAppPermOnSetting(tokenID));
|
||||
@@ -92,7 +92,7 @@ HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest002, TestSiz
|
||||
HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest003, TestSize.Level0)
|
||||
{
|
||||
std::vector<std::string> reqPerm;
|
||||
MockHapToken("RequestAppPermOnSettingTest003", reqPerm, true);
|
||||
MockHapToken mock("RequestAppPermOnSettingTest003", reqPerm, true);
|
||||
|
||||
HapInfoParams infoManager = {
|
||||
.userID = 1,
|
||||
@@ -133,7 +133,7 @@ HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest003, TestSiz
|
||||
HWTEST_F(RequestPermissionOnSettingTest, RequestAppPermOnSettingTest004, TestSize.Level0)
|
||||
{
|
||||
std::vector<std::string> reqPerm;
|
||||
MockHapToken("RequestAppPermOnSettingTest004", reqPerm, true);
|
||||
MockHapToken mock("RequestAppPermOnSettingTest004", reqPerm, true);
|
||||
|
||||
AccessTokenKit::RequestAppPermOnSetting(GetSelfTokenID());
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ enum ActiveChangeType {
|
||||
PERM_INACTIVE = 0,
|
||||
PERM_ACTIVE_IN_FOREGROUND = 1,
|
||||
PERM_ACTIVE_IN_BACKGROUND = 2,
|
||||
PERM_TEMPORARY_CALL,
|
||||
PERM_TEMPORARY_CALL = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,8 +63,8 @@ enum PrivacyError {
|
||||
ERR_EDM_POLICY_CHECK_FAILED,
|
||||
ERR_PRIVACY_POLICY_CHECK_FAILED,
|
||||
ERR_REMOTE_CONNECTION,
|
||||
ERR_ADD_DEATH_RECIPIENT_FAILED,
|
||||
ERR_FIRST_CALLER_NOT_EDM,
|
||||
ERR_ADD_DEATH_RECIPIENT_FAILED,
|
||||
PRIVACY_TOGGELE_RESTRICTED,
|
||||
};
|
||||
} // namespace AccessToken
|
||||
|
||||
@@ -38,7 +38,7 @@ if (is_standard_system) {
|
||||
"${access_token_path}/frameworks/common/include",
|
||||
"${access_token_path}/frameworks/tokensync/include",
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken/include",
|
||||
"${access_token_path}/interfaces/innerkits/tokensync/include",
|
||||
"include",
|
||||
"src",
|
||||
]
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ if (is_standard_system) {
|
||||
"${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx",
|
||||
"${access_token_path}/frameworks/common:accesstoken_common_cxx",
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libtoken_setproc",
|
||||
"${access_token_path}/services/accesstokenmanager:access_token.rc",
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "token_field_const.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Security {
|
||||
namespace AccessToken {
|
||||
|
||||
@@ -165,13 +165,13 @@ int ShortGrantManager::RefreshPermission(AccessTokenID tokenID, const std::strin
|
||||
return RET_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t maxRemainedTime = maxTime_ - (GetCurrentTime() - iter->firstGrantTimes);
|
||||
uint32_t currRemainedTime = iter->revokeTimes > GetCurrentTime() ? (iter->revokeTimes - GetCurrentTime()) : 0;
|
||||
uint32_t maxRemainedTime = maxTime_ > (GetCurrentTime() - iter->firstGrantTimes) ?
|
||||
(maxTime_ - (GetCurrentTime() - iter->firstGrantTimes)) : 0;
|
||||
uint32_t currRemainedTime = iter->revokeTimes > GetCurrentTime() ?
|
||||
(iter->revokeTimes - GetCurrentTime()) : 0;
|
||||
uint32_t cancelTimes = (maxRemainedTime > onceTime) ? onceTime : maxRemainedTime;
|
||||
LOGI(ATM_DOMAIN, ATM_TAG, "currRemainedTime %{public}d", currRemainedTime);
|
||||
if (cancelTimes > currRemainedTime) {
|
||||
iter->revokeTimes = GetCurrentTime() + cancelTimes;
|
||||
LOGI(ATM_DOMAIN, ATM_TAG, "iter->revokeTimes %{public}d", iter->revokeTimes);
|
||||
ShortGrantManager::GetInstance().CancelTaskOfPermissionRevoking(taskName);
|
||||
int32_t ret = PermissionManager::GetInstance().GrantPermission(tokenID, permission, PERMISSION_USER_FIXED);
|
||||
if (ret != RET_SUCCESS) {
|
||||
|
||||
@@ -98,7 +98,6 @@ ohos_unittest("libaccesstoken_manager_service_coverage_test") {
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/nativetoken:libnativetoken_shared",
|
||||
"${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared",
|
||||
"${access_token_path}/services/accesstokenmanager/idl:access_token_manager_stub",
|
||||
|
||||
@@ -99,7 +99,6 @@ ohos_unittest("libpermission_manager_mock_test") {
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/nativetoken:libnativetoken_shared",
|
||||
"${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared",
|
||||
"${access_token_path}/services/accesstokenmanager/idl:access_token_manager_stub",
|
||||
|
||||
@@ -112,7 +112,6 @@ ohos_unittest("libaccesstoken_manager_service_standard_test") {
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/nativetoken:libnativetoken_shared",
|
||||
"${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc",
|
||||
"${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared",
|
||||
"${access_token_path}/services/accesstokenmanager/idl:access_token_manager_stub",
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef INTERFACES_INNER_KITS_ACCESSTOKEN_PERMISSION_RECORD_CONFIG_H
|
||||
#define INTERFACES_INNER_KITS_ACCESSTOKEN_PERMISSION_RECORD_CONFIG_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace OHOS {
|
||||
namespace Security {
|
||||
namespace AccessToken {
|
||||
class PermissionRecordConfig final {
|
||||
public:
|
||||
int32_t sizeMaxImum;
|
||||
int32_t agingTime;
|
||||
std::string globalDialogBundleName;
|
||||
std::string globalDialogAbilityName;
|
||||
};
|
||||
} // namespace AccessToken
|
||||
} // namespace Security
|
||||
} // namespace OHOS
|
||||
|
||||
#endif // INTERFACES_INNER_KITS_ACCESSTOKEN_PERMISSION_RECORD_CONFIG_H
|
||||
Reference in New Issue
Block a user