!551 修改颜色反转

Merge pull request !551 from luocheng/master
This commit is contained in:
openharmony_ci 2023-03-29 06:28:07 +00:00 committed by Gitee
commit dbb6e11bf0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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.");

View File

@ -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)) {

View File

@ -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.");