Lines Matching defs:name

243 void AccessibilityAccountData::AddEnabledAbility(const std::string &name)
247 [name](const std::string &abilityName) {
248 return abilityName == name;
250 HILOG_DEBUG("The ability is already enabled, and it's name is %{public}s", name.c_str());
253 enabledAbilities_.push_back(name);
254 if (name == screenReaderAbilityName_) {
261 RetError AccessibilityAccountData::RemoveEnabledAbility(const std::string &name)
265 if (*it == name) {
266 HILOG_DEBUG("Removed %{public}s from EnabledAbility: ", name.c_str());
268 if (name == screenReaderAbilityName_) {
276 HILOG_ERROR("The ability %{public}s is not enabled.", name.c_str());
282 HILOG_DEBUG("abilityInfo's bundle name is %{public}s", abilityInfo.GetPackageName().c_str());
478 void AccessibilityAccountData::SetAbilityAutoStartState(const std::string &name, const bool state)
481 if (name == SCREEN_READER_BUNDLE_ABILITY_NAME) {
491 rtn = config_->AddEnabledAccessibilityService(name);
493 rtn = config_->RemoveEnabledAccessibilityService(name);
496 HILOG_WARN("handle service %{public}s state = %{public}d failed, rtn = %{public}d", name.c_str(), state, rtn);
500 void AccessibilityAccountData::SetScreenReaderState(const std::string &name, const std::string &state)
502 HILOG_DEBUG("set screen reader key [%{public}s], state = [%{public}s].", name.c_str(), state.c_str());
509 ErrCode ret = service->PutStringValue(name, state, true);
540 bool AccessibilityAccountData::GetAbilityAutoStartState(const std::string &name)
542 if (name == SCREEN_READER_BUNDLE_ABILITY_NAME && GetAccountType() == AccountSA::OsAccountType::PRIVATE) {
550 auto iter = std::find(serviceList.begin(), serviceList.end(), name);
607 RetError AccessibilityAccountData::EnableAbility(const std::string &name, const uint32_t capabilities)
609 HILOG_DEBUG("start and name[%{public}s] capabilities[%{public}d]", name.c_str(), capabilities);
613 if (itr->GetId() == name) {
629 HILOG_ERROR("the ability[%{public}s] is not installed", name.c_str());
635 [name](const std::string &abilityName) {
636 return abilityName == name;
638 HILOG_ERROR("The ability[%{public}s] is already enabled", name.c_str());
642 HITRACE_METER_NAME(HITRACE_TAG_ACCESSIBILITY_MANAGER, "EnableAbility:" + name);
645 enabledAbilities_.push_back(name);
646 SetAbilityAutoStartState(name, true);
647 if (name == screenReaderAbilityName_) {
651 Utils::RecordStartingA11yEvent(name);
972 HILOG_DEBUG("The package%{public}s added", (bundleName + "/" + newAbility.name).c_str());
1025 for (auto &name : autoStartAbilities) {
1028 if (name == iter->GetId()) {
1033 SetAbilityAutoStartState(name, false);
1226 HILOG_DEBUG("remove connected ability, bundle name %{public}s", connectedBundleName.c_str());