diff --git a/services/reminder/include/reminder_config_change_observer.h b/services/reminder/include/reminder_config_change_observer.h index 982b7ddb1fffef61c9ae26bd9daf4fa2ffdc938c..aecceb2a2fd9b00b9aac182c14bf78dc4d81ee9b 100644 --- a/services/reminder/include/reminder_config_change_observer.h +++ b/services/reminder/include/reminder_config_change_observer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,7 +31,7 @@ public: ~ReminderConfigChangeObserver() = default; public: - void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override; + ErrCode OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override; private: std::string languageInfo_; diff --git a/services/reminder/src/reminder_config_change_observer.cpp b/services/reminder/src/reminder_config_change_observer.cpp index a19712fb0e0b2294cc6261f331f5374abd45c2c5..226f87ea7ee0a87d416c3a7d926688a5bce1b22f 100644 --- a/services/reminder/src/reminder_config_change_observer.cpp +++ b/services/reminder/src/reminder_config_change_observer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,13 +21,13 @@ namespace OHOS { namespace Notification { -void ReminderConfigChangeObserver::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) +ErrCode ReminderConfigChangeObserver::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) { ANSR_LOGD("OnConfigurationUpdated."); auto reminderDataMgr = ReminderDataManager::GetInstance(); if (reminderDataMgr == nullptr) { ANSR_LOGE("Reminder data manager is nullptr"); - return; + return ERR_INVALID_VALUE; } std::string newLanguageInfo = configuration.GetItem(AAFwk::GlobalConfigurationKey::SYSTEM_LANGUAGE); if (!newLanguageInfo.empty() && newLanguageInfo != languageInfo_) { @@ -35,6 +35,7 @@ void ReminderConfigChangeObserver::OnConfigurationUpdated(const AppExecFwk::Conf reminderDataMgr->OnLanguageChanged(); languageInfo_ = newLanguageInfo; } + return ERR_OK; } } // namespace Notification