Revert "power: add getter for the deviced power state" 44/282544/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/hotfix/20221116.104633 accepted/tizen/unified/20221006.065326 accepted/tizen/unified/20221006.065402 tizen_7.0_m2_release
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 5 Oct 2022 08:36:13 +0000 (17:36 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 5 Oct 2022 08:42:33 +0000 (17:42 +0900)
This reverts commit db2fd6133ebba7c3c2c59fabc2ed099579263355.

The getter intercepts linking to an already existing function with
the same name, which reside in the VD profile. Therefore temporarily
revert this patch.

Change-Id: Ib1c4283d4ae53e5914363c7a1062d319a991ca1b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/power-internal.h
src/power-internal.c

index 48051b8..6510293 100644 (file)
@@ -156,17 +156,6 @@ int device_power_change_state(uint64_t state, int timeout_sec, power_change_stat
  */
 int device_power_check_reboot_allowed(void);
 
-/**
- * @brief Get internal power state of the deviced
- * @since_tizen 6.5
- * @param[out] state Internal power state of the deviced
- * @return 0 on success,
- *         otherwise a negative error value
- * @retval #DEVICE_ERROR_NONE Successful
- * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
- */
-int device_power_get_state(uint64_t *state);
-
 #ifdef __cplusplus
 }
 #endif
index c291aac..0679882 100644 (file)
@@ -316,42 +316,3 @@ int device_power_check_reboot_allowed(void)
 
        return (retval != 0 || cloned != 0);
 }
-
-int device_power_get_state(uint64_t *state)
-{
-       GDBusConnection *connection;
-       GVariant *retgv = NULL;
-       GError *err = NULL;
-
-       if (!state)
-               return DEVICE_ERROR_INVALID_PARAMETER;
-
-       connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
-       if (!connection) {
-               _E("Failed to get dbus connection, %s", err->message);
-               g_clear_error(&err);
-               return DEVICE_ERROR_OPERATION_FAILED;
-       }
-
-       retgv = g_dbus_connection_call_sync(connection,
-                       DEVICED_BUS_NAME,
-                       DEVICED_PATH_POWER,
-                       DEVICED_INTERFACE_POWER,
-                       "PowerGetState",
-                       NULL,
-                       NULL,
-                       G_DBUS_CALL_FLAGS_NONE,
-                       DBUS_METHOD_SYNC_CALL_TIMEOUT_MS,
-                       NULL,
-                       &err);
-       if (!retgv || err) {
-               _E("Failed to request PowerGetState, %s", err->message);
-               g_error_free(err);
-               return DEVICE_ERROR_OPERATION_FAILED;
-       }
-
-       g_variant_get(retgv, "(t)", state);
-
-       return DEVICE_ERROR_NONE;
-}
-