mirror of
https://github.com/openharmony/accessibility.git
synced 2026-08-25 11:51:38 -04:00
@@ -286,6 +286,7 @@ private:
|
||||
sptr<IRemoteObject::DeathRecipient> configCallbackDeathRecipient_ = nullptr;
|
||||
sptr<IRemoteObject::DeathRecipient> bundleManagerDeathRecipient_ = nullptr;
|
||||
std::vector<sptr<IAccessibleAbilityManagerStateObserver>> stateCallbacks_;
|
||||
std::mutex mutex_;
|
||||
};
|
||||
} // namespace Accessibility
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -291,10 +291,13 @@ uint32_t AccessibleAbilityManagerService::RegisterStateObserver(
|
||||
return;
|
||||
}
|
||||
callback->AsObject()->AddDeathRecipient(stateCallbackDeathRecipient_);
|
||||
auto iter = std::find(stateCallbacks_.begin(), stateCallbacks_.end(), callback);
|
||||
if (iter == stateCallbacks_.end()) {
|
||||
stateCallbacks_.push_back(callback);
|
||||
HILOG_INFO("RegisterStateObserver successfully");
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto iter = std::find(stateCallbacks_.begin(), stateCallbacks_.end(), callback);
|
||||
if (iter == stateCallbacks_.end()) {
|
||||
stateCallbacks_.push_back(callback);
|
||||
HILOG_INFO("RegisterStateObserver successfully");
|
||||
}
|
||||
}
|
||||
|
||||
sptr<AccessibilityAccountData> accountData = GetCurrentAccountData();
|
||||
|
||||
Reference in New Issue
Block a user