Remove get_service_name_by_pid() as it is not used 44/206444/1 accepted/tizen/unified/20190617.061740 submit/tizen/20190531.060921 submit/tizen/20190614.050318
authorHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 20 May 2019 02:48:18 +0000 (11:48 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 20 May 2019 02:48:37 +0000 (11:48 +0900)
Change-Id: Ia969b959f0162ca857dc0631d952f3a5f849e926
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/sync-service/SyncManager_SyncService.cpp

index a4e7711547292599426438be7bf2d3e4fb667ee1..53be87b1c0e173c8b6f7ecddaa1d15565844fcd2 100644 (file)
@@ -563,71 +563,6 @@ SyncService::HandleShutdown(void) {
 }
 
 
-/* LCOV_EXCL_START */
-int
-get_service_name_by_pid(guint pid, char** pAppId) {
-               GError* error = NULL;
-               GVariant *unit = NULL;
-               unit = g_dbus_connection_call_sync(gdbusConnection,     "org.freedesktop.systemd1",
-                                                                                                                       "/org/freedesktop/systemd1",
-                                                                                                                       "org.freedesktop.systemd1.Manager",
-                                                                                                                       "GetUnitByPID",
-                                                                                                                       g_variant_new("(u)", pid),
-                                                                                                                       G_VARIANT_TYPE("(o)"),
-                                                                                                                       G_DBUS_CALL_FLAGS_NONE,
-                                                                                                                       -1,
-                                                                                                                       NULL,
-                                                                                                                       &error);
-               if (!unit) {
-                       if (error) {
-                               LOG_LOGC("get_service_name_by_pid gdbus error [%s]", error->message);
-                               g_clear_error(&error);
-                       }
-                       *pAppId = NULL;
-                       return SYNC_ERROR_SYSTEM;
-               }
-
-               char* unitNode = NULL;
-               g_variant_get(unit, "(o)", &unitNode);
-
-               GVariant *service = NULL;
-               service = g_dbus_connection_call_sync(gdbusConnection, "org.freedesktop.systemd1",
-                                                                                                                               unitNode,
-                                                                                                                               "org.freedesktop.DBus.Properties",
-                                                                                                                               "Get",
-                                                                                                                               g_variant_new("(ss)", "org.freedesktop.systemd1.Service", "BusName"),
-                                                                                                                               G_VARIANT_TYPE("(v)"),
-                                                                                                                               G_DBUS_CALL_FLAGS_NONE,
-                                                                                                                               -1,
-                                                                                                                               NULL,
-                                                                                                                               &error);
-
-               if (!service) {
-                       if (error) {
-                               LOG_LOGC("get_service_name_by_pid gdbus error [%s]", error->message);
-                               g_clear_error(&error);
-                       }
-                       *pAppId = NULL;
-                       return SYNC_ERROR_SYSTEM;
-               }
-
-               GVariant *tmp = g_variant_get_child_value(service, 0);
-               if (tmp) {
-                       GVariant* va = g_variant_get_variant(tmp);
-                       if (va) {
-                               char* name = NULL;
-                               g_variant_get(va, "s", &name);
-                               *pAppId = strdup(name);
-                               LOG_LOGD("DBus service [%s]", *pAppId);
-                               free(name);
-                       }
-               }
-
-               return SYNC_ERROR_NONE;
-}
-/* LCOV_EXCL_STOP */
-
-
 int
 get_num_of_sync_jobs(string pkgId) {
        if (!pkgId.empty()) {