gboolean _mobileap_is_disabled(void);
-gboolean _mobileap_is_enabled(mobile_ap_type_e type);
+gboolean _mobileap_is_enabled(int state);
+gboolean _mobileap_is_enabled_by_type(mobile_ap_type_e type);
gboolean _mobileap_set_state(int state);
#endif
return mobileap_state ? FALSE : TRUE;
}
-gboolean _mobileap_is_enabled(mobile_ap_type_e type)
+gboolean _mobileap_is_enabled(int state)
{
- return (mobileap_state & type) ? TRUE : FALSE;
+ return (mobileap_state & state) ? TRUE : FALSE;
+}
+
+gboolean _mobileap_is_enabled_by_type(mobile_ap_type_e type)
+{
+ switch (type) {
+ case MOBILE_AP_TYPE_WIFI:
+ if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI))
+ return TRUE;
+ break;
+
+ case MOBILE_AP_TYPE_BT:
+ if (_mobileap_is_enabled(MOBILE_AP_STATE_BT))
+ return TRUE;
+ break;
+
+ case MOBILE_AP_TYPE_USB:
+ if (_mobileap_is_enabled(MOBILE_AP_STATE_USB))
+ return TRUE;
+ break;
+
+ default:
+ ERR("Unknow type : %d\n", type);
+ break;
+ }
+
+ return FALSE;
}
gboolean _mobileap_clear_state(int state)
if (_get_tethering_type_from_ip(ip_addr, &type) != MOBILE_AP_ERROR_NONE)
return DBUS_HANDLER_RESULT_HANDLED;
- if (_mobileap_is_enabled(type) != FALSE) {
+ if (_mobileap_is_enabled_by_type(type) == FALSE) {
DBG("Tethering[%d] is disabled. Ignore ACK\n", type);
return DBUS_HANDLER_RESULT_HANDLED;
}
notification_h noti = NULL;
notification_error_e ret = NOTIFICATION_ERROR_NONE;
- noti = notification_new(NOTIFICATION_TYPE_NOTI,
+ noti = notification_new(NOTIFICATION_TYPE_ONGOING,
NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
if (!noti) {
ERR("Fail to notification_new [%d]\n", ret);
DBG("+\n");
notification_error_e ret;
- ret = notification_delete_all_by_type(APPNAME, NOTIFICATION_TYPE_NOTI);
+ ret = notification_delete_all_by_type(APPNAME, NOTIFICATION_TYPE_ONGOING);
if (ret != NOTIFICATION_ERROR_NONE) {
ERR("Fail to notification_delete_all_by_type [%d]\n", ret);
return MOBILE_AP_ERROR_INTERNAL;