Set display on after launching BT system popup 04/113304/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 19 Dec 2016 02:49:29 +0000 (11:49 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 7 Feb 2017 06:17:11 +0000 (15:17 +0900)
Change-Id: Iaef9e57fd86182acada6b7bc923cf559ee99fe91
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
CMakeLists.txt
data/org.tizen.bt-syspopup.xml
packaging/org.tizen.bt-syspopup.spec
src/bt-syspopup-m.c
src/bt-syspopup-w.c

index 8cdd74a..7444338 100644 (file)
@@ -48,7 +48,9 @@ pkg_check_modules(pkgs REQUIRED
        edbus
        efl-extension
        capi-system-device
-       vconf)
+       vconf
+       capi-ui-efl-util
+       ecore-wayland)
 ELSEIF("$ENV{CFLAGS}" MATCHES "-DTIZEN_PROFILE_MOBILE")
 pkg_check_modules(pkgs REQUIRED
        capi-appfw-application
@@ -75,7 +77,9 @@ pkg_check_modules(pkgs REQUIRED
        notification
        aul
        edbus
-       vconf)
+       vconf
+       capi-ui-efl-util
+       ecore-wayland)
 ENDIF()
 
 FOREACH(flag ${pkgs_CFLAGS})
index 6b9b67c..7f156da 100644 (file)
@@ -12,6 +12,7 @@
        </ui-application>
        <privileges>
                <privilege>http://tizen.org/privilege/window.priority.set</privilege>
+               <privilege>http://tizen.org/privilege/display</privilege>
                <privilege>http://tizen.org/privilege/bluetooth</privilege>
                <privilege>http://tizen.org/privilege/bluetooth.admin</privilege>
        </privileges>
index 6c03621..e5b81e4 100644 (file)
@@ -45,6 +45,8 @@ BuildRequires:  pkgconfig(capi-media-player)
 BuildRequires:  pkgconfig(deviced)
 BuildRequires:  pkgconfig(capi-network-bluetooth)
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(ecore-wayland)
+BuildRequires:  pkgconfig(capi-ui-efl-util)
 
 BuildRequires:  cmake
 BuildRequires:  gettext-devel
index 198b576..216e17a 100644 (file)
@@ -34,7 +34,6 @@
 #include <bluetooth.h>
 #include <bluetooth_internal.h>
 #include <feedback.h>
-#include "bt-syspopup-m.h"
 #include <notification.h>
 #include <bundle.h>
 #include <app_control.h>
 #include <glib.h>
 #include <gio/gio.h>
 #include <gio/giotypes.h>
+#include <efl_util.h>
+#include <Ecore_Wayland.h>
+
+#include "bt-syspopup-m.h"
 
 static void __bluetooth_delete_input_view(struct bt_popup_appdata *ad);
 static void __bluetooth_win_del(void *data);
@@ -69,7 +72,7 @@ static void __bluetooth_terminate(void *data);
 
 static void __bluetooth_remove_all_event(struct bt_popup_appdata *ad);
 
-//static void __bluetooth_set_win_level(Evas_Object *parent);
+static void __bluetooth_set_win_level(Evas_Object *parent);
 
 static void __popup_terminate(void);
 
@@ -1123,7 +1126,7 @@ static void __bluetooth_draw_auth_popup(struct bt_popup_appdata *ad,
        elm_object_style_set(ad->popup, "transparent");
 
        /*set window level to HIGH*/
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        layout = elm_layout_add(ad->popup);
        elm_layout_file_set(layout, CUSTOM_POPUP_PATH, "auth_popup");
@@ -1239,7 +1242,7 @@ static void __bluetooth_draw_popup(struct bt_popup_appdata *ad,
        elm_popup_align_set(ad->popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
 
        /*set window level to HIGH*/
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
 #ifdef TIZEN_REDWOOD
        elm_object_style_set(ad->popup, "transparent");
@@ -1665,7 +1668,7 @@ static void __bluetooth_draw_input_view(struct bt_popup_appdata *ad,
        evas_object_size_hint_weight_set(passpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        /*set window level to HIGH*/
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        elm_object_part_text_set(passpopup, "title,text", title);
 
@@ -1783,7 +1786,7 @@ static void __bluetooth_draw_access_request_popup(struct bt_popup_appdata *ad,
        elm_popup_align_set(ad->popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
 
        /*set window level to HIGH*/
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        if (title != NULL)
                elm_object_part_text_set(ad->popup, "title,text", title);
@@ -1872,7 +1875,7 @@ static void __bluetooth_draw_information_popup(struct bt_popup_appdata *ad,
        eext_object_event_callback_add(ad->popup, EEXT_CALLBACK_BACK, func, ad);
 
        /*set window level to HIGH*/
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        if (title)
                elm_object_part_text_set(ad->popup, "title,text", title);
@@ -1947,7 +1950,7 @@ static void __bluetooth_draw_toast_popup(struct bt_popup_appdata *ad, char *toas
        elm_object_part_text_set(ad->popup, "elm.text.content", toast_text);
        evas_object_smart_callback_add(ad->popup, "block,clicked", __bluetooth_popup_block_clicked_cb, NULL);
 
-//     __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        evas_object_show(ad->popup);
        FN_END;
@@ -2427,39 +2430,19 @@ static void __bluetooth_win_del(void *data)
        BT_DBG("+");
 }
 
-/* utilx and ecore_x APIs are unnecessary in Tizen 3.x based on wayland */
-#if 0
 static void __bluetooth_set_win_level(Evas_Object *parent)
 {
        ret_if(!parent);
-       Ecore_X_Window xwin;
-       int lock_state;
+       BT_DBG("Setting window type");
 
-       xwin = elm_win_xwindow_get(parent);
-       if (xwin == 0) {
-               BT_ERR("elm_win_xwindow_get is failed");
-       } else {
-               BT_DBG("Setting window type");
-               ecore_x_netwm_window_type_set(xwin,
-                               ECORE_X_WINDOW_TYPE_NOTIFICATION);
-               if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock_state) != 0)
-                       BT_ERR("Fail to get the lock_state value");
-
-               /*
-               Issue: Pairing request pop appears in the Lock screen when DUT is locked
-               and observed inconsistency. (TMWC-746)
-               In platform image, don't have the additional logic to handle this.
-               So just the set notification level as LOW.
-                */
-               if (lock_state == VCONFKEY_IDLE_UNLOCK) {
-                       utilx_set_system_notification_level(ecore_x_display_get(),
-                                       xwin, UTILX_NOTIFICATION_LEVEL_HIGH);
-               } else
-                       utilx_set_system_notification_level(ecore_x_display_get(),
-                                       xwin, UTILX_NOTIFICATION_LEVEL_LOW);
-       }
+       Ecore_Wl_Window * wl_win = NULL;
+
+       wl_win = elm_win_wl_window_get(parent);
+       ret_if(!wl_win);
+
+       ecore_wl_window_type_set(wl_win, ECORE_WL_WINDOW_TYPE_NOTIFICATION);
+       efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
 }
-#endif
 
 static Evas_Object *__bluetooth_create_win(const char *name)
 {
@@ -2519,19 +2502,20 @@ static void __bluetooth_session_init(struct bt_popup_appdata *ad)
                BT_ERR("__bt_syspopup_init_app_signal failed");
 }
 
+#if 0
 static void __bluetooth_vconf_change_cb(keynode_t *key, void *data)
 {
        retm_if(NULL == key, "key is NULL");
        retm_if(NULL == data, "data is NULL");
-#if 0
+
        struct bt_popup_appdata *ad = data;
        char *vconf_name = vconf_keynode_get_name(key);
 
        if (!g_strcmp0(vconf_name, VCONFKEY_IDLE_LOCK_STATE) &&
                ad->popup)
-               __bluetooth_set_win_level(ad->popup);
-#endif
+               __bluetooth_set_win_level(ad->win_main);
 }
+#endif
 
 static bool __bluetooth_create(void *data)
 {
@@ -2539,7 +2523,6 @@ static bool __bluetooth_create(void *data)
        Evas_Object *win = NULL;
        Evas_Object *conformant = NULL;
        Evas_Object *layout = NULL;
-       int ret;
 
        BT_DBG("__bluetooth_create() start.");
 
@@ -2573,11 +2556,16 @@ static bool __bluetooth_create(void *data)
        ecore_imf_init();
 
        __bluetooth_session_init(ad);
+#if 0
+{
+       int ret;
+
        ret = vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
                        __bluetooth_vconf_change_cb, ad);
        if (ret != 0)
                BT_ERR("vconf_notify_key_changed fail!");
-
+}
+#endif
        if (bt_initialize() != BT_ERROR_NONE)
                BT_ERR("bt_initialize is failed");
 
@@ -2690,7 +2678,7 @@ static void __bluetooth_reset(app_control_h app_control, void *data)
                        __bluetooth_notify_event(ad);
 
                        /* Change LCD brightness */
-                       ret = device_display_change_state(DISPLAY_STATE_NORMAL);
+                       ret = display_change_state(LCD_NORMAL);
                        if (ret != 0)
                                BT_ERR("Fail to change LCD");
                }
@@ -2714,7 +2702,7 @@ static void __bluetooth_reset(app_control_h app_control, void *data)
                        __bluetooth_notify_event(ad);
 
                        /* Change LCD brightness */
-                       ret = device_display_change_state(DISPLAY_STATE_NORMAL);
+                       ret = display_change_state(LCD_NORMAL);
                        if (ret != 0)
                                BT_ERR("Fail to change LCD");
                }
index dffdd9d..05ef4dd 100644 (file)
@@ -37,6 +37,8 @@
 #include <app_control_internal.h>
 #include <glib.h>
 #include <gio/gio.h>
+#include <efl_util.h>
+#include <Ecore_Wayland.h>
 
 #define COLOR_TABLE "/usr/apps/org.tizen.bt-syspopup/shared/res/tables/com.samsung.bt-syspopup_ChangeableColorTable.xml"
 #define FONT_TABLE "/usr/apps/org.tizen.bt-syspopup/shared/res/tables/com.samsung.bt-syspopup_FontInfoTable.xml"
@@ -152,19 +154,13 @@ static void __bluetooth_cleanup(struct bt_popup_appdata *ad)
 
 static void __bluetooth_set_win_level(Evas_Object *parent)
 {
-#if 0
-       Ecore_X_Window xwin;
-       xwin = elm_win_xwindow_get(parent);
-       if (xwin == 0) {
-               BT_ERR("elm_win_xwindow_get is failed");
-       } else {
-               BT_DBG("Setting window type");
-               ecore_x_netwm_window_type_set(xwin,
-                               ECORE_X_WINDOW_TYPE_NOTIFICATION);
-               utilx_set_system_notification_level(ecore_x_display_get(),
-                               xwin, UTILX_NOTIFICATION_LEVEL_HIGH);
-       }
-#endif
+       Ecore_Wl_Window * wl_win = NULL;
+
+       wl_win = (void *)elm_win_wl_window_get(parent);
+       ret_if(!wl_win);
+
+       ecore_wl_window_type_set(wl_win, ECORE_WL_WINDOW_TYPE_NOTIFICATION);
+       efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
 }
 
 static void __bluetooth_popup_hide_cb(void *data, Evas_Object *obj, void *event_info)
@@ -890,7 +886,7 @@ static void __bluetooth_draw_passkey_display_popup(struct bt_popup_appdata *ad,
        evas_object_smart_callback_add(ad->popup, "dismissed",
                        __bluetooth_popup_hide_finished_cb, NULL);
 
-       __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
        layout = elm_layout_add(ad->popup);
        elm_layout_theme_set(layout, "layout", "popup",
                        "content/circle/buttons1");
@@ -940,7 +936,7 @@ static void __bluetooth_draw_text_popup(struct bt_popup_appdata *ad,
        eext_object_event_callback_add(ad->popup, EEXT_CALLBACK_BACK, __bluetooth_popup_hide_cb, NULL);
        evas_object_smart_callback_add(ad->popup, "dismissed", __bluetooth_popup_hide_finished_cb, NULL);
 
-       __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
        layout = elm_layout_add(ad->popup);
        elm_layout_theme_set(layout, "layout", "popup", "content/circle/buttons2");
 
@@ -1000,7 +996,7 @@ static void __bluetooth_draw_text_popup_no_button(struct bt_popup_appdata *ad,
        eext_object_event_callback_add(ad->popup, EEXT_CALLBACK_BACK, __bluetooth_popup_hide_cb, NULL);
        evas_object_smart_callback_add(ad->popup, "dismissed", __bluetooth_popup_hide_finished_cb, NULL);
 
-       __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        layout = elm_layout_add(ad->popup);
        elm_layout_file_set(layout, CUSTOM_POPUP_PATH, "no_button_passkey_confirm_popup");
@@ -1861,7 +1857,7 @@ static void __bluetooth_draw_toast_popup(struct bt_popup_appdata *ad, char *toas
        evas_object_smart_callback_add(ad->popup, "block,clicked", __bluetooth_popup_block_clicked_cb, NULL);
        elm_object_part_text_set(ad->popup, "elm.text", toast_text);
 
-       __bluetooth_set_win_level(ad->popup);
+       __bluetooth_set_win_level(ad->win_main);
 
        evas_object_show(ad->popup);
        evas_object_show(ad->win_main);
@@ -2094,7 +2090,7 @@ DONE:
                BT_INFO("Block mode is not set");
 
                /* Change LCD brightness */
-               if (device_display_change_state(DISPLAY_STATE_NORMAL) != 0)
+               if (display_change_state(LCD_NORMAL) != 0)
                        BT_ERR("Fail to change LCD");
 
                if (ad->event_type == BT_EVENT_PASSKEY_CONFIRM_REQUEST ||