diff --git a/interfaces/inner_api/app_manager/src/appmgr/configuration_observer_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/configuration_observer_proxy.cpp index 05567b0a48470651d69060383cc1f51b17036d88..fb2ec9d233193cc8af0964a5dec574c7ff63aca0 100644 --- a/interfaces/inner_api/app_manager/src/appmgr/configuration_observer_proxy.cpp +++ b/interfaces/inner_api/app_manager/src/appmgr/configuration_observer_proxy.cpp @@ -41,7 +41,9 @@ void ConfigurationObserverProxy::OnConfigurationUpdated(const Configuration& con if (!WriteInterfaceToken(data)) { return; } - data.WriteParcelable(&configuration); + if (!data.WriteParcelable(&configuration)) { + TAG_LOGE(AAFwkTag::APPMGR, "configuration is NULL"); + } sptr remote = Remote(); if (remote == nullptr) { TAG_LOGE(AAFwkTag::APPMGR, "Remote() is NULL"); diff --git a/test/moduletest/mock/include/mock_configuration_observer.h b/test/moduletest/mock/include/mock_configuration_observer.h index 16613959381f779150f0f0c79e273b2eaaa2fec7..4d96ab32110c35c7fc78ac3571e7f9d86c2d16f2 100644 --- a/test/moduletest/mock/include/mock_configuration_observer.h +++ b/test/moduletest/mock/include/mock_configuration_observer.h @@ -31,6 +31,12 @@ public: { GTEST_LOG_(INFO) << "OnConfigurationUpdated"; } + + void test() + { + GTEST_LOG_(INFO) << "test"; + }; + }; } // namespace AppExecFwk } // namespace OHOS