capi-appfw-application
capi-network-connection
capi-system-system-settings
+ capi-telephony
dlog
efl-extension
elementary
void setting_network_mptcp_enable(void *data, bool enable);
setting_network_mptcp_state_t setting_network_is_mptcp_enabled(void *data);
+bool is_call_status_idle(void);
+
#endif /* __SETTING_NETWORK_H__ */
*
*/
-#include <call-manager.h>
-#include <setting-network.h>
+#include "setting-network.h"
#include "setting-network-mode.h"
static int _view_create(void *cb);
SETTING_TRACE_BEGIN;
int value = 0;
int err = 0;
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
- if (CM_CALL_STATUS_IDLE != call_status) {
+ bool is_idle = is_call_status_idle();
+ if (!is_idle) {
setting_create_popup(s_info.ad, s_info.ad->md.window, NULL, _("IDS_CST_POP_OPERATION_NOT_ALLOWED_DURING_CALLS"), NULL, 0, false, false, 0);
return;
}
*
*/
-#include <call-manager.h>
#include "setting-network-service-providers.h"
const char *STR_SETTING_OPERATION_FAILED = "IDS_BT_POP_OPERATION_FAILED";
int select_network_show(SettingNetwork *ad)
{
SETTING_TRACE_BEGIN;
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
- if (CM_CALL_STATUS_IDLE != call_status) {
+ bool is_idle = is_call_status_idle();
+ if (!is_idle) {
setting_create_popup(s_info.ad, s_info.ad->md.window, NULL, _("IDS_CST_POP_OPERATION_NOT_ALLOWED_DURING_CALLS"), NULL, 0, false, false, 0);
return SETTING_GENERAL_ERR_NULL_DATA_PARAMETER;
}
* limitations under the License.
*
*/
+
+#include <telephony/telephony.h>
#include <setting-network.h>
#include <setting-debug.h>
#include <setting-cfg.h>
return state ? SETTING_NETWORK_MPTCP_ENABLED : SETTING_NETWORK_MPTCP_DISABLED;
}
+
+bool is_call_status_idle(void)
+{
+ unsigned int i = 0;
+ unsigned int j = 0;
+ unsigned int call_list_count = 0;
+ telephony_handle_list_s handle_list;
+ telephony_call_h *call_list;
+ telephony_call_status_e status = TELEPHONY_CALL_STATUS_IDLE;
+ bool to_return = true;
+
+
+ int err = telephony_init(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_init() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ for (i = 0; i < handle_list.count; ++i) {
+ err = telephony_call_get_call_list(handle_list.handle[i], &call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_call_list() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ for (j = 0; j < call_list_count; ++j) {
+ err = telephony_call_get_status(call_list[j], &status);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_status() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ if (status != TELEPHONY_CALL_STATUS_IDLE) {
+ to_return = false;
+ break;
+ }
+ }
+
+ err = telephony_call_release_call_list(call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_release_call_list() failed. Error: %s", get_error_message(err));
+ }
+
+ if (to_return == false) {
+ break;
+ }
+ }
+
+ err = telephony_deinit(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_deinit() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ return to_return;
+}
capi-media-player
capi-media-sound-manager
capi-system-system-settings
+ capi-telephony
dlog
efl-extension
elementary
*
*/
-#include "setting-profile.h"
+#include <telephony/telephony.h>
#include <sys/stat.h>
#include <dirent.h>
#include <app_manager.h>
#include <metadata_extractor.h>
#include <player.h>
+#include "setting-profile.h"
#define SETTING_DEFAULT_FOLDER_PATH _TZ_SYS_GLOBALUSER_DATA"/settings/"
#define SDCARD_PATH _TZ_SYS_MEDIA"/sdcard/"
static int __listen_vconf_change(void *data);
static int __unlisten_vconf_change(void *data);
static void __calling_popup_cb(void *data, Evas_Object *obj, void *event_info);
+bool is_call_status_idle(void);
void setting_sound_update_do_not_disturb_item(void *data)
{
ret_if(data == NULL);
SettingSoundData *ad = (SettingSoundData *)data;
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
- if (CM_CALL_STATUS_IDLE != call_status) {
- SETTING_TRACE("Call status is not OFF (%d)", call_status);
+ bool is_idle = is_call_status_idle();
+
+ if (!is_idle) {
+ SETTING_TRACE("Call status is not OFF (%d)", is_idle);
if (!ad->calling_popup) {
ad->calling_popup = setting_create_popup(
ad,
}
}
+bool is_call_status_idle(void)
+{
+ SETTING_TRACE_BEGIN;
+
+ unsigned int i = 0;
+ unsigned int j = 0;
+ unsigned int call_list_count = 0;
+ telephony_handle_list_s handle_list;
+ telephony_call_h *call_list;
+ telephony_call_status_e status = TELEPHONY_CALL_STATUS_IDLE;
+ bool to_return = true;
+
+
+ int err = telephony_init(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_init() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ for (i = 0; i < handle_list.count; ++i) {
+ err = telephony_call_get_call_list(handle_list.handle[i], &call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_call_list() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ for (j = 0; j < call_list_count; ++j) {
+ err = telephony_call_get_status(call_list[j], &status);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_status() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ if (status != TELEPHONY_CALL_STATUS_IDLE) {
+ to_return = false;
+ break;
+ }
+ }
+
+ err = telephony_call_release_call_list(call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_release_call_list() failed. Error: %s", get_error_message(err));
+ }
+
+ if (to_return == false) {
+ break;
+ }
+ }
+
+ err = telephony_deinit(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_deinit() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ SETTING_TRACE_DEBUG("is_call_status: %d", to_return);
+ return to_return;
+}
efl-extension
callmgr_client
capi-media-player
+ capi-telephony
)
FOREACH(flag ${pkgs_ringtone_CFLAGS})
#include "setting-ringtone-main.h"
#include "setting-ringtone-util.h"
#include "setting-ringtone-remove.h"
+#include <telephony/telephony.h>
#include "setting-common-general-func.h"
#include "setting-common-draw-widget.h"
#include <efl_extension_events.h>
void *user_data);
static void _create_main_ui_list(SettingRingtoneData *ad);
+bool is_call_status_idle(void);
+
static int setting_ringtone_create(void *cb)
{
static void _item_selected_cb(void *data, Evas_Object *obj, void *event_info)
{
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
+ bool is_idle;
Setting_GenGroupItem_Data *list_item = NULL;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
SettingRingtoneData *ad = (SettingRingtoneData *)data;
ad->selected_file_path = strdup(list_item->filepath);
ad->selected_item_data = list_item;
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
+ is_idle = is_call_status_idle();
- if ((CM_CALL_STATUS_IDLE == call_status) && ad->selected_file_path) {
+ if (is_idle && ad->selected_file_path) {
SETTING_TRACE("sel file: %s", ad->selected_file_path);
if (ad->media_player)
ringtone_stop_sound(ad);
static void _radio_changed_cb(void *data, Evas_Object *radio, void *event_info)
{
SETTING_TRACE_BEGIN;
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
+ bool is_idle;
/* the list item data this radio is in: */
Setting_GenGroupItem_Data *list_item = data;
SettingRingtoneData *ad = NULL;
if (ad->media_player)
ringtone_stop_sound(ad);
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
+ is_idle = is_call_status_idle();
- if ((CM_CALL_STATUS_IDLE == call_status) && safeStrCmp(
+ if (is_idle && safeStrCmp(
list_item->keyStr, "IDS_ST_BODY_PHONEPROFILES_SILENT")
)
ringtone_play_sound(ad);
free(default_file_path);
}
+
+bool is_call_status_idle(void)
+{
+ unsigned int i = 0;
+ unsigned int j = 0;
+ unsigned int call_list_count = 0;
+ telephony_handle_list_s handle_list;
+ telephony_call_h *call_list;
+ telephony_call_status_e status = TELEPHONY_CALL_STATUS_IDLE;
+ bool to_return = true;
+
+
+ int err = telephony_init(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_init() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ for (i = 0; i < handle_list.count; ++i) {
+ err = telephony_call_get_call_list(handle_list.handle[i], &call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_call_list() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ for (j = 0; j < call_list_count; ++j) {
+ err = telephony_call_get_status(call_list[j], &status);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_get_status() failed. Error: %s", get_error_message(err));
+ continue;
+ }
+
+ if (status != TELEPHONY_CALL_STATUS_IDLE) {
+ to_return = false;
+ break;
+ }
+ }
+
+ err = telephony_call_release_call_list(call_list_count, &call_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_call_release_call_list() failed. Error: %s", get_error_message(err));
+ }
+
+ if (to_return == false) {
+ break;
+ }
+ }
+
+ err = telephony_deinit(&handle_list);
+ if (err != TELEPHONY_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Function telephony_deinit() failed. Error: %s", get_error_message(err));
+ return false;
+ }
+
+ return to_return;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.setting-ringtone2" version="1.0.0">
+ <profile name="mobile"/>
+ <ui-application appid="org.tizen.setting-ringtone2" exec="setting-ringtone" hw-acceleration="on" launch_mode="caller" multiple="true" nodisplay="true" taskmanage="false" type="capp">
+ <label>Ringtone</label>
+ <label xml:lang="en-gb">Ringtone</label>
+ <label xml:lang="en-ph">Ringtone</label>
+ <label xml:lang="en-us">Ringtone</label>
+ <metadata key="http://developer.samsung.com/tizen/metadata/legacylifecycle"/>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/apphistory.read</privilege>
+ <privilege>http://tizen.org/privilege/account.read</privilege>
+ <privilege>http://tizen.org/privilege/mediahistory.read</privilege>
+ <privilege>http://tizen.org/privilege/haptic</privilege>
+ <privilege>http://tizen.org/privilege/display</privilege>
+ <privilege>http://tizen.org/privilege/datasharing</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+ <privilege>http://tizen.org/privilege/application.launch</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.install</privilege>
+ <privilege>http://tizen.org/privilege/mediastorage</privilege>
+ <privilege>http://tizen.org/privilege/telephony.admin</privilege>
+ <privilege>http://tizen.org/privilege/network.get</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.kill</privilege>
+ <privilege>http://tizen.org/privilege/package.info</privilege>
+ <privilege>http://tizen.org/privilege/system</privilege>
+ <privilege>http://tizen.org/privilege/alarm.set</privilege>
+ <privilege>http://tizen.org/privilege/http</privilege>
+ <privilege>http://tizen.org/privilege/externalstorage.appdata</privilege>
+ <privilege>http://tizen.org/privilege/network.profile</privilege>
+ <privilege>http://tizen.org/privilege/fullscreen</privilege>
+ <privilege>http://tizen.org/privilege/telephony</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+ <privilege>http://tizen.org/privilege/systemmonitor</privilege>
+ <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
+ <privilege>http://tizen.org/privilege/content.read</privilege>
+ <privilege>http://tizen.org/privilege/network.set</privilege>
+ <privilege>http://tizen.org/privilege/account.write</privilege>
+ <privilege>http://tizen.org/privilege/nfc.admin</privilege>
+ <privilege>http://tizen.org/privilege/filesystem.write</privilege>
+ <privilege>http://tizen.org/privilege/tethering.admin</privilege>
+ <privilege>http://tizen.org/privilege/ime</privilege>
+ <privilege>http://tizen.org/privilege/dpm.password</privilege>
+ <privilege>http://tizen.org/privilege/externalstorage</privilege>
+ <privilege>http://tizen.org/privilege/systemmanager</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/filesystem.read</privilege>
+ <privilege>http://tizen.org/privilege/volume.set</privilege>
+ <privilege>http://tizen.org/privilege/internet</privilege>
+ <privilege>http://tizen.org/privilege/notification</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+ </privileges>
+</manifest>
#include <app.h>
#include <dlog.h>
-#include <telephony.h>
+#include <telephony/telephony.h>
#include <stc.h>
#include <app_info.h>
#include <app_manager.h>
#include <stc.h>
#include <stc_internal.h>
#include <stdbool.h>
-#include <telephony.h>
+#include <telephony/telephony.h>
typedef enum {
DATA_RESTRICTION_LIMIT,