}
}
+static void wakeup_setting_streaming_duration_max_changed_cb(keynode_t* node, void* data)
+{
+ MWR_LOGD("[ENTER]");
+ if (nullptr == node) return;
+
+ CWakeupSettings* settings = static_cast<CWakeupSettings*>(data);
+ if (nullptr == settings) return;
+
+ if (VCONF_TYPE_DOUBLE == node->type) {
+ double value = static_cast<double>(node->value.d);
+ settings->set_streaming_duration_max(static_cast<float>(value));
+ } else {
+ LOGE("[Settings ERROR] the value type is not string : %d", node->type);
+ }
+}
+
+
static void wakeup_setting_enabled_assistants_changed_cb(keynode_t* node, void* data)
{
MWR_LOGD("[ENTER]");
vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE,
wakeup_setting_input_language_changed_cb, this);
#endif
+ vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_STREAMING_DURATION_MAX,
+ wakeup_setting_streaming_duration_max_changed_cb, this);
vconf_notify_key_changed(mCustomVconfKeys[WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID].c_str(),
wakeup_setting_default_assistant_appid_changed_cb, this);
if (true == mMultipleMode) {
vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE,
wakeup_setting_input_language_changed_cb);
#endif
+ vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_STREAMING_DURATION_MAX,
+ wakeup_setting_streaming_duration_max_changed_cb);
vconf_ignore_key_changed(mCustomVconfKeys[WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID].c_str(),
wakeup_setting_default_assistant_appid_changed_cb);
if (true == mMultipleMode) {
return mStreamingDurationMax;
}
+void CWakeupSettings::set_streaming_duration_max(float duration)
+{
+ MWR_LOGE("Setting Streaming Duration Max Value : %f", duration);
+ mStreamingDurationMax = duration;
+}
+
std::string CWakeupSettings::get_current_language(void)
{
std::string result{"en_US"};
const std::chrono::seconds minimum_interval(3);
auto interval = std::chrono::steady_clock::now() - mStartedTime;
if (interval < minimum_interval) {
- MAS_LOGE("sleeping for %lld ms",
- std::chrono::duration_cast<std::chrono::milliseconds>(minimum_interval - interval).count());
+ MAS_LOGE("sleeping for %lld ms", static_cast<long long int>(
+ std::chrono::duration_cast<std::chrono::milliseconds>(minimum_interval - interval).count()));
std::this_thread::sleep_for(minimum_interval - interval);
} else {
- MAS_LOGE("interval is %lld ms, no need to sleep",
- std::chrono::duration_cast<std::chrono::milliseconds>(interval).count());
+ MAS_LOGE("interval is %lld ms, no need to sleep", static_cast<long long int>(
+ std::chrono::duration_cast<std::chrono::milliseconds>(interval).count()));
}
mServiceIpc.send_restart_notification();