#define APPID_INDICATOR "org.tizen.indicator"
#define APPID_QUICKPANEL "org.tizen.quickpanel"
+#define APPID_SOFTKEY "org.tizen.softkey-container"
int errno;
static struct {
pid_t volume_pid;
pid_t indicator_pid;
pid_t quickpanel_pid;
+ pid_t softkey_pid;
int power_off;
Ecore_Timer *dead_timer;
.volume_pid = (pid_t)-1,
.indicator_pid = (pid_t)-1,
.quickpanel_pid = (pid_t)-1,
+ .softkey_pid = (pid_t)-1,
.power_off = 0,
.dead_timer = NULL,
return s_home_mgr.quickpanel_pid;
}
+int home_mgr_get_softkey_pid(void)
+{
+ return s_home_mgr.softkey_pid;
+}
+
static void _after_launch_home(int pid)
{
if (pid != s_home_mgr.home_pid) {
s_home_mgr.quickpanel_pid = pid;
}
+static void _after_launch_softkey(int pid)
+{
+ s_home_mgr.softkey_pid = pid;
+}
+
static void _launch_after_home(int pid)
{
if (pid != s_home_mgr.home_pid) {
process_mgr_must_launch(APPID_QUICKPANEL, NULL, NULL, NULL, _after_launch_quickpanel);
}
+void home_mgr_softkey_process_terminate(void)
+{
+ process_mgr_terminate_app(s_home_mgr.softkey_pid,1);
+ s_home_mgr.softkey_pid = 0;
+}
+
+static void home_mgr_softkey_change(void *user_data)
+{
+ _D("home_mgr_softkey_change");
+ int state = TRUE;
+ int ret = 0;
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_SOFT_KEY, &state);
+ if (ret<0) {
+ _D("fail to get VCONFKEY_SETAPPL_SOFT_KEY:%d", ret);
+ return;
+ }
+
+ _D("VCONFKEY_SETAPPL_SOFT_KEY STATUS == %d ", state);
+ if(state == TRUE) {
+ process_mgr_must_launch(APPID_SOFTKEY, NULL, NULL, NULL, _after_launch_softkey);
+ } else {
+ _D("terminating softkey");
+ int softkey_pid = home_mgr_get_softkey_pid();
+ _D("SoftKey Process Id == %d ", softkey_pid);
+ if(softkey_pid > 0) {
+ home_mgr_softkey_process_terminate();
+ }
+ }
+}
+
+static void _softkey_vconf_change_cb(keynode_t *node, void *data)
+{
+ _D("_softkey_vconf_change_cb");
+ home_mgr_softkey_change(data);
+}
+
+void softkey_mgr_init(void)
+{
+ int ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SOFT_KEY, _softkey_vconf_change_cb, NULL);
+ if (ret != 0) {
+ _E("Failed to get vconfkey change for softkey app");
+ }
+}
+
+void softkey_mgr_fini(void)
+{
+ if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOFT_KEY, _softkey_vconf_change_cb) < 0) {
+ _E("Failed to unregister the callback for %s", VCONFKEY_SETAPPL_SOFT_KEY);
+ }
+}
+
static int _power_off_cb(status_active_key_e key, void *data)
{
int val = status_active_get()->sysman_power_off_status;
#endif
process_mgr_must_launch(APPID_INDICATOR, NULL, NULL, NULL, _after_launch_indicator);
process_mgr_must_launch(APPID_QUICKPANEL, NULL, NULL, NULL, _after_launch_quickpanel);
+ home_mgr_softkey_change(NULL);
return ECORE_CALLBACK_CANCEL;
}