diff options
author | taeyoung <ty317.kim@samsung.com> | 2016-07-26 14:03:57 +0900 |
---|---|---|
committer | taeyoung <ty317.kim@samsung.com> | 2016-07-26 14:04:42 +0900 |
commit | 8c01221ebf95b4cea38dbf4f0af3f8120205fe03 (patch) | |
tree | b945bf47a6319a5cac1477716c2e2798b9d88491 | |
parent | d4a2f1466eddd275315183e40084d06cbc79f763 (diff) | |
download | data-router-accepted/tizen_wearable.tar.gz data-router-accepted/tizen_wearable.tar.bz2 data-router-accepted/tizen_wearable.zip |
usb: exchange vconf key for the usb modetizen_4.0.m1_releasetizen_4.0.IoT.p1_releasesubmit/tizen_unified/20170308.100406submit/tizen_4.0/20170828.100003submit/tizen_4.0/20170811.094300submit/tizen_3.0_wearable/20161015.000001submit/tizen_3.0_tv/20161015.000001submit/tizen_3.0_mobile/20161015.000001submit/tizen_3.0_ivi/20161010.000001submit/tizen_3.0_common/20161104.104000submit/tizen_3.0.m2/20170104.093750submit/tizen/20160808.001357submit/tizen/20160805.110834accepted/tizen/wearable/20160809.011349accepted/tizen/unified/20170309.032749accepted/tizen/tv/20160809.011331accepted/tizen/mobile/20160809.011316accepted/tizen/ivi/20160809.011405accepted/tizen/common/20160805.130406accepted/tizen/4.0/unified/20170828.223621accepted/tizen/4.0/unified/20170816.012041accepted/tizen/3.0/wearable/20161015.082031accepted/tizen/3.0/tv/20161016.004214accepted/tizen/3.0/mobile/20161015.032854accepted/tizen/3.0/ivi/20161011.043910accepted/tizen/3.0/common/20161114.105655accepted/tizen/3.0.m2/wearable/20170104.125901accepted/tizen/3.0.m2/tv/20170104.125528accepted/tizen/3.0.m2/mobile/20170104.125435tizen_3.0_tvtizen_3.0.m2tizen_3.0accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_commonaccepted/tizen_3.0_wearableaccepted/tizen_3.0_tvaccepted/tizen_3.0_mobileaccepted/tizen_3.0_iviaccepted/tizen_3.0_commonaccepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobile
- The vconf key VCONFKEY_SETAPPL_USB_MODE_INT is
one of the legacy vconf keys. Thus is is exchanged
to new one.
Change-Id: I1a02687361572be941882e2ec16f9c7201fd526f
Signed-off-by: taeyoung <ty317.kim@samsung.com>
-rwxr-xr-x | src/dr-noti-handler.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/dr-noti-handler.c b/src/dr-noti-handler.c index 159d621..0c8ce84 100755 --- a/src/dr-noti-handler.c +++ b/src/dr-noti-handler.c @@ -36,6 +36,18 @@ extern dr_info_t dr_info; volatile gboolean dsr_status = FALSE; +static gboolean acm_enabled(int mode) +{ + switch(mode) { + case SET_USB_DEFAULT: + case SET_USB_SDB: + case SET_USB_SDB_DIAG: + return TRUE; + default: + return FALSE; + } +} + static void __usb_status_noti_handler(void *data) { int usb_state = -1; @@ -47,7 +59,7 @@ static void __usb_status_noti_handler(void *data) return; } - ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usb_mode); + ret = vconf_get_int(VCONFKEY_USB_CUR_MODE, &usb_mode); if (ret != 0) { DBG("Vconf get failed\n"); return; @@ -63,7 +75,7 @@ static void __usb_status_noti_handler(void *data) * After usb driver loaded, MTP will be set vconf value as VCONFKEY_SYSMAN_USB_CONNECTED */ if (usb_state != VCONFKEY_SYSMAN_USB_DISCONNECTED && - usb_mode == SETTING_USB_DEFAULT_MODE) { + acm_enabled(usb_mode)) { _init_usb(); } else if (usb_state == VCONFKEY_SYSMAN_USB_DISCONNECTED) { _deinit_usb(); @@ -77,7 +89,7 @@ static void __usb_mode_noti_handler(void *data) int usb_mode = -1; int ret; - ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usb_mode); + ret = vconf_get_int(VCONFKEY_USB_CUR_MODE, &usb_mode); if (ret != 0) { DBG("Vconf get failed\n"); return; @@ -86,7 +98,7 @@ static void __usb_mode_noti_handler(void *data) DBG("USB Mode noti handler, USB Mode : %d\n", usb_mode); DBG("usb_fd = 0x%x\n", dr_info.usb.usb_fd); - if (usb_mode != SETTING_USB_DEFAULT_MODE) { + if (!acm_enabled(usb_mode)) { _deinit_usb(); _deinit_dr(); } @@ -106,10 +118,10 @@ gboolean _register_vconf_notification(void) } ret = - vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT, + vconf_notify_key_changed(VCONFKEY_USB_CUR_MODE, (vconf_callback_fn) __usb_mode_noti_handler, NULL); if (ret < 0) { - ERR("Error !!! VCONFKEY reg noti : %s\n", VCONFKEY_SETAPPL_USB_MODE_INT); + ERR("Error !!! VCONFKEY reg noti : %s\n", VCONFKEY_USB_CUR_MODE); } return TRUE; @@ -118,7 +130,7 @@ gboolean _register_vconf_notification(void) void _unregister_vconf_notification(void) { vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS, (vconf_callback_fn) __usb_status_noti_handler); - vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT, (vconf_callback_fn) __usb_mode_noti_handler); + vconf_ignore_key_changed(VCONFKEY_USB_CUR_MODE, (vconf_callback_fn) __usb_mode_noti_handler); return; } |