Ambient-mode file has a lot of dependent on display modules.
Thus, this patch is needed for the next plugin separation works.
To relocate ambient-mode, set_dim_state() is changed to plugin interface call.
This function is added to below display-misc.
int display_plugin_set_dim_state(bool on);
Actually, set_dim_state is only used in the ambient-mode.
The meaning of function name and role is different.
It does not affect setting dim state.
Also, in the code context, there is no transition to DIM status.
Thus, during plugin refactoring work, function name/location should be discussed.
In addition, unused code is removed from plugins except wearable
Because, "INTERNAL_LOCK_AMBIENT" is only used in wearable.
Change-Id: Ic953a1d6bd311d87bdaa7e838bcd15c68d0dc67c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
pid = (pid_t)((intptr_t)data);
_I("delete prohibit %s condition by timeout (%d)", states[state].name, pid);
- if (pid == INTERNAL_LOCK_AMBIENT)
- ambient_check_invalid_state(pid);
-
tmp = find_node(state, pid);
del_node(state, tmp);
set_unlock_time(pid, state);
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
dp->delete_state_cond = del_state_cond;
+ dp->set_dim_state = set_dim_state;
+ setup_display_plugin_backlight_ops(dp);
/* check display feature */
if (!is_feature_display_supported())
pid = (pid_t)((intptr_t)data);
_I("delete prohibit %s condition by timeout (%d)", states[state].name, pid);
- if (pid == INTERNAL_LOCK_AMBIENT)
- ambient_check_invalid_state(pid);
-
tmp = find_node(state, pid);
del_node(state, tmp);
set_unlock_time(pid, state);
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
dp->delete_state_cond = del_state_cond;
+ dp->set_dim_state = set_dim_state;
+ setup_display_plugin_backlight_ops(dp);
/**
* load display service
pid = (pid_t)((intptr_t)data);
_I("delete prohibit %s condition by timeout (%d)", states[state].name, pid);
- if (pid == INTERNAL_LOCK_AMBIENT)
- ambient_check_invalid_state(pid);
-
tmp = find_node(state, pid);
del_node(state, tmp);
set_unlock_time(pid, state);
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
dp->delete_state_cond = del_state_cond;
+ dp->set_dim_state = set_dim_state;
+ setup_display_plugin_backlight_ops(dp);
/**
* load display service
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
dp->delete_state_cond = del_state_cond;
+ dp->set_dim_state = set_dim_state;
+ setup_display_plugin_backlight_ops(dp);
/**
* load display service
#include "display.h"
#include "display-ops.h"
#include "display-panel.h"
+#include "display-plugin.h"
#include "display-state-transition.h"
#include "shared/device-notifier.h"
#include "shared/devices.h"
state = (ambient_condition == 0 ? 0 : 1);
device_notify(DEVICE_NOTIFIER_DISPLAY_AMBIENT_CONDITION, (void *)&state);
- set_dim_state(state);
+ display_plugin_set_dim_state(state);
}
int ambient_set_state(int on)
void lcd_off_procedure(enum device_flags flag);
bool touch_event_blocked(void);
void broadcast_lcd_off_late(enum device_flags flags);
-void set_dim_state(bool on);
/* auto-brightness.c */
void set_brightness_changed_state(void);
}
return -EOPNOTSUPP;
+}
+
+int display_plugin_set_dim_state(bool on)
+{
+ if (g_display_plugin.set_dim_state) {
+ g_display_plugin.set_dim_state(on);
+ return 0;
+ }
+
+ return -EOPNOTSUPP;
}
\ No newline at end of file
int (*auto_brightness_control) (enum brightness_request_e request, int set_brightness);
/* FIXME: function names will be redefined */
void (*delete_state_cond) (void *data, enum state_t s_state);
+ void (*set_dim_state) (bool on);
struct display_config *config;
struct display_backlight_ops *backlight;
int display_plugin_set_system_wakeup_flag(bool flag);
const char* display_plugin_device_flags_to_string(enum device_flags flags);
int display_plugin_auto_brightness_control(enum brightness_request_e request, int set_brightness);
+int display_plugin_set_dim_state(bool on);
int display_plugin_backlight_get_lcd_power(void);
int display_plugin_backlight_set_brightness(int brightness);