static struct timespec unlock_timer_end_st;
static struct pmqos_cpu unlock_timer_owner = {"", 0};
+/******************************************************
+ * PMQOS callback functions for Init/Exit *
+ * (Declarations) *
+ ******************************************************/
+static int pmqos_init_done(void *data, void *user_data);
+static void pmqos_free(void);
+
+/******************************************************
+ * PASS D-Bus interface *
+ ******************************************************/
+static DBusMessage* e_dbus_start_cb(E_DBus_Object *obj, DBusMessage* msg)
+{
+ DBusMessage *ret_dbus = NULL;
+ bool booting_done = true;
+ int ret;
+
+ ret = pmqos_init_done(&booting_done, NULL);
+ if (ret < 0) {
+ _E("failed to initialize the daemon in dbus callback \
+ for a start message\n");
+ return ret_dbus;
+ }
+
+ ret_dbus = dbus_message_new_method_return(msg);
+ return ret_dbus;
+}
+
+static DBusMessage* e_dbus_stop_cb(E_DBus_Object *obj, DBusMessage* msg)
+{
+ DBusMessage *ret_dbus;
+
+ pmqos_free();
+
+ ret_dbus = dbus_message_new_method_return(msg);
+ return ret_dbus;
+}
+
int set_pmqos(const char *name, int val)
{
char scenario[100];
/* Add pmqos name as alphabetically */
static const struct edbus_method edbus_methods[] = {
+ { "start", NULL, NULL, e_dbus_start_cb },
+ { "stop", NULL, NULL, e_dbus_stop_cb },
+ /*
+ * TODO: The hard-coded scenario info is no longer required. Therefore,
+ * the following code will be removed.
+ */
{ "AppLaunch", "i", "i", dbus_pmqos_handler },
{ "AppLaunchHome", "i", "i", dbus_pmqos_handler },
{ "BeautyShot", "i", "i", dbus_pmqos_handler },