mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-27 09:01:34 +00:00
commit
dbb6e11bf0
@ -237,6 +237,7 @@ public:
|
||||
void AddConfigCallback(const sptr<IAccessibleAbilityManagerConfigObserver>& callback);
|
||||
void RemoveConfigCallback(const wptr<IRemoteObject>& callback);
|
||||
const std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> &GetConfigCallbacks() const;
|
||||
void SetConfigCallbacks(std::vector<sptr<IAccessibleAbilityManagerConfigObserver>>& observer);
|
||||
|
||||
void GetImportantEnabledAbilities(std::map<std::string, uint32_t> &importantEnabledAbilities) const;
|
||||
void UpdateImportantEnabledAbilities(std::map<std::string, uint32_t> &importantEnabledAbilities);
|
||||
|
@ -541,6 +541,12 @@ const std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> &AccessibilityA
|
||||
return configCallbacks_;
|
||||
}
|
||||
|
||||
void AccessibilityAccountData::SetConfigCallbacks(std::vector<sptr<IAccessibleAbilityManagerConfigObserver>>& observer)
|
||||
{
|
||||
HILOG_DEBUG("start.");
|
||||
configCallbacks_ = observer;
|
||||
}
|
||||
|
||||
void AccessibilityAccountData::RemoveConfigCallback(const wptr<IRemoteObject>& callback)
|
||||
{
|
||||
HILOG_DEBUG("start.");
|
||||
|
@ -1102,6 +1102,7 @@ void AccessibleAbilityManagerService::SwitchedUser(int32_t accountId)
|
||||
}
|
||||
|
||||
std::map<std::string, uint32_t> importantEnabledAbilities;
|
||||
std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> tmpObserver;
|
||||
// Clear last account's data
|
||||
if (currentAccountId_ != -1) {
|
||||
HILOG_DEBUG("current account id: %{public}d", currentAccountId_);
|
||||
@ -1110,6 +1111,7 @@ void AccessibleAbilityManagerService::SwitchedUser(int32_t accountId)
|
||||
HILOG_ERROR("Current account data is null");
|
||||
return;
|
||||
}
|
||||
tmpObserver = accountData->GetConfigCallbacks();
|
||||
accountData->GetImportantEnabledAbilities(importantEnabledAbilities);
|
||||
accountData->OnAccountSwitched();
|
||||
UpdateAccessibilityManagerService();
|
||||
@ -1125,6 +1127,7 @@ void AccessibleAbilityManagerService::SwitchedUser(int32_t accountId)
|
||||
return;
|
||||
}
|
||||
accountData->Init();
|
||||
accountData->SetConfigCallbacks(tmpObserver);
|
||||
float discount = accountData->GetConfig()->GetBrightnessDiscount();
|
||||
auto& displayPowerMgrClient = DisplayPowerMgr::DisplayPowerMgrClient::GetInstance();
|
||||
if (!displayPowerMgrClient.DiscountBrightness(discount)) {
|
||||
|
@ -320,6 +320,12 @@ const std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> &AccessibilityA
|
||||
return configCallbacks_;
|
||||
}
|
||||
|
||||
void AccessibilityAccountData::SetConfigCallbacks(std::vector<sptr<IAccessibleAbilityManagerConfigObserver>>& observer)
|
||||
{
|
||||
HILOG_DEBUG("start.");
|
||||
configCallbacks_ = observer;
|
||||
}
|
||||
|
||||
void AccessibilityAccountData::RemoveConfigCallback(const wptr<IRemoteObject>& callback)
|
||||
{
|
||||
HILOG_DEBUG("start.");
|
||||
|
Loading…
Reference in New Issue
Block a user