/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-static int _appcore_agent_request_to_suspend(int pid)
-{
-#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
- GError *err = NULL;
-
- if (bus == NULL) {
- bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
- if (bus == NULL) {
- _ERR("g_bus_get_sync() is failed: %s", err->message);
- g_error_free(err);
- return -1;
- }
- }
-
- if (g_dbus_connection_emit_signal(bus,
- NULL,
- APPFW_SUSPEND_HINT_PATH,
- APPFW_SUSPEND_HINT_INTERFACE,
- APPFW_SUSPEND_HINT_SIGNAL,
- g_variant_new("(i)", pid),
- &err) == FALSE) {
- _ERR("g_dbus_connection_emit_signal() is failed: %s",
- err->message);
- g_error_free(err);
- return -1;
- }
-
- if (g_dbus_connection_flush_sync(bus, NULL, &err) == FALSE) {
- _ERR("g_dbus_connection_flush_sync() is failed: %s",
- err->message);
- g_error_free(err);
- return -1;
- }
-
- _DBG("[__SUSPEND__] Send suspend hint, pid: %d", pid);
-#endif
- return 0;
-}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
static void __prepare_to_suspend(void *data)
{
#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
if (ac && !ac->allowed_bg && !ac->suspended_state) {
_DBG("[__SUSPEND__]");
__sys_do(ac, &suspend, SE_SUSPENDED_STATE);
- _appcore_agent_request_to_suspend(getpid()); /* send dbus signal to resourced */
ac->suspended_state = true;
}
#endif