const char *sRingtoneKeySilent = "silent";
const char *sRingtoneValueSilentShow = "silent show";
const char *sRingtoneKeyDefault = "default";
+ const char *sRingtoneIsDefaultFlag = "is_default";
const char *sRingtoneValueDefaultShow = "default show";
const char *sRingtoneAppId = "org.tizen.setting-ringtone";
const char* sRingtoneKeyDrmType = "drm_type";
const char* sRingtoneValueDrmAll = "DRM_ALL";
const char* sRingtoneKeyDomain = "domain";
const char* sRingtoneKeyTitle = "title";
+ const char* sTrue = "true";
}
SettingsSound::SettingsSound(MsgSettings &settingsHandle)
int count = 0;
app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &ringtones, &count);
- if (!ringtones || !ringtones[0])
+ char *isDefault = nullptr;
+ app_control_get_extra_data(reply, sRingtoneIsDefaultFlag, &isDefault);
+
+ if (!ringtones || !ringtones[0] || !isDefault)
return;
char *ringtone = ringtones[0];
-
if (strcmp(ringtone, sRingtoneKeySilent) == 0)
m_SettingsHandle.setRingtoneType(MsgSettings::SilentRingtone);
- else if (strcmp(ringtone, sRingtoneKeyDefault) == 0)
+ else if (strcmp(isDefault, sTrue) == 0)
m_SettingsHandle.setRingtoneType(MsgSettings::DefaultRingtone);
else
{
}
for (int i = 0; i < count; ++i) {
- free (ringtones[i]);
+ free(ringtones[i]);
}
free(ringtones);
+ free(isDefault);
}
bool SettingsSound::launch()