From: Yunmi Ha Date: Wed, 18 Mar 2020 02:03:38 +0000 (+0900) Subject: Support standard pattern for default X-Git-Tag: accepted/tizen/unified/20200406.133214~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F227983%2F1;p=platform%2Fcore%2Fsystem%2Ffeedbackd.git Support standard pattern for default Change-Id: I13f56ab2f0e60c3a0f17a48b1cb1a9fe4c65bc20 Signed-off-by: Yunmi Ha --- diff --git a/src/haptic/haptic.c b/src/haptic/haptic.c index bf7410c..ba00047 100644 --- a/src/haptic/haptic.c +++ b/src/haptic/haptic.c @@ -528,14 +528,21 @@ static void get_default_haptic_data() { dd_list *elem; struct vibration_config *conf; + char pattern[PATH_MAX] = {0,}; memset(&haptic_default_data, 0, sizeof(struct duration_data)); + snprintf(pattern, sizeof(pattern), "%s", PATTERN_DEFAULT_MONOTONE); DD_LIST_FOREACH(vib_conf_list, elem, conf) { if (!conf->pattern) continue; - if (strcmp(conf->pattern, PATTERN_DEFAULT_MONOTONE)) + if (strcmp(conf->pattern, pattern)) + continue; + + if (conf->standard) { + snprintf(pattern, sizeof(pattern), "%s", conf->standard); continue; + } if (conf->data) memcpy(&haptic_default_data, conf->data->data, sizeof(struct duration_data)); @@ -869,6 +876,7 @@ GVariant *hdbus_vibrate_monotone(GDBusConnection *conn, goto exit; g_variant_get(param, "(uiii)", &handle, &duration, &intensity, &priority); + _D("param (uiii): handle=%u, duration=%d, intensity=%d, priority=%d", handle, duration, intensity, priority); if (intensity < 0) { ret = -EINVAL;