From 970bd39d06ea27b5274c8b2c77907c90f9cbe9e1 Mon Sep 17 00:00:00 2001 From: 18795846185 Date: Tue, 17 Jun 2025 20:33:00 +0800 Subject: [PATCH] modify idl for configurationobserver Signed-off-by: 18795846185 Change-Id: I9b94b8aecfc0c55769835d060a3b80eeeddcdda1 --- .../reminder/include/reminder_config_change_observer.h | 4 ++-- services/reminder/src/reminder_config_change_observer.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/reminder/include/reminder_config_change_observer.h b/services/reminder/include/reminder_config_change_observer.h index 982b7ddb1..aecceb2a2 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 a19712fb0..226f87ea7 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 -- Gitee