/base/update/updater/test/unittest/utils/ |
D | utils_unittest.cpp | 39 string emptyStr = Utils::Trim(""); 41 emptyStr = Utils::Trim(" "); 43 emptyStr = Utils::Trim("aa "); 51 string newStr = Utils::ConvertSha256Hex(a, 1); 58 vector<string> newStr = Utils::SplitString(str, "\n"); 65 …EXPECT_EQ(Utils::MkdirRecursive("/data/xx?xx", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH), 0… 71 int output = Utils::String2Int<int>(input, 10); 74 output = Utils::String2Int<int>(input, 10); 82 EXPECT_NE(Utils::GetFilesFromDirectory(path, files, true), -1); 88 EXPECT_EQ(Utils::RemoveDir(path), false); [all …]
|
/base/global/resource_management_lite/frameworks/resmgr_lite/src/utils/ |
D | utils.cpp | 26 bool Utils::IsAlphaString(const char *s, int32_t len) in IsAlphaString() 41 bool Utils::IsNumericString(const char *s, int32_t len) in IsNumericString() 67 void Utils::DecodeScript(uint32_t encodeScript, char *outValue) in DecodeScript() 78 bool Utils::IsStrEmpty(const char *s) in IsStrEmpty() 83 size_t Utils::StrLen(const char *s) in StrLen() 91 uint16_t Utils::EncodeLanguage(const char *language) in EncodeLanguage() 93 if (Utils::IsStrEmpty(language)) { in EncodeLanguage() 96 return Utils::EncodeLanguageOrRegion(language, 'a'); in EncodeLanguage() 110 uint64_t Utils::EncodeLocale(const char *language, in EncodeLocale() 114 uint16_t languageData = Utils::EncodeLanguage(language); in EncodeLocale() [all …]
|
/base/security/access_token/services/accesstokenmanager/main/cpp/src/permission/ |
D | permission_definition_cache.cpp | 47 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in Insert() 61 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in Update() 69 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in DeleteByBundleName() 82 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in FindByPermissionName() 95 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsSystemGrantedPermission() 101 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsUserGrantedPermission() 116 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in HasDefinition() 122 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsPermissionDefEmpty() 128 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in StorePermissionDef() 142 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in GetDefPermissionsByTokenId()
|
/base/customization/enterprise_device_management/test/unittest/src/ |
D | utils.cpp | 22 uint64_t Utils::selfTokenId_ = 0; 36 void Utils::ExecCmdSync(const std::string &cmd) in ExecCmdSync() 45 void Utils::SetNativeTokenTypeAndPermissions(const char* permissions[], int size) in SetNativeTokenTypeAndPermissions() 66 void Utils::SetEdmInitialEnv() in SetEdmInitialEnv() 82 …Utils::SetNativeTokenTypeAndPermissions(permissions, sizeof(permissions) / sizeof(permissions[0])); in SetEdmInitialEnv() 83 seteuid(Utils::EDM_UID); in SetEdmInitialEnv() 86 void Utils::ResetTokenTypeAndUid() in ResetTokenTypeAndUid() 88 seteuid(Utils::ROOT_UID); in ResetTokenTypeAndUid() 92 bool Utils::IsOriginalUTEnv() in IsOriginalUTEnv() 94 return Utils::ROOT_UID == geteuid() && selfTokenId_ == GetSelfTokenID(); in IsOriginalUTEnv() [all …]
|
D | edm_sys_manager_test.cpp | 37 Utils::SetEdmServiceEnable(); in SetUp() 42 Utils::SetEdmServiceDisable(); in TearDown() 47 ASSERT_FALSE(Utils::GetEdmServiceState()); in TearDownTestSuite() 48 std::cout << "EdmServiceState : " << Utils::GetEdmServiceState() << std::endl; in TearDownTestSuite()
|
D | edm_data_ability_utils_test.cpp | 43 Utils::SetEdmInitialEnv(); in SetUp() 44 Utils::SetEdmServiceEnable(); in SetUp() 49 Utils::ResetTokenTypeAndUid(); in TearDown() 50 Utils::SetEdmServiceDisable(); in TearDown() 55 ASSERT_FALSE(Utils::GetEdmServiceState()); in TearDownTestSuite() 56 std::cout << "EdmServiceState : " << Utils::GetEdmServiceState() << std::endl; in TearDownTestSuite()
|
/base/global/resource_management_lite/frameworks/resmgr_lite/src/ |
D | locale_matcher.cpp | 30 uint64_t LocaleMatcher::EN_US_ENCODE = Utils::EncodeLocale("en", nullptr, "US"); 31 uint64_t LocaleMatcher::EN_GB_ENCODE = Utils::EncodeLocale("en", nullptr, "GB"); 32 uint64_t LocaleMatcher::EN_QAAG_ENCODE = Utils::EncodeLocale("en", "Qaag", nullptr); 33 uint64_t LocaleMatcher::ZH_HANT_MO_ENCODE = Utils::EncodeLocale("zh", "Hant", "MO"); 34 uint64_t LocaleMatcher::ZH_HK_ENCODE = Utils::EncodeLocale("zh", nullptr, "HK"); 35 uint32_t LocaleMatcher::HANT_ENCODE = Utils::EncodeScript("Hant"); 62 if (Utils::EncodeScriptByResLocale(request) == LocaleMatcher::HANT_ENCODE) { in SearchParentLocale() 134 uint64_t encodedLocale = Utils::EncodeLocale(language, script, region); in IsDefaultLocale() 136 encodedLocale = Utils::EncodeLocale("en", "Latn", region); in IsDefaultLocale() 158 uint64_t encodedLocale = Utils::EncodeLocale(language, nullptr, region); in FindDefaultScriptEncode() [all …]
|
/base/global/resource_management/frameworks/resmgr/src/utils/ |
D | utils.cpp | 45 const std::set<std::string> Utils::tailSet { 58 RState Utils::GetMediaBase64Data(const std::string& iconPath, std::string &base64Data) in GetMediaBase64Data() 61 auto tempData = Utils::LoadResourceFile(iconPath, len); in GetMediaBase64Data() 71 Utils::EncodeBase64(tempData, len, imgType, base64Data); in GetMediaBase64Data() 75 std::unique_ptr<uint8_t[]> Utils::LoadResourceFile(const std::string &path, size_t &len) in LoadResourceFile() 98 RState Utils::EncodeBase64(std::unique_ptr<uint8_t[]> &data, int srcLen, in EncodeBase64() 137 bool Utils::IsAlphaString(const char *s, int32_t len) in IsAlphaString() 152 bool Utils::IsNumericString(const char *s, int32_t len) in IsNumericString() 178 void Utils::DecodeScript(uint32_t encodeScript, char *outValue) in DecodeScript() 189 bool Utils::IsStrEmpty(const char *s) in IsStrEmpty() [all …]
|
/base/global/resource_management/frameworks/resmgr/src/ |
D | locale_matcher.cpp | 30 uint64_t LocaleMatcher::EN_US_ENCODE = Utils::EncodeLocale("en", nullptr, "US"); 31 uint64_t LocaleMatcher::EN_GB_ENCODE = Utils::EncodeLocale("en", nullptr, "GB"); 32 uint64_t LocaleMatcher::EN_QAAG_ENCODE = Utils::EncodeLocale("en", "Qaag", nullptr); 33 uint64_t LocaleMatcher::ZH_HANT_MO_ENCODE = Utils::EncodeLocale("zh", "Hant", "MO"); 34 uint64_t LocaleMatcher::ZH_HK_ENCODE = Utils::EncodeLocale("zh", nullptr, "HK"); 35 uint32_t LocaleMatcher::HANT_ENCODE = Utils::EncodeScript("Hant"); 62 if (Utils::EncodeScriptByResLocale(request) == LocaleMatcher::HANT_ENCODE) { in SearchParentLocale() 134 uint64_t encodedLocale = Utils::EncodeLocale(language, script, region); in IsDefaultLocale() 136 encodedLocale = Utils::EncodeLocale("en", "Latn", region); in IsDefaultLocale() 158 uint64_t encodedLocale = Utils::EncodeLocale(language, nullptr, region); in FindDefaultScriptEncode() [all …]
|
/base/customization/enterprise_device_management/test/unittest/edm_plugin/src/ |
D | set_wifi_profile_plugin_test.cpp | 37 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 42 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 43 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 44 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite() 54 Utils::ResetTokenTypeAndUid(); 59 Utils::ResetTokenTypeAndUid();
|
D | is_wifi_active_plugin_test.cpp | 37 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 42 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 43 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 44 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite() 58 Utils::ResetTokenTypeAndUid(); 61 Utils::SetEdmInitialEnv();
|
D | reset_factory_plugin_test.cpp | 28 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 33 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 34 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 35 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite() 45 Utils::ResetTokenTypeAndUid();
|
D | uninstall_plugin_test.cpp | 26 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 31 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 32 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 33 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite()
|
D | disallow_add_local_account_plugin_test.cpp | 27 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 32 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 33 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 34 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite()
|
D | install_plugin_test.cpp | 30 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 35 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 36 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 37 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite()
|
D | get_screen_off_time_plugin_test.cpp | 38 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 43 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 44 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 45 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite()
|
D | device_info_plugin_test.cpp | 27 Utils::SetEdmInitialEnv(); in SetUpTestSuite() 32 Utils::ResetTokenTypeAndUid(); in TearDownTestSuite() 33 ASSERT_TRUE(Utils::IsOriginalUTEnv()); in TearDownTestSuite() 34 std::cout << "now ut process is orignal ut env : " << Utils::IsOriginalUTEnv() << std::endl; in TearDownTestSuite()
|
/base/security/access_token/services/accesstokenmanager/main/cpp/src/token/ |
D | token_modify_notifier.cpp | 42 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in AddHapTokenObservation() 50 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenDelete() 62 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenModify() 76 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(instance.initLock_); in GetInstance() 88 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenSyncTask()
|
D | accesstoken_id_manager.cpp | 43 Utils::UniqueReadGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in GetTokenIdType() 58 Utils::UniqueWriteGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in RegisterTokenId() 73 Utils::UniqueReadGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in GetHapTokenIdList() 125 Utils::UniqueWriteGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in ReleaseTokenId()
|
/base/update/updater/services/ |
D | updater_ui.cpp | 56 Utils::UsSleep(minSleepMs); in DoProgress() 58 Utils::UsSleep(maxSleepMs); in DoProgress() 68 Utils::UpdaterDoReboot(""); in DEFINE_ASYN_CALLBACK() 86 Utils::UsSleep(CALLBACK_DELAY); in DEFINE_ASYN_CALLBACK() 90 Utils::UsSleep(DISPLAY_TIME); in DEFINE_ASYN_CALLBACK() 98 Utils::UpdaterDoReboot(""); in DEFINE_ASYN_CALLBACK() 107 Utils::UsSleep(CALLBACK_DELAY); in DEFINE_ASYN_CALLBACK() 113 Utils::UsSleep(FAIL_DELAY); in DEFINE_ASYN_CALLBACK() 119 Utils::UsSleep(SUCCESS_DELAY); in DEFINE_ASYN_CALLBACK() 121 Utils::UpdaterDoReboot(""); in DEFINE_ASYN_CALLBACK() [all …]
|
/base/update/updater/utils/ |
D | updater_reboot.cpp | 24 if (argc > Updater::Utils::ARGC_TWO_NUMS) { in main() 30 Updater::Utils::UpdaterDoReboot(""); in main() 34 Updater::Utils::UpdaterDoReboot(argv[1]); in main() 36 Updater::Utils::UpdaterDoReboot(argv[1]); in main() 38 Updater::Utils::UpdaterDoReboot("flashd", argv[1] + strlen("flashd:")); in main()
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_fuse/src/ |
D | dlp_link_manager.cpp | 53 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in AddDlpLinkFile() 91 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in StopDlpLinkFile() 116 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in RestartDlpLinkFile() 145 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in ReplaceDlpLinkFile() 169 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in DeleteDlpLinkFile() 191 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in LookUpDlpLinkFile() 210 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(g_DlpLinkMapLock_); in DumpDlpLinkFile()
|
/base/security/access_token/services/privacymanager/src/record/ |
D | permission_used_record_cache.cpp | 53 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in AddRecordToBuffer() 101 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in AddToPersistQueue() 132 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords() 139 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords() 158 Utils::UniqueReadGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords() 163 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords() 178 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecordsImmediately() 194 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in RemoveRecords() 228 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in RemoveFromPersistQueueAndDatabase() 258 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in GetRecords() [all …]
|
/base/update/updater/services/applypatch/ |
D | transfer_manager.cpp | 25 using namespace Updater::Utils; 81 globalParams->version = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser() 82 globalParams->blockCount = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser() 83 globalParams->maxEntries = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser() 84 globalParams->maxBlocks = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser() 139 bool ret = Utils::WriteStringToFile(fd, cmd); in RegisterForRetry() 158 if (!Utils::ReadFileToString(fd, cmd)) { in ReloadForRetry()
|
/base/security/security_component_manager/services/security_component_service/sa/sa_main/ |
D | app_state_observer.cpp | 37 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->fgProcLock_); in IsProcessForeground() 53 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->fgProcLock_); in AddProcessToForegroundSet() 90 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->fgProcLock_); in RemoveProcessFromForegroundSet() 120 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->fgProcLock_); in DumpProcess()
|