Add keygrab privilege & fix tzsh region 72/78572/2 accepted/tizen/mobile/20160706.083306 submit/accepted/tizen_common/20160706.065522 submit/tizen_mobile/20160706.074645
authorjunkyu han <junkyu.han@samsung.com>
Wed, 6 Jul 2016 06:29:17 +0000 (15:29 +0900)
committerjunkyu han <junkyu.han@samsung.com>
Wed, 6 Jul 2016 06:51:11 +0000 (15:51 +0900)
Change-Id: Id06652b799d85c61422ca02e65af2e552c98fab3

include/view.h
org.tizen.volume.xml
src/bt.c
src/control.c
src/view.c

index 2d14fec..8b917c0 100755 (executable)
@@ -48,6 +48,7 @@ extern Evas_Object *volume_view_window_create(void);
 
 extern Evas_Object* show_lockscreen_splash(const char *bg_path);
 extern volume_error_e hide_lockscreen_splash(void);
+extern void volume_service_region_set(Evas_Object *win, Eina_Bool is_warning_visible);
 
 
 #endif /* __VOLUME_VIEW_H__ */
index 304cd31..f67e70a 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.volume" version="0.1.148" install-location="internal-only" api-version="2.3.1">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.volume" version="0.1.148" install-location="internal-only" api-version="2.4">
        <label>Volume</label>
        <author email="junkyu.han@samsung.com" href="www.samsung.com">junkyu Han</author>
        <description>Volume Application</description>
@@ -15,6 +15,7 @@
                <privilege>http://tizen.org/privilege/internal/default/public</privilege>
                <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
                <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+               <privilege>http://tizen.org/privilege/keygrab</privilege>
        </privileges>
 
 </manifest>
index 7f99354..94ed31c 100644 (file)
--- a/src/bt.c
+++ b/src/bt.c
@@ -104,6 +104,7 @@ static void _bt_volume_changed_cb(int volume, void *user_data)
        if (bt_opened == true && sound_type == SOUND_TYPE_CALL)
        {
                _bt_display_bt_volume_view(sound_type, sound, vibration, bt_opened);
+               _D("BT SCO volume level is : %d", volume);
                if (VOLUME_ERROR_OK != volume_view_slider_value_set(volume))
                        _E("Failed to set slider value");
 
index 238ffec..b780f83 100755 (executable)
@@ -20,6 +20,7 @@
 #include <bluetooth.h>
 #include <bluetooth_internal.h>
 #include <bluetooth_extension.h>
+#include <bundle_internal.h>
 
 #include "main.h"
 #include "_util_efl.h"
@@ -280,6 +281,15 @@ void volume_control_show_hide_worning()
        }
 }
 
+static Eina_Bool _volume_region_set_timer_cb(void *data)
+{
+       Evas_Object *win = data;
+
+       volume_service_region_set(win, EINA_FALSE);
+
+       return EINA_FALSE;
+}
+
 Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int sound, bool bt_opened)
 {
        _D("Volume control show");
@@ -327,6 +337,7 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun
                        if(VOLUME_ERROR_OK != volume_view_window_show(sound_type)) {
                                _E("Failed to show volume window");
                        }
+                       ecore_timer_add(1.0f, _volume_region_set_timer_cb, win);
                }
 
                control_info.is_launching = EINA_TRUE;
@@ -364,8 +375,6 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun
                //@TODO: need to check
                volume_view_volume_icon_set(sound_type, sound, vibration, bt_opened);
 
-               volume_service_region_set(win, false);
-
                return EINA_TRUE;
        }
 }
@@ -541,7 +550,6 @@ volume_error_e volume_control_initialize(void)
 
        elm_win_screen_size_get(win, NULL, NULL, &(control_info.viewport_width), &(control_info.viewport_height));
 
-
        /* Set available rotations */
        _control_set_window_rotation(win);
 
index 3227b2c..668da6c 100755 (executable)
@@ -336,7 +336,9 @@ Evas_Object *add_slider(Evas_Object *parent, int min, int max, int val)
 volume_error_e volume_view_window_show(sound_type_e type)
 {
        _D("Volume view window SHOW is [%p]", view_info.win);
+
        elm_win_iconified_set(view_info.win, EINA_FALSE);
+
        if (type == SOUND_TYPE_CALL) {
                _D("Sound type is Call");
        } else {
@@ -470,14 +472,15 @@ Evas_Object *add_volume_window(const char *name)
 
 static Eina_Bool _key_grab_cb(void *data)
 {
-       int ret = 0;
+       int ret_up = 0;
+       int ret_down = 0;
        Evas_Object *win = data;
 
        _D("keygrab window is [%p]", win);
-       ret = elm_win_keygrab_set(win, KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED);
-       _D("Result of volume up keygrab set : %d", ret);
-       ret = elm_win_keygrab_set(win, KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED);
-       _D("Result of volume down keygrab set : %d", ret);
+       ret_up = elm_win_keygrab_set(win, KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED);
+       _D("Result of volume up keygrab set : %d", ret_up);
+       ret_down = elm_win_keygrab_set(win, KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED);
+       _D("Result of volume down keygrab set : %d", ret_down);
 
        return EINA_FALSE;
 }
@@ -491,13 +494,14 @@ Evas_Object *volume_view_window_create(void)
        view_info.win = win;
        _D("view_info.win is [%p]", view_info.win);
 
-       elm_win_iconified_set(win, EINA_TRUE);
+       evas_object_show(win);
 
        ecore_timer_add(1.0f, _key_grab_cb, win);
-       evas_object_show(win);
 
        _connect_to_wm(win);
 
+       elm_win_iconified_set(win, EINA_TRUE);
+
        return win;
 }