diff --git a/interfaces/innerkits/rust/tests/BUILD.gn b/interfaces/innerkits/rust/tests/BUILD.gn index ac817642050064260d0d1aaf69485c765b031ac2..a1a3dc335c53e29a93c16c3fa80dd75903df284b 100644 --- a/interfaces/innerkits/rust/tests/BUILD.gn +++ b/interfaces/innerkits/rust/tests/BUILD.gn @@ -69,12 +69,19 @@ ohos_rust_systemtest("rust_samgr_sdv_test") { "//third_party/rust/crates/cxx:lib", ] external_deps = [ - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "hilog:hilog_rust", "ipc:ipc_rust", "safwk:system_ability_fwk_rust", ] + defines = [] + if (defined(global_parts_info) && + defined(global_parts_info.security_access_token)) { + external_deps += [ + "access_token:libnativetoken", + "access_token:libtoken_setproc", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } subsystem_name = "systemabilitymgr" part_name = "samgr" diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index ec3d8c96c83cf40acdd0340e92c5527e28d63b81..5dc9cc6e90a4452f33cba4fe45330873579d39d4 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -20,7 +20,9 @@ #include #include "ability_death_recipient.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "accesstoken_kit.h" +#endif #include "datetime_ex.h" #include "directory_ex.h" #include "errors.h" @@ -2034,6 +2036,8 @@ int32_t SystemAbilityManager::GetOnDemandSystemAbilityIds(std::vector& int32_t SystemAbilityManager::SendStrategy(int32_t type, std::vector& systemAbilityIds, int32_t level, std::string& action) { +#ifdef support_access_token + HILOGE("SendStrategy if start"); HILOGD("SendStrategy begin"); uint32_t accessToken = IPCSkeleton::GetCallingTokenID(); Security::AccessToken::NativeTokenInfo nativeTokenInfo; @@ -2042,6 +2046,7 @@ int32_t SystemAbilityManager::SendStrategy(int32_t type, std::vector& s HILOGW("SendStrategy reject used by %{public}s", nativeTokenInfo.processName.c_str()); return ERR_PERMISSION_DENIED; } +#endif for (auto saId : systemAbilityIds) { CommonSaProfile saProfile; diff --git a/services/samgr/native/source/system_ability_manager_dumper.cpp b/services/samgr/native/source/system_ability_manager_dumper.cpp index 1dfcd431e01889c1f15009763058ed253944b612..d89ec377315dfc13287c4c9727888b2223ac6a18 100644 --- a/services/samgr/native/source/system_ability_manager_dumper.cpp +++ b/services/samgr/native/source/system_ability_manager_dumper.cpp @@ -15,7 +15,9 @@ #include "system_ability_manager_dumper.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "accesstoken_kit.h" +#endif #include "ffrt_inner.h" #include "file_ex.h" #include "ipc_skeleton.h" @@ -500,6 +502,8 @@ bool SystemAbilityManagerDumper::Dump(std::shared_ptr #include +#ifdef SUPPORT_ACCESS_TOKEN #include "accesstoken_kit.h" +#endif #include "datetime_ex.h" #include "errors.h" #include "hitrace_meter.h" @@ -102,7 +104,9 @@ namespace { } } +#ifdef SUPPORT_ACCESS_TOKEN using namespace OHOS::Security; +#endif namespace OHOS { namespace { constexpr const char *EXT_TRANSACTION_PERMISSION = "ohos.permission.ACCESS_EXT_SYSTEM_ABILITY"; @@ -1083,20 +1087,32 @@ int32_t SystemAbilityManagerStub::GetOnDemandSystemAbilityIdsInner(MessageParcel bool SystemAbilityManagerStub::CanRequest() { +#ifdef SUPPORT_ACCESS_TOKEN auto tid = IPCSkeleton::GetCallingTokenID(); + HILOGE("CanRequest if start tid:%{public}u", tid); AccessToken::ATokenTypeEnum tokenType = AccessToken::AccessTokenKit::GetTokenTypeFlag(tid); if (tokenType != AccessToken::ATokenTypeEnum::TOKEN_NATIVE) { KHILOGE("CanRequest callingTkid:%{public}u, tokenType:%{public}d", tid, tokenType); return false; } return true; +#else + HILOGE("CanRequest else start"); + return true; +#endif } bool SystemAbilityManagerStub::CheckPermission(const std::string& permission) { +#ifdef SUPPORT_ACCESS_TOKEN + HILOGE("CheckPermission if start"); uint32_t accessToken = IPCSkeleton::GetCallingTokenID(); int32_t ret = Security::AccessToken::AccessTokenKit::VerifyAccessToken(accessToken, permission); return (ret == Security::AccessToken::PermissionState::PERMISSION_GRANTED); +#else + HILOGE("CheckPermission else start"); + return true; +#endif } int32_t SystemAbilityManagerStub::GetExtensionSaIdsInner(MessageParcel& data, MessageParcel& reply) diff --git a/services/samgr/native/source/system_ability_manager_util.cpp b/services/samgr/native/source/system_ability_manager_util.cpp index bd8aa7f9fea84943229228e0c4ed510f47cd2291..c018db4df1e1a2ab87c6d714fd16d99a7628b902 100644 --- a/services/samgr/native/source/system_ability_manager_util.cpp +++ b/services/samgr/native/source/system_ability_manager_util.cpp @@ -17,7 +17,9 @@ #include "system_ability_manager.h" #include "system_ability_manager_util.h" #include "parameter.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "accesstoken_kit.h" +#endif #include "ipc_skeleton.h" #include "string_ex.h" #include "tools.h" @@ -108,6 +110,8 @@ bool SamgrUtil::CheckCallerProcess(const CommonSaProfile& saProfile) bool SamgrUtil::CheckCallerProcess(const std::string& callProcess) { +#ifdef SUPPORT_ACCESS_TOKEN + HILOGE("CheckCallerProcess if start"); uint32_t accessToken = IPCSkeleton::GetCallingTokenID(); Security::AccessToken::NativeTokenInfo nativeTokenInfo; int32_t tokenInfoResult = Security::AccessToken::AccessTokenKit::GetNativeTokenInfo(accessToken, nativeTokenInfo); @@ -121,6 +125,10 @@ bool SamgrUtil::CheckCallerProcess(const std::string& callProcess) return false; } return true; +#else + HILOGE("CheckCallerProcess else start"); + return true; +#endif } bool SamgrUtil::CheckAllowUpdate(OnDemandPolicyType type, const CommonSaProfile& saProfile) diff --git a/services/samgr/native/test/unittest/BUILD.gn b/services/samgr/native/test/unittest/BUILD.gn index 5b33a54b8f2f74040491c0023e497069cff804fd..46adabb3121c8759a3160d8a33ffd8d392c2baef 100644 --- a/services/samgr/native/test/unittest/BUILD.gn +++ b/services/samgr/native/test/unittest/BUILD.gn @@ -101,8 +101,6 @@ ohos_unittest("SystemAbilityMgrTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", @@ -123,6 +121,13 @@ ohos_unittest("SystemAbilityMgrTest") { defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] } } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } if (hicollie_able) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] @@ -202,8 +207,6 @@ ohos_unittest("SystemAbilityMgrCollectTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", @@ -229,6 +232,14 @@ ohos_unittest("SystemAbilityMgrCollectTest") { defines += [ "HICOLLIE_ENABLE" ] } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } + if (preferences_enable) { external_deps += [ "preferences:native_preferences" ] sources += @@ -316,8 +327,6 @@ ohos_unittest("SystemAbilityMgrDeviceNetworkingTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", @@ -338,6 +347,13 @@ ohos_unittest("SystemAbilityMgrDeviceNetworkingTest") { defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] } } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } if (hicollie_able) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] @@ -403,8 +419,6 @@ ohos_unittest("SystemAbilityMgrStubTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", @@ -436,6 +450,14 @@ ohos_unittest("SystemAbilityMgrStubTest") { external_deps += [ "device_manager:devicemanagersdk" ] defines += [ "SUPPORT_DEVICE_MANAGER" ] } + + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } } ohos_unittest("SystemAbilityMgrProxyTest") { @@ -476,8 +498,6 @@ ohos_unittest("SystemAbilityMgrProxyTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", @@ -485,6 +505,14 @@ ohos_unittest("SystemAbilityMgrProxyTest") { "ipc:ipc_single", "json:nlohmann_json_static", ] + defines = [] + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } } ohos_unittest("LocalAbilityManagerProxyTest") { @@ -571,8 +599,6 @@ ohos_unittest("SystemAbilityStateSchedulerTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", @@ -587,6 +613,14 @@ ohos_unittest("SystemAbilityStateSchedulerTest") { "json:nlohmann_json_static", "safwk:system_ability_fwk", ] + defines = [] + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } if (support_device_manager) { external_deps += [ "device_manager:devicemanagersdk" ] @@ -635,8 +669,6 @@ ohos_unittest("SystemAbilityMgrDumperTest") { external_deps = [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "ffrt:libffrt", "googletest:gtest_main", @@ -650,6 +682,14 @@ ohos_unittest("SystemAbilityMgrDumperTest") { "json:nlohmann_json_static", "safwk:system_ability_fwk", ] + defines = [] + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } } ohos_executable("manual_ondemand") { @@ -669,8 +709,6 @@ ohos_executable("manual_ondemand") { cflags += [ "-DBINDER_IPC_32BIT" ] } external_deps = [ - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "hilog:libhilog", "init:libbeget_proxy", @@ -684,6 +722,13 @@ ohos_executable("manual_ondemand") { external_deps += [ "dsoftbus:softbus_client" ] defines += [ "SUPPORT_SOFTBUS" ] } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } part_name = "samgr" subsystem_name = "systemabilitymgr" } @@ -705,8 +750,6 @@ ohos_executable("ondemand") { cflags += [ "-DBINDER_IPC_32BIT" ] } external_deps = [ - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "hilog:libhilog", "init:libbeget_proxy", @@ -720,6 +763,13 @@ ohos_executable("ondemand") { external_deps += [ "dsoftbus:softbus_client" ] defines += [ "SUPPORT_SOFTBUS" ] } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } part_name = "samgr" subsystem_name = "systemabilitymgr" } @@ -788,6 +838,14 @@ ohos_executable("TestTool") { defines += [ "SUPPORT_SOFTBUS" ] } + if (support_access_token) { + external_deps += [ + "access_token:libnativetoken_shared", + "access_token:libtokensetproc_shared", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } + if (support_device_manager) { sources += [ "${samgr_services_dir}/source/collect/device_networking_collect.cpp" ] @@ -796,8 +854,6 @@ ohos_executable("TestTool") { } external_deps += [ "access_token:libaccesstoken_sdk", - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", diff --git a/services/samgr/native/test/unittest/rust/service/BUILD.gn b/services/samgr/native/test/unittest/rust/service/BUILD.gn index c1e6701a170dfd2afa29b569feb6d5a228399aed..1f4cd215d7eef836ac71a24149827c5b35de8d9b 100644 --- a/services/samgr/native/test/unittest/rust/service/BUILD.gn +++ b/services/samgr/native/test/unittest/rust/service/BUILD.gn @@ -18,12 +18,16 @@ ohos_rust_shared_library("test_access_token") { "src/access_token.rs", "src/lib.rs", ] - - external_deps = [ - "access_token:libnativetoken_shared", - "access_token:libtokensetproc_shared", - ] - + external_deps = [] + defines = [] + if (defined(global_parts_info) && + defined(global_parts_info.security_access_token)) { + external_deps += [ + "access_token:libnativetoken", + "access_token:libtoken_setproc", + ] + defines += [ "SUPPORT_ACCESS_TOKEN" ] + } crate_name = "test_access_token" crate_type = "dylib" subsystem_name = "systemabilitymgr" diff --git a/services/samgr/native/test/unittest/src/manual_ondemand_helper.cpp b/services/samgr/native/test/unittest/src/manual_ondemand_helper.cpp index 1951a872e2a187c6ad39c11f7fe2446f39916abf..c0cd116f785d8a388367b124d5d06c1350c51850 100644 --- a/services/samgr/native/test/unittest/src/manual_ondemand_helper.cpp +++ b/services/samgr/native/test/unittest/src/manual_ondemand_helper.cpp @@ -27,14 +27,18 @@ #include "iremote_object.h" #include "iservice_registry.h" #include "isystem_ability_load_callback.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "nativetoken_kit.h" +#endif #include "sam_mock_permission.h" #ifdef SUPPORT_SOFTBUS #include "softbus_bus_center.h" #endif #include "system_ability_ondemand_reason.h" #include "system_ability_definition.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "token_setproc.h" +#endif #include "parameter.h" #include "parameters.h" diff --git a/services/samgr/native/test/unittest/src/mock_accesstoken_kit.cpp b/services/samgr/native/test/unittest/src/mock_accesstoken_kit.cpp index 44d6ed2c34611756d89323653a8af0cffecfa908..a49a0f17e1604c69c01458311482db240074e225 100644 --- a/services/samgr/native/test/unittest/src/mock_accesstoken_kit.cpp +++ b/services/samgr/native/test/unittest/src/mock_accesstoken_kit.cpp @@ -13,6 +13,7 @@ * limitations under the License. */ +#ifdef SUPPORT_ACCESS_TOKEN #include "accesstoken_kit.h" namespace OHOS { @@ -22,4 +23,5 @@ int AccessTokenKit::VerifyAccessToken(AccessTokenID tokenID, const std::string& return PERMISSION_GRANTED; } } // namespace Security::AccessToken -} // namespace OHOS \ No newline at end of file +} // namespace OHOS +#endif \ No newline at end of file diff --git a/services/samgr/native/test/unittest/src/mock_permission.cpp b/services/samgr/native/test/unittest/src/mock_permission.cpp index b5c444bf939b26eecae90434445cca315d0867e4..3b84a2ecc5005394491024c305a013cea1c366f9 100644 --- a/services/samgr/native/test/unittest/src/mock_permission.cpp +++ b/services/samgr/native/test/unittest/src/mock_permission.cpp @@ -14,13 +14,18 @@ */ #include "sam_mock_permission.h" +#include "sam_log.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "nativetoken_kit.h" #include "token_setproc.h" +#endif namespace OHOS { void SamMockPermission::MockPermission() { +#ifdef SUPPORT_ACCESS_TOKEN + HILOGE("MockPermission if start"); static const char *PERMS[] = { "ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.ACCESS_EXT_SYSTEM_ABILITY" @@ -38,10 +43,13 @@ void SamMockPermission::MockPermission() }; tokenId = GetAccessTokenId(&infoInstance); SetSelfTokenID(tokenId); +#endif } void SamMockPermission::MockProcess(const char* processName) { +#ifdef SUPPORT_ACCESS_TOKEN + HILOGE("MockProcess if start"); static const char *PERMS[] = { "ohos.permission.DISTRIBUTED_DATASYNC" }; @@ -58,5 +66,6 @@ void SamMockPermission::MockProcess(const char* processName) }; tokenId = GetAccessTokenId(&infoInstance); SetSelfTokenID(tokenId); +#endif } } \ No newline at end of file diff --git a/services/samgr/native/test/unittest/src/ondemand_helper.cpp b/services/samgr/native/test/unittest/src/ondemand_helper.cpp index 78a8da1c93c14c6beb56e96d9cdd9f2f086fe0ce..42c6a509efb013d70056090112ec09bf04d309d0 100644 --- a/services/samgr/native/test/unittest/src/ondemand_helper.cpp +++ b/services/samgr/native/test/unittest/src/ondemand_helper.cpp @@ -27,14 +27,18 @@ #include "iremote_object.h" #include "iservice_registry.h" #include "isystem_ability_load_callback.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "nativetoken_kit.h" +#endif #include "sam_mock_permission.h" #ifdef SUPPORT_SOFTBUS #include "softbus_bus_center.h" #endif #include "system_ability_ondemand_reason.h" #include "system_ability_definition.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "token_setproc.h" +#endif #include "parameter.h" #include "parameters.h" diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp index 46b7e5017223a5d22f6dd121463930abeec004b5..ac9ee905f1785853c954ae75bbf5c2984bff94cb 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp @@ -1183,7 +1183,13 @@ HWTEST_F(SystemAbilityMgrProxyTest, SendStrategy001, TestSize.Level1) int32_t level = 1; std::string action = ""; int32_t res = samgrProxy->SendStrategy(type, saIds, level, action); +#ifdef SUPPORT_ACCESS_TOKEN EXPECT_EQ(res, ERR_PERMISSION_DENIED); + DTEST_LOG << "SendStrategy001 ERR_PERMISSION_DENIED" << std::endl; +#else + EXPECT_EQ(res, ERR_INVALID_VALUE); + DTEST_LOG << "SendStrategy001 ERR_INVALID_VALUE" << std::endl; +#endif } /** @@ -1222,7 +1228,13 @@ HWTEST_F(SystemAbilityMgrProxyTest, GetRunningSaExtensionInfoList001, TestSize.L std::vector infoList; int32_t ret = samgrProxy->GetRunningSaExtensionInfoList("backup_test", infoList); +#ifdef SUPPORT_ACCESS_TOKEN EXPECT_EQ(ret, 1); + DTEST_LOG << "ret 1" << std::endl; +#else + EXPECT_EQ(ret, 0); + DTEST_LOG << "ret 0" << std::endl; +#endif EXPECT_EQ(infoList.size(), 0); } diff --git a/services/samgr/native/test/unittest/src/system_ability_test_tool.cpp b/services/samgr/native/test/unittest/src/system_ability_test_tool.cpp index 04035884a865c666f8b60b239c6a3687b9b9ed29..1f62ee66b6fd4e988f719a7e7da2232aea6dba9d 100644 --- a/services/samgr/native/test/unittest/src/system_ability_test_tool.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_test_tool.cpp @@ -21,7 +21,9 @@ #include "if_system_ability_manager.h" #include "iservice_registry.h" #include "itest_transaction_service.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "nativetoken_kit.h" +#endif #include "sam_log.h" #ifdef SUPPORT_SOFTBUS #include "softbus_bus_center.h" @@ -30,7 +32,9 @@ #include "system_ability_definition.h" #include "system_ability_load_callback_stub.h" #include "system_ability_status_change_stub.h" +#ifdef SUPPORT_ACCESS_TOKEN #include "token_setproc.h" +#endif #define private public #include "system_ability_manager.h" @@ -281,6 +285,8 @@ namespace { static void MockProcess(const char* processName) { +#ifdef SUPPORT_ACCESS_TOKEN + HILOGE("MockProcess if tool start"); uint64_t tokenId; NativeTokenInfoParams infoInstance = { .dcapsNum = 0, @@ -294,6 +300,7 @@ namespace { }; tokenId = GetAccessTokenId(&infoInstance); SetSelfTokenID(tokenId); +#endif } static void DoSend(int32_t said, int32_t rssProcess) @@ -415,9 +422,11 @@ static void DoRemote(char* argv[]) int main(int argc, char* argv[]) { +#ifdef SUPPORT_ACCESS_TOKEN static const char *PERMS[] = { "ohos.permission.DISTRIBUTED_DATASYNC" }; + HILOGE("main if tool start"); uint64_t tokenId; NativeTokenInfoParams infoInstance = { .dcapsNum = 0, @@ -431,6 +440,7 @@ int main(int argc, char* argv[]) }; tokenId = GetAccessTokenId(&infoInstance); SetSelfTokenID(tokenId); +#endif if (argc == ARGC_DEFAULT_LENTH) { DoDefault(argv); } else if (argc == ARGC_EXTEND_LENTH) { diff --git a/services/samgr/var.gni b/services/samgr/var.gni index 2fd2d341d310f6503c741839d5379c776f4b726e..61012199b5440581edd69fefaf431710f890bdc5 100644 --- a/services/samgr/var.gni +++ b/services/samgr/var.gni @@ -18,6 +18,7 @@ declare_args() { support_device_manager = false support_common_event = false support_softbus = true + support_access_token = true if (!defined(global_parts_info) || defined(global_parts_info.communication_bluetooth)) { bluetooth_part_enable = true @@ -42,4 +43,8 @@ declare_args() { !defined(global_parts_info.communication_dsoftbus)) { support_softbus = false } + if (defined(global_parts_info) && + !defined(global_parts_info.security_access_token)) { + support_access_token = false + } }