pkg_check_modules (pkgs REQUIRED
appcore-efl
glib-2.0
+ gio-2.0
elementary
dlog
capi-appfw-application
*
*/
-#ifndef _CALLUI_ACTION_BAR_H_
-#define _CALLUI_ACTION_BAR_H_
+#ifndef __CALLUI_ACTION_BAR_H__
+#define __CALLUI_ACTION_BAR_H__
#include <Elementary.h>
*/
void _callui_action_bar_hide(callui_action_bar_h action_bar);
-#endif /* _CALLUI_ACTION_BAR_H_ */
+#endif /* __CALLUI_ACTION_BAR_H__ */
#ifndef __CALLUI_COMMON_DEFINES_H__
#define __CALLUI_COMMON_DEFINES_H__
+#define _DBUS_DISPLAY_DEVICE_TIMEOUT_
+
#ifndef CALLUI_EXPORT_API
#define CALLUI_EXPORT_API __attribute__ ((visibility("default")))
#endif
LOCK_TYPE_SECURITY_LOCK
} callui_idle_lock_type_t;
-typedef enum {
- LCD_TIMEOUT_SET = 1,
- LCD_TIMEOUT_UNSET,
- LCD_TIMEOUT_LOCKSCREEN_SET, /*After lock-screen comes in Connected state LCD goes to OFF in 5 secs*/
- LCD_TIMEOUT_KEYPAD_SET, /*When Keypad is ON, LCD goes to DIM in 3 secs then goes to OFF in 5 secs*/
- LCD_TIMEOUT_DEFAULT
-} callui_lcd_timeout_t;
-
-typedef enum {
- LCD_ON,
- LCD_ON_LOCK,
- LCD_ON_UNLOCK,
- LCD_UNLOCK,
- LCD_OFF_SLEEP_LOCK,
- LCD_OFF_SLEEP_UNLOCK,
- LCD_OFF
-} callui_lcd_control_t;
-
typedef void (*set_call_duration_time)(struct tm *cur_time, Evas_Object *obj, const char *part);
/**
*/
void _callui_common_reset_main_ly_text_fields(Evas_Object *contents);
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
-/**
- * @brief Set lcd timeout
- *
- * @param[in] state Lcd timer state
- *
- */
-void _callui_common_dvc_set_lcd_timeout(callui_lcd_timeout_t state);
-#endif
-
/**
* @brief state is volume mode on
*
int _callui_common_is_powerkey_mode_on(void);
/**
- * @brief Changed lcd state
- *
- * @param[in] state Lcd control state
- *
- */
-void _callui_common_dvc_control_lcd_state(callui_lcd_control_t state);
-
-/**
- * @brief Gets lcd state
- *
- * return Lcd control state
- *
- */
-callui_lcd_control_t _callui_common_get_lcd_state();
-
-/**
* @brief State of earjack connection
*
* @return state
--- /dev/null
+/*
+ * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __CALLUI_DISPLAY_H__
+#define __CALLUI_DISPLAY_H__
+
+#include "callui-common-types.h"
+
+typedef enum {
+ CALLUI_DISPLAY_TIMEOUT_DEFAULT = 0,
+ CALLUI_DISPLAY_TIMEOUT_SET,
+ CALLUI_DISPLAY_TIMEOUT_UNSET,
+ CALLUI_DISPLAY_TIMEOUT_LS_SET /* After lock-screen comes in Connected state display goes to OFF in 5 secs */
+} callui_display_timeout_e;
+
+typedef enum {
+ CALLUI_DISPLAY_ON = 0,
+ CALLUI_DISPLAY_ON_LOCK,
+ CALLUI_DISPLAY_ON_UNLOCK,
+ CALLUI_DISPLAY_UNLOCK,
+ CALLUI_DISPLAY_OFF_SLEEP_LOCK,
+ CALLUI_DISPLAY_OFF_SLEEP_UNLOCK,
+ CALLUI_DISPLAY_OFF
+} callui_display_control_e;
+
+typedef struct __callui_display *callui_display_h;
+
+typedef struct appdata callui_app_data_t;
+
+callui_display_h _callui_display_create(callui_app_data_t *appdata);
+
+void _callui_display_destroy(callui_display_h disp);
+
+callui_result_e _callui_display_set_timeout(callui_display_h disp, callui_display_timeout_e timeout_type);
+
+callui_result_e _callui_display_set_control_state(callui_display_h disp, callui_display_control_e state);
+
+callui_result_e _callui_display_get_control_state(callui_display_h disp, callui_display_control_e *state);
+
+#endif /* __CALLUI_DISPLAY_H__ */
#include "callui-state-provider.h"
#include "callui-view-quickpanel.h"
#include "callui-action-bar.h"
+#include "callui-display.h"
#define APP_HANDLERS_COUNT 1
Evas_Object *main_ly;
callui_qp_mc_h qp_minicontrol;
+ callui_display_h display;
Evas_Object *ctxpopup;
Evas_Object *second_call_popup;
BuildRequires: cmake
BuildRequires: gettext-tools
BuildRequires: edje-tools
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(capi-system-system-settings)
static Evas_Object *__create_main_layout(callui_action_bar_h action_bar, Evas_Object *parent)
{
- debug_enter();
Evas_Object *layout = _callui_load_edj(parent, EDJ_NAME, GRP_BUTTON_LAYOUT);
CALLUI_RETURN_NULL_IF_FAIL(layout);
evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL, __main_layout_del_cb, action_bar);
#include <sys/sysinfo.h>
#include <time.h>
#include <contacts.h>
-#include <device/display.h>
-#include <device/power.h>
-#include <dbus/dbus.h>
-#include <gio/gio.h>
#include <runtime_info.h>
#include <bluetooth.h>
#include <system_settings.h>
#include <efl_util.h>
-#include <app_common.h>
#include <msg.h>
#include <msg_transport.h>
#define CONTACT_PKG "org.tizen.contacts"
#define PHONE_PKG "org.tizen.phone"
#define BLUETOOTH_PKG "ug-bluetooth-efl"
-#define BUS_NAME "org.tizen.system.deviced"
-#define OBJECT_PATH "/Org/Tizen/System/DeviceD"
-#define INTERFACE_NAME BUS_NAME
-
-#define DEVICED_PATH_DISPLAY OBJECT_PATH"/Display"
-#define DEVICED_INTERFACE_DISPLAY INTERFACE_NAME".display"
-#define LCD_ON_SIGNAL_NAME "LCDOnByPowerkey"
-#define METHOD_SET_LCDTIMEOUT "setlcdtimeout"
#define TIME_BUF_LEN (16)
-#define DBUS_REPLY_TIMEOUT (120 * 1000)
-
static bool g_is_headset_connected;
-struct dbus_byte {
- const char *data;
- int size;
-};
-
Eina_Bool _callui_common_is_earjack_connected(void)
{
int result = EINA_FALSE;
}
app_control_destroy(service);
- g_free(uri);
+ free(uri);
return;
}
app_control_destroy(service);
}
-/* LCD api */
-void _callui_common_dvc_control_lcd_state(callui_lcd_control_t state)
-{
- dbg("[%d]", state);
- int result = -1;
- switch (state) {
- case LCD_ON:
- result = device_display_change_state(DISPLAY_STATE_NORMAL);
- break;
-
- case LCD_ON_LOCK:
- result = device_display_change_state(DISPLAY_STATE_NORMAL);
- result = device_power_request_lock(POWER_LOCK_DISPLAY, 0);
- break;
-
- case LCD_ON_UNLOCK:
- result = device_display_change_state(DISPLAY_STATE_NORMAL);
- result = device_power_release_lock(POWER_LOCK_DISPLAY);
- result = device_power_release_lock(POWER_LOCK_CPU);
- break;
-
- case LCD_UNLOCK:
- result = device_power_release_lock(POWER_LOCK_DISPLAY);
- result = device_power_release_lock(POWER_LOCK_CPU);
- break;
-
- case LCD_OFF_SLEEP_LOCK:
- result = device_power_request_lock(POWER_LOCK_CPU, 0);
- break;
-
- case LCD_OFF_SLEEP_UNLOCK:
- result = device_power_release_lock(POWER_LOCK_CPU);
- break;
-
- case LCD_OFF:
- result = device_display_change_state(DISPLAY_STATE_SCREEN_OFF);
- break;
-
- default:
- break;
- }
- if (result != DEVICE_ERROR_NONE)
- warn("error during change lcd state");
-}
-
-callui_lcd_control_t _callui_common_get_lcd_state()
-{
- display_state_e state = DISPLAY_STATE_NORMAL;
- int result = device_display_get_state(&state);
- if (result != DEVICE_ERROR_NONE) {
- warn("error during get lcd state");
- }
- switch (state) {
- case DISPLAY_STATE_SCREEN_OFF:
- return LCD_OFF;
- case DISPLAY_STATE_NORMAL:
- case DISPLAY_STATE_SCREEN_DIM:
- default:
- return LCD_ON;
- }
-}
-
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
-
-static int __callui_common_dvc_append_variant(DBusMessageIter *iter, const char *sig, char *param[])
-{
- char *ch = NULL;
- int i;
- int int_type;
- uint64_t int64_type;
- DBusMessageIter arr;
- struct dbus_byte *byte;
-
- if (!sig || !param)
- return 0;
-
- for (ch = (char *)sig, i = 0; *ch != '\0'; ++i, ++ch) {
- switch (*ch) {
- case 'i':
- int_type = atoi(param[i]);
- dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &int_type);
- break;
- case 'u':
- int_type = strtoul(param[i], NULL, 10);
- dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &int_type);
- break;
- case 't':
- int64_type = atoll(param[i]);
- dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64, &int64_type);
- break;
- case 's':
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, ¶m[i]);
- break;
- case 'a':
- if ((ch+1 != NULL) && (*(ch+1) == 'y')) {
- dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &arr);
- byte = (struct dbus_byte *)param[i];
- dbus_message_iter_append_fixed_array(&arr, DBUS_TYPE_BYTE, &(byte->data), byte->size);
- dbus_message_iter_close_container(iter, &arr);
- ch++;
- }
- break;
- default:
- return -EINVAL;
- }
- }
- return 0;
-}
-
-static void __callui_common_dvc_dbus_reply_cb(DBusPendingCall *call, gpointer user_data)
-{
- //TODO DBus is not supported. Need to move on kdbus or gdbus
-
- DBusMessage *reply;
- DBusError derr;
-
- reply = dbus_pending_call_steal_reply(call);
- dbus_error_init(&derr);
-
- if (dbus_set_error_from_message(&derr, reply)) {
- err("__callui_common_dvc_dbus_reply_cb error: %s, %s",
- derr.name, derr.message);
- dbus_error_free(&derr);
- goto done;
- }
- dbus_pending_call_unref(call);
-done:
- dbg("__callui_common_dvc_dbus_reply_cb : -");
- dbus_message_unref(reply);
-}
-
-gboolean __callui_common_dvc_invoke_dbus_method_async(const char *dest,
- const char *path,
- const char *interface,
- const char *method, const char *sig, char *param[])
-{
- // TODO DBus is not supported. Need to move on kdbus or gdbus
-
- DBusConnection *conn = NULL;
- DBusMessage *msg = NULL;
- DBusMessageIter iter;
- DBusPendingCall *c = NULL;
- dbus_bool_t ret = FALSE;
- int r = -1;
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
- if (!conn) {
- err("dbus bus get error");
- return FALSE;
- }
-
- msg = dbus_message_new_method_call(dest, path, interface, method);
- if (!msg) {
- err("dbus_message_new_method_call(%s:%s-%s",
- path, interface, method);
- return FALSE;
- }
- dbus_message_iter_init_append(msg, &iter);
- r = __callui_common_dvc_append_variant(&iter, sig, param);
- if (r < 0) {
- err("append_variant error : %d", r);
- goto EXIT;
- }
-
- ret = dbus_connection_send_with_reply(conn, msg, &c, DBUS_REPLY_TIMEOUT);
- if (!ret) {
- err("dbus_connection_send_ error (False returned)");
- }
- dbus_pending_call_set_notify(c, __callui_common_dvc_dbus_reply_cb, NULL, NULL);
-
-EXIT:
- dbus_message_unref(msg);
-
- return ret;
- return true;
-}
-
-void _callui_common_dvc_set_lcd_timeout(callui_lcd_timeout_t state)
-{
- int powerkey_mode = 0;
- char str_on[32];
- char str_dim[32];
- char str_holdkey[2];
- char *ar[3];
- int ret = vconf_get_bool(VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, &powerkey_mode);
- if (ret < 0) {
- err("vconf_get_int failed..[%d]\n", ret);
- }
-
- dbg("set timeout : %d, powerkeymode : %d", state, powerkey_mode);
- if (state == LCD_TIMEOUT_SET) {
- snprintf(str_on, sizeof(str_on), "%d", 10);
- snprintf(str_dim, sizeof(str_dim), "%d", 20);
- snprintf(str_holdkey, sizeof(str_holdkey), "%d", powerkey_mode);
- } else if (state == LCD_TIMEOUT_UNSET) {
- snprintf(str_on, sizeof(str_on), "%d", 0);
- snprintf(str_dim, sizeof(str_dim), "%d", 0);
- snprintf(str_holdkey, sizeof(str_holdkey), "%d", powerkey_mode);
- } else if (state == LCD_TIMEOUT_LOCKSCREEN_SET) { /*After lock-screen comes in Connected state LCD goes to OFF in 5 secs*/
- snprintf(str_on, sizeof(str_on), "%d", 5);
- snprintf(str_dim, sizeof(str_dim), "%d", 0);
- snprintf(str_holdkey, sizeof(str_holdkey), "%d", powerkey_mode);
- } else if (state == LCD_TIMEOUT_KEYPAD_SET) {
- snprintf(str_on, sizeof(str_on), "%d", 3);
- snprintf(str_dim, sizeof(str_dim), "%d", 5);
- snprintf(str_holdkey, sizeof(str_holdkey), "%d", powerkey_mode);
- } else {
- snprintf(str_on, sizeof(str_on), "%d", 0);
- snprintf(str_dim, sizeof(str_dim), "%d", 0);
- snprintf(str_holdkey, sizeof(str_holdkey), "%d", 0);
- }
-
- dbg("on(%s), dim(%s), hold(%s)", str_on, str_dim, str_holdkey);
-
- ar[0] = str_on;
- ar[1] = str_dim;
- ar[2] = str_holdkey;
-
- __callui_common_dvc_invoke_dbus_method_async(BUS_NAME,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- METHOD_SET_LCDTIMEOUT, "iii", ar);
-}
-
-#endif
-
void _callui_common_reset_main_ly_text_fields(Evas_Object *contents)
{
dbg("..");
msg_set_int_value(msgInfo, MSG_MESSAGE_SIM_INDEX_INT, slot_id);
/* No setting send option */
- msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, FALSE);
+ msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
/* Set message body */
if (msg_set_str_value(msgInfo, MSG_MESSAGE_SMS_DATA_STR, reject_msg, strlen(reject_msg)) != MSG_SUCCESS) {
--- /dev/null
+/*
+ * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <gio/gio.h>
+#include <vconf.h>
+#include <stdlib.h>
+#include <efl_util.h>
+#include <device/power.h>
+#include <device/display.h>
+
+#include "callui.h"
+#include "callui-display.h"
+#include "callui-debug.h"
+#include "callui-common-def.h"
+
+struct __callui_display {
+ GDBusConnection *conn;
+ GCancellable *cancel_obj;
+ callui_app_data_t *ad;
+};
+typedef struct __callui_display __callui_display_t;
+
+#define BUS_NAME "org.tizen.system.deviced"
+#define OBJECT_PATH "/Org/Tizen/System/DeviceD"
+#define INTERFACE_NAME BUS_NAME
+#define DEVICED_PATH_DISPLAY OBJECT_PATH"/Display"
+#define DEVICED_INTERFACE_DISPLAY INTERFACE_NAME".display"
+#define METHOD_SET_DISPLAY_TIMEOUT "setlcdtimeout"
+
+#define TIMEOUT_PARAMS_COUNT 3
+#define DBUS_REPLY_TIMEOUT (120 * 1000)
+
+static callui_result_e _callui_display_init(callui_display_h display, callui_app_data_t *appdata);
+static void _callui_display_deinit(callui_display_h display);
+static callui_result_e __send_gdbus_msg_async(callui_display_h display, int *param);
+static void __gdbus_reply_msg_async_cb(GObject *source_object, GAsyncResult *res, gpointer user_data);
+
+static callui_result_e _callui_display_init(callui_display_h display, callui_app_data_t *appdata)
+{
+ display->ad = appdata;
+
+ GError *err = NULL;
+ display->conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
+ if (err) {
+ err("Connection error occurred. [%d]-[%s]", err->code, err->message);
+ g_error_free(err);
+ return CALLUI_RESULT_FAIL;
+ }
+
+ display->cancel_obj = g_cancellable_new();
+ CALLUI_RETURN_VALUE_IF_FAIL(display->cancel_obj, CALLUI_RESULT_FAIL);
+
+ return CALLUI_RESULT_OK;
+}
+
+static void _callui_display_deinit(callui_display_h display)
+{
+ g_cancellable_cancel(display->cancel_obj);
+
+ g_object_unref (display->cancel_obj);
+
+ g_object_unref(display->conn);
+}
+
+callui_display_h _callui_display_create(callui_app_data_t *appdata)
+{
+ CALLUI_RETURN_NULL_IF_FAIL(appdata);
+
+ callui_display_h contr = calloc(1, sizeof(__callui_display_t));
+ CALLUI_RETURN_NULL_IF_FAIL(contr);
+
+ callui_result_e res = _callui_display_init(contr, appdata);
+ if (res != CALLUI_RESULT_OK) {
+ _callui_display_deinit(contr);
+ FREE(contr);
+ }
+ return contr;
+}
+
+void _callui_display_destroy(callui_display_h display)
+{
+ CALLUI_RETURN_IF_FAIL(display);
+
+ _callui_display_deinit(display);
+
+ free(display);
+}
+
+static void __gdbus_reply_msg_async_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
+{
+ GError *err = NULL;
+ GDBusMessage *reply_msg =
+ g_dbus_connection_send_message_with_reply_finish(G_DBUS_CONNECTION(source_object), res, &err);
+
+ if (err) {
+ err("Local in-process error occurred. [%d]-[%s]", err->code, err->message);
+ g_error_free(err);
+ }
+
+ if (reply_msg) {
+ dbg("Reply message was received");
+ if (g_dbus_message_to_gerror(reply_msg, &err)) {
+ dbg("Reply is an error. [%d]-[%s]", err->code, err->message);
+ g_error_free(err);
+ }
+ } else {
+ err("There is no reply message");
+ }
+
+ g_object_unref(reply_msg);
+
+ debug_leave();
+}
+
+static callui_result_e __send_gdbus_msg_async(callui_display_h display, int *param)
+{
+ if (!display->conn) {
+ return CALLUI_RESULT_FAIL;
+ }
+
+ GDBusMessage *msg = g_dbus_message_new_method_call(BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ METHOD_SET_DISPLAY_TIMEOUT);
+ if (!msg) {
+ err("g_dbus_message_new_method_call() failed");
+ return CALLUI_RESULT_FAIL;
+ }
+
+ GVariant *arguments = g_variant_new("(iii)", param[0], param[1], param[2]);
+ if (!arguments) {
+ err("g_variant_new() failed.");
+ g_object_unref(msg);
+ return CALLUI_RESULT_FAIL;
+ }
+
+ g_dbus_message_set_body(msg, arguments);
+
+ g_dbus_connection_send_message_with_reply(
+ display->conn,
+ msg,
+ G_DBUS_SEND_MESSAGE_FLAGS_NONE,
+ DBUS_REPLY_TIMEOUT,
+ NULL,
+ display->cancel_obj,
+ __gdbus_reply_msg_async_cb,
+ NULL);
+
+ g_object_unref (msg);
+
+ return CALLUI_RESULT_OK;
+}
+
+callui_result_e _callui_display_set_timeout(callui_display_h display, callui_display_timeout_e timeout_type)
+{
+ debug_enter();
+
+ CALLUI_RETURN_VALUE_IF_FAIL(display, CALLUI_RESULT_INVALID_PARAM);
+ CALLUI_RETURN_VALUE_IF_FAIL((timeout_type >= CALLUI_DISPLAY_TIMEOUT_DEFAULT) &&
+ (timeout_type <= CALLUI_DISPLAY_TIMEOUT_LS_SET), CALLUI_RESULT_INVALID_PARAM);
+
+ int powerkey_mode = 0;
+ int res = vconf_get_bool(VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, &powerkey_mode);
+ if (res < 0) {
+ err("vconf_get_int failed. res[%d]", res);
+ }
+
+ dbg("timeout type [%d], powerkeymode [%d]", timeout_type, powerkey_mode);
+
+ int timeout_params[TIMEOUT_PARAMS_COUNT] = { 0 };
+ timeout_params[2] = powerkey_mode;
+
+ switch(timeout_type) {
+ case CALLUI_DISPLAY_TIMEOUT_SET:
+ timeout_params[0] = 10;
+ timeout_params[1] = 20;
+ break;
+ case CALLUI_DISPLAY_TIMEOUT_UNSET:
+ break;
+ case CALLUI_DISPLAY_TIMEOUT_LS_SET: /*After lock-screen comes in Connected state LCD goes to OFF in 5 secs*/
+ timeout_params[0] = 5;
+ timeout_params[1] = 0;
+ break;
+ case CALLUI_DISPLAY_TIMEOUT_DEFAULT:
+ timeout_params[2] = 0;
+ break;
+ default:
+ break;
+ }
+
+ return __send_gdbus_msg_async(display, timeout_params);
+}
+
+callui_result_e _callui_display_set_control_state(callui_display_h display, callui_display_control_e state)
+{
+ debug_enter();
+
+ CALLUI_RETURN_VALUE_IF_FAIL(display, CALLUI_RESULT_INVALID_PARAM);
+
+ dbg("[%d]", state);
+ int result = -1;
+ switch (state) {
+ case CALLUI_DISPLAY_ON:
+ result = device_display_change_state(DISPLAY_STATE_NORMAL);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == DEVICE_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+ case CALLUI_DISPLAY_ON_LOCK:
+ result = device_display_change_state(DISPLAY_STATE_NORMAL);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == DEVICE_ERROR_NONE, CALLUI_RESULT_FAIL);
+ result = efl_util_set_window_screen_mode(display->ad->win, EFL_UTIL_SCREEN_MODE_ALWAYS_ON);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ case CALLUI_DISPLAY_ON_UNLOCK:
+ result = device_display_change_state(DISPLAY_STATE_NORMAL);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == DEVICE_ERROR_NONE, CALLUI_RESULT_FAIL);
+ result = efl_util_set_window_screen_mode(display->ad->win, EFL_UTIL_SCREEN_MODE_DEFAULT);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ result = device_power_release_lock(POWER_LOCK_CPU);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == DEVICE_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ case CALLUI_DISPLAY_UNLOCK:
+ result = efl_util_set_window_screen_mode(display->ad->win, EFL_UTIL_SCREEN_MODE_DEFAULT);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ result = device_power_release_lock(POWER_LOCK_CPU);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ case CALLUI_DISPLAY_OFF_SLEEP_LOCK:
+ result = device_power_request_lock(POWER_LOCK_CPU, 0);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ case CALLUI_DISPLAY_OFF_SLEEP_UNLOCK:
+ result = device_power_release_lock(POWER_LOCK_CPU);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ case CALLUI_DISPLAY_OFF:
+ result = device_display_change_state(DISPLAY_STATE_SCREEN_OFF);
+ CALLUI_RETURN_VALUE_IF_FAIL(result == EFL_UTIL_ERROR_NONE, CALLUI_RESULT_FAIL);
+ break;
+
+ default:
+ break;
+ }
+ return CALLUI_RESULT_OK;
+}
+
+callui_result_e _callui_display_get_control_state(callui_display_h display, callui_display_control_e *state)
+{
+ CALLUI_RETURN_VALUE_IF_FAIL(display, CALLUI_RESULT_INVALID_PARAM);
+
+ display_state_e disp_state = DISPLAY_STATE_NORMAL;
+ int res = device_display_get_state(&disp_state);
+ if (res != DEVICE_ERROR_NONE) {
+ err("device_display_get_state() failed. res[%d]", res);
+ return CALLUI_RESULT_FAIL;
+ }
+
+ switch (disp_state) {
+ case DISPLAY_STATE_SCREEN_OFF:
+ *state = CALLUI_DISPLAY_OFF;
+ break;
+ case DISPLAY_STATE_NORMAL:
+ case DISPLAY_STATE_SCREEN_DIM:
+ default:
+ *state = CALLUI_DISPLAY_ON;
+ break;
+ }
+
+ return CALLUI_RESULT_OK;
+}
_callui_lock_manager_start(ad->lock_handle);
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
-#endif
-
Evas_Object *parent = ad->main_ly;
eext_object_event_callback_del(parent, EEXT_CALLBACK_BACK, __back_button_click_cb);
keypad->is_keypad_show = EINA_TRUE;
- /* change LCD timeout duration */
_callui_lock_manager_stop(ad->lock_handle);
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_KEYPAD_SET);
-#endif
Evas_Object *parent = ad->main_ly;
eext_object_event_callback_add(parent, EEXT_CALLBACK_BACK, __back_button_click_cb, keypad);
callui_result_e _callui_listeners_coll_call_listeners(_callui_listeners_coll_t *listeners_coll, ...)
{
+ debug_enter();
CALLUI_RETURN_VALUE_IF_FAIL(listeners_coll, CALLUI_RESULT_INVALID_PARAM);
-
CALLUI_RETURN_VALUE_IF_FAIL(listeners_coll->is_initialized, CALLUI_RESULT_FAIL);
listeners_coll->is_locked = true;
EINA_LIST_FOREACH(listeners_coll->list, l, data) {
if(data != NULL) {
- dbg("calling listener start...");
va_list args;
va_start(args, listeners_coll);
data->handler(data, args);
va_end(args);
- dbg("... calling listener done");
}
}
#define SENSOR_INTERVAL 100
typedef enum {
- PLM_LCD_NONE,
- PLM_LCD_ON,
- PLM_LCD_OFF
+ CALLUI_PLM_LCD_NONE,
+ CALLUI_PLM_LCD_ON,
+ CALLUI_PLM_LCD_OFF
} proximity_lock_manager_state;
typedef struct proximity_lock {
CALLUI_RETURN_IF_FAIL(sensor_data);
float value = sensor_data->values[0];
dbg("changed proximity sensor value = %f", value);
+ callui_app_data_t *ad = _callui_get_app_data();
+
if (value > 0) {
- if (proximity_h->state == PLM_LCD_OFF) {
- _callui_common_dvc_control_lcd_state(LCD_ON);
- proximity_h->state = PLM_LCD_ON;
+ if (proximity_h->state == CALLUI_PLM_LCD_OFF) {
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_ON);
+ proximity_h->state = CALLUI_PLM_LCD_ON;
if (proximity_h->unlock_cb) {
proximity_h->unlock_cb(proximity_h->cb_data);
proximity_h->unlock_cb = NULL;
}
}
} else {
- if (_callui_common_get_lcd_state() != LCD_OFF) {
- _callui_common_dvc_control_lcd_state(LCD_OFF);
- proximity_h->state = PLM_LCD_OFF;
+ callui_display_control_e state;
+ if (_callui_display_get_control_state(ad->display, &state) == CALLUI_RESULT_OK &&
+ CALLUI_DISPLAY_OFF == state) {
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_OFF);
+ proximity_h->state = CALLUI_PLM_LCD_OFF;
}
}
}
proximity_lock_t *proximity_h = calloc(1, sizeof(proximity_lock_t));
CALLUI_RETURN_NULL_IF_FAIL(proximity_h);
proximity_h->is_started = false;
- proximity_h->state = PLM_LCD_NONE;
+ proximity_h->state = CALLUI_PLM_LCD_NONE;
proximity_h->unlock_cb = NULL;
proximity_h->cb_data = NULL;
if (ret != SENSOR_ERROR_NONE) {
err("sensor_listener_start() failed(%d)", ret);
}
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
+ callui_app_data_t *ad = _callui_get_app_data();
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
#endif
proximity_h->is_started = true;
err("sensor_listener_stop() failed(%d)", ret);
}
proximity_h->is_started = false;
- proximity_h->state = PLM_LCD_NONE;
+ proximity_h->state = CALLUI_PLM_LCD_NONE;
}
static bool __callui_proximity_lock_manager_is_started(void *lock_h)
dbg("..");
CALLUI_RETURN_VALUE_IF_FAIL(lock_h, false);
proximity_lock_t *proximity_h = (proximity_lock_t *)lock_h;
- return (proximity_h->state == PLM_LCD_OFF);
+ return (proximity_h->state == CALLUI_PLM_LCD_OFF);
}
static void __callui_proximity_lock_manager_set_callback_on_unlock(void *lock_h, unlock_cb_t callback, void *data)
#include "callui-manager.h"
#include "callui-state-provider.h"
+#include "callui-sound-manager.h"
#define CALLUI_DURING_ICON "call_button_icon_03.png"
#define CALLUI_REJECT_ICON "call_button_icon_04.png"
callui_app_data_t *ad = vd->base_view.ad;
// TODO: need to replace from view
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
- /* Set LCD timeout for call state */
- /* LCD is alwasy on during incoming call screen */
- callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(ad->call_sdm);
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
+ /* Set display timeout for call state */
+ callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(ad->sound_manager);
if (audio_state == CALLUI_AUDIO_STATE_SPEAKER) {
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
}
#endif
#include "callui-view-circle.h"
#include "callui-common.h"
#include "callui-state-provider.h"
+#include "callui-sound-manager.h"
#define CALLUI_REJ_MSG_GENLIST_DATA "reject_msg_genlist_data"
#define CALLUI_REJ_MSG_LIST_OPEN_STATUS_KEY "list_open_status_key"
callui_app_data_t *ad = vd->base_view.ad;
// TODO: need to replace from view
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
/* Set LCD timeout for call state */
- /* LCD is alwasy on during incoming call screen */
- callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(ad->call_sdm);
+ callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(ad->sound_manager);
if (audio_state == CALLUI_AUDIO_STATE_SPEAKER) {
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
}
#endif
evas_object_raise(lock_screen_priv->layout);
evas_object_show(lock_screen_priv->layout);
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
if (_callui_vm_get_cur_view_type(ad->view_manager) != CALLUI_VIEW_DIALLING) {
dbg("lcd show");
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_LOCKSCREEN_SET);
+ callui_app_data_t *ad = _callui_get_app_data();
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_LS_SET);
}
#endif
evas_object_hide(lock_screen_priv->layout);
lock_screen_priv->is_locked = false;
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
if (_callui_vm_get_cur_view_type(ad->view_manager) != CALLUI_VIEW_DIALLING) {
dbg("lcd hide");
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
+ callui_app_data_t *ad = _callui_get_app_data();
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
}
#endif
#include <vconf-keys.h>
#include <bluetooth.h>
#include <system_settings.h>
+#include <efl_util.h>
#include "callui.h"
#include "callui-debug.h"
switch (call_event_type) {
case CALLUI_CALL_EVENT_ACTIVE:
if (_callui_lock_manager_is_lcd_off(ad->lock_handle)) {
- _callui_common_dvc_control_lcd_state(LCD_UNLOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_UNLOCK);
} else {
- _callui_common_dvc_control_lcd_state(LCD_ON_UNLOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_ON_UNLOCK);
}
-#ifdef _DBUS_DVC_LSD_TIMEOUT_
+#ifdef _DBUS_DISPLAY_DEVICE_TIMEOUT_
callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(ad->sound_manager);
if (audio_state == CALLUI_AUDIO_STATE_SPEAKER) {
- _callui_common_dvc_set_lcd_timeout(LCD_TIMEOUT_SET);
+ _callui_display_set_timeout(ad->display, CALLUI_DISPLAY_TIMEOUT_SET);
}
#endif
break;
case CALLUI_CALL_EVENT_END:
if (_callui_lock_manager_is_lcd_off(ad->lock_handle)) {
- _callui_common_dvc_control_lcd_state(LCD_UNLOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_UNLOCK);
} else {
- _callui_common_dvc_control_lcd_state(LCD_ON_UNLOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_ON_UNLOCK);
}
break;
default:
static bool __app_init(callui_app_data_t *ad)
{
- _callui_common_dvc_control_lcd_state(LCD_OFF_SLEEP_LOCK);
-
__init_app_event_handlers(ad);
__bt_init();
ad->keypad = _callui_keypad_create(ad);
CALLUI_RETURN_VALUE_IF_FAIL(ad->keypad, __app_deinit(ad));
- ad->lock_handle = _callui_lock_manager_create();
- CALLUI_RETURN_VALUE_IF_FAIL(ad->lock_handle, __app_deinit(ad));
-
ad->qp_minicontrol =_callui_qp_mc_create(ad);
CALLUI_RETURN_VALUE_IF_FAIL(ad->qp_minicontrol, __app_deinit(ad));
+ ad->display = _callui_display_create(ad);
+ CALLUI_RETURN_VALUE_IF_FAIL(ad->display, __app_deinit(ad));
+
+ ad->lock_handle = _callui_lock_manager_create();
+ CALLUI_RETURN_VALUE_IF_FAIL(ad->lock_handle, __app_deinit(ad));
+
__set_main_win_key_grab(ad);
__add_ecore_event_key_handlers(ad);
elm_exit();
}
+static void __main_win_screen_mode_error_cb(Evas_Object *window, int error_code, void *user_data)
+{
+ err("__main_win_screen_mode_error_cb() return res[%d]", error_code);
+}
+
static Evas_Object *__create_main_window(callui_app_data_t *ad)
{
Evas_Object *eo = elm_win_add(NULL, PACKAGE, ELM_WIN_NOTIFICATION);
elm_win_title_set(eo, PACKAGE);
evas_object_smart_callback_add(eo, "delete,request", __main_win_delete_request_cb, NULL);
+ efl_util_set_window_screen_mode_error_cb(eo, __main_win_screen_mode_error_cb, NULL);
elm_win_screen_size_get(eo, NULL, NULL, &ad->root_w, &ad->root_h);
evas_object_resize(eo, ad->root_w, ELM_SCALE_SIZE(MTLOCK_ACTIVE_NOTI_CALL_HEIGHT));
ad->keypad = NULL;
}
+ if (ad->display) {
+ _callui_display_destroy(ad->display);
+ ad->display = NULL;
+ }
+
if (ad->main_ly) {
evas_object_del(ad->main_ly);
ad->main_ly = NULL;
}
+ if (ad->win) {
+ efl_util_unset_window_screen_mode_error_cb(ad->win);
+ }
+
free(ad->end_call_data);
__bt_deinit();
&& !ad->waiting_dialing) {
err("CALLUI_VIEW_UNDEFINED. Clear data");
__reset_state_params(ad);
- _callui_common_dvc_control_lcd_state(LCD_OFF_SLEEP_LOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_OFF_SLEEP_LOCK);
}
ret = app_control_get_operation(app_control, &operation);
if ((strcmp(operation, APP_CONTROL_OPERATION_CALL) == 0) &&
(strncmp(uri_bundle, "tel:", 4) == 0)) {
if ((strncmp(uri_bundle, "tel:MT", 6) == 0)) {
- _callui_common_dvc_control_lcd_state(LCD_ON_LOCK);
+ _callui_display_set_control_state(ad->display, CALLUI_DISPLAY_ON_LOCK);
ret = app_control_get_extra_data(app_control, "handle", &tmp);
if (ret != APP_CONTROL_ERROR_NONE) {
err("app_control_get_extra_data failed");