!1136 首次启动耗时问题解决

Merge pull request !1136 from taojuncun/bug_0605
This commit is contained in:
openharmony_ci 2024-06-05 07:56:28 +00:00 committed by Gitee
commit 3398c55c42
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 0 deletions

View File

@ -307,6 +307,7 @@ private:
static void OnParameterChanged(const char *key, const char *value, void *context);
void OnIgnoreRepeatClickStateChanged(const uint32_t stateType);
bool CheckSaStatus();
sptr<Accessibility::IAccessibleAbilityManagerService> serviceProxy_ = nullptr;
sptr<AccessibleAbilityManagerCaptionObserverImpl> captionObserver_ = nullptr;

View File

@ -251,6 +251,29 @@ void AccessibilityConfig::Impl::ResetService(const wptr<IRemoteObject> &remote)
}
}
bool AccessibilityConfig::Impl::CheckSaStatus()
{
std::vector<int> dependentSa = {
ABILITY_MGR_SERVICE_ID,
BUNDLE_MGR_SERVICE_SYS_ABILITY_ID,
COMMON_EVENT_SERVICE_ID,
DISPLAY_MANAGER_SERVICE_SA_ID,
SUBSYS_ACCOUNT_SYS_ABILITY_ID_BEGIN,
WINDOW_MANAGER_SERVICE_ID
};
auto samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
if (samgr == nullptr) {
return false;
}
if (std::any_of(dependentSa.begin(), dependentSa.end(), [&](int saId) {
return samgr->CheckSystemAbility(saId) == nullptr;
})) {
return false;
}
return true;
}
Accessibility::RetError AccessibilityConfig::Impl::EnableAbility(const std::string &name, const uint32_t capabilities)
{
HILOG_INFO("name = [%{private}s] capabilities = [%{private}u]", name.c_str(), capabilities);