From 1b9cee248eb137a310e2c759f4a1e759f7529961 Mon Sep 17 00:00:00 2001 From: "jh9216.park" Date: Wed, 23 Nov 2022 02:34:14 -0500 Subject: [PATCH] Add explicit types when using method broker - Implicit template function call may send wrong types Change-Id: Iba675141d0adca2db90425530dad0a823316e414 Signed-off-by: jh9216.park --- src/modules/dbus_event/dbus_event_module.cc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/modules/dbus_event/dbus_event_module.cc b/src/modules/dbus_event/dbus_event_module.cc index dc64a3c..9090cd0 100644 --- a/src/modules/dbus_event/dbus_event_module.cc +++ b/src/modules/dbus_event/dbus_event_module.cc @@ -2323,8 +2323,9 @@ void DbusEventModule::GetUuidMethodCall(GDBusConnection* connection, return; } - if (tools_->GetMethodBroker().Invoke("Cion.GetUuidWithGenerate", - app_id, uuid)) { + if (tools_->GetMethodBroker() + .Invoke&>( + "Cion.GetUuidWithGenerate", app_id, uuid)) { param = g_variant_new("(is)", ES_R_OK, (*uuid).c_str()); } else { result = ES_R_ERROR; @@ -2354,8 +2355,9 @@ void DbusEventModule::SetDisplayNameMethodCall(GDBusConnection* connection, g_variant_get(parameters, "(&s&s)", &service_name, &display_name); - if (!tools_->GetMethodBroker().Invoke("Cion.SetDisplayName", app_id, - service_name, display_name, ret)) { + if (!tools_->GetMethodBroker() + .Invoke( + "Cion.SetDisplayName", app_id, service_name, display_name, ret)) { result = ES_R_ERROR; } @@ -2384,8 +2386,10 @@ void DbusEventModule::GetDisplayNameMethodCall(GDBusConnection* connection, g_variant_get(parameters, "(&s)", &service_name); - if (tools_->GetMethodBroker().Invoke("Cion.GetDisplayName", - app_id.c_str(), service_name, display_name, ret)) { + if (tools_->GetMethodBroker() + .Invoke( + "Cion.GetDisplayName", app_id, service_name, display_name, + ret)) { if (ret == 0) param = g_variant_new("(is)", result, display_name); } else { @@ -2416,8 +2420,9 @@ void DbusEventModule::SetEnabledMethodCall(GDBusConnection* connection, g_variant_get(parameters, "(&sb)", &service_name, &enabled); - if (!tools_->GetMethodBroker().Invoke("Cion.SetEnabled", app_id, - service_name, (bool)enabled, ret)) { + if (!tools_->GetMethodBroker() + .Invoke( + "Cion.SetEnabled", app_id, service_name, (bool)enabled, ret)) { result = ES_R_ERROR; } @@ -2445,8 +2450,9 @@ void DbusEventModule::GetEnabledMethodCall(GDBusConnection* connection, } g_variant_get(parameters, "(&s)", &service_name); - if (!tools_->GetMethodBroker().Invoke("Cion.GetEnabled", app_id, - service_name, enabled, ret)) { + if (!tools_->GetMethodBroker() + .Invoke( + "Cion.GetEnabled", app_id, service_name, enabled, ret)) { result = ES_R_ERROR; } else if (ret != 0) { result = ES_R_ERROR; -- 2.7.4