struct display_plugin *dp = (struct display_plugin *) data;
assert(dp);
- dp->proc_change_state = NULL;
-
return 0;
}
struct display_plugin *dp = (struct display_plugin *) data;
assert(dp);
- dp->proc_change_state = NULL;
-
return 0;
}
return 0;
}
+/* FIXME: register to plugin .proc_change_state interface */
+__attribute__((unused))
static int default_proc_change_state(unsigned int cond, pid_t pid)
{
enum syscommon_deviced_display_state next;
* dp->custom_lcd_off = custom_lcdoff;
* dp->display_on_by_reason = display_on_by_reason;
* dp->display_off_by_reason = display_off_by_reason;
+ * dp->proc_change_state = default_proc_change_state;
*/
- dp->proc_change_state = default_proc_change_state;
return 0;
}
#include "display-config.h"
#include "shared/log-macro.h"
-struct display_plugin g_display_plugin;
-
-/* FIXME: Below functions are temorary to separtate display state transition functions */
-
-bool display_plugin_state_is_there_proc_change_state(void)
-{
- return (g_display_plugin.proc_change_state != NULL);
-}
-
-int display_plugin_state_proc_change_state(unsigned int cond, pid_t pid)
-{
- if (!g_display_plugin.proc_change_state)
- return -EOPNOTSUPP;
-
- return g_display_plugin.proc_change_state(cond, pid);
-}
\ No newline at end of file
+struct display_plugin g_display_plugin;
\ No newline at end of file
#include "shared/devices.h"
struct display_plugin {
- int (*proc_change_state) (unsigned int cond, pid_t pid);
};
extern struct display_plugin g_display_plugin;
-/* FIXME: This function used in the display lock related functions */
-bool display_plugin_state_is_there_proc_change_state(void);
-int display_plugin_state_proc_change_state(unsigned int cond, pid_t pid);
-
#endif //__DISPLAY_PLUGIN_H__
*/
enum syscommon_deviced_display_state next;
const char *state_name = NULL;
+ int ret;
- if (display_plugin_state_is_there_proc_change_state())
- return display_plugin_state_proc_change_state(cond, pid);
+ ret = syscommon_plugin_deviced_display_proc_change_state(cond, pid);
+ if (ret == -ENOTSUP) {
+ _D("Take default operation as there is no found plugin backend");
+ } else if (ret == -EOPNOTSUPP) {
+ _D("Take default operation as there is no found plugin backend operation");
+ } else if (ret < 0) {
+ _E("Failed to plugin operation, ret=%d", ret);
+ return ret;
+ } else {
+ return 0;
+ }
next = GET_COND_STATE(cond);
display_state_get_name(next, &state_name);