As the previous patch,
- power: update wakeup reason immediately after wakeup
has changed not to maintain wakeup reason after resume, it is necessary
to access it via hal-api for every request for wakeup reason.
Change-Id: Ibf2aebb5b542dd1d55f799be0fbaddf65a6a8e7c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
- return g_variant_new("(i)", power_get_wakeup_reason());
+ enum hal_device_power_transition_reason wakeup_reason;
+ int retval;
+
+ retval = hal_device_power_get_wakeup_reason(&wakeup_reason);
+ if (retval < 0)
+ wakeup_reason = HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN;
+
+ return g_variant_new("(i)", wakeup_reason);
}
static const dbus_method_s dbus_methods[] = {