This function is added to feedback.
- int feedback_put_theme_ids_internal(unsigned int **theme_ids);
- This function free the array of theme ids from feedback_get_theme_ids_internal().
After use the array of theme id, it should be freed by caller.
Also, it is possible for the user to release the array directly.
Change-Id: I7d2f2a4456d9e6662c59e3360a1eb0a5490ed6b1
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
* @brief Gets the array of theme id supported.
* @details This function gets all theme id as defined in the conf file.
* The theme id is positive value according to conf file.
+ * After using theme ids, it should be freed by caller.
* @since_tizen 7.0
* @param[in] type The feedback type
* @param[out] count_of_theme This means size of theme id array
* @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
* @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
+ * @see feedback_put_theme_ids_internal()
*/
int feedback_get_theme_ids_internal(feedback_type_e feedback_type, unsigned int *count_of_theme, unsigned int **theme_ids);
/**
+ * @brief Free the array of theme id.
+ * @details This function free the array of theme ids from feedback_get_theme_ids_internal()
+ * Also, it is possible for the user to release the array directly.
+ * @since_tizen 7.0
+ * @param[in] theme_ids The Address of theme id array
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #FEEDBACK_ERROR_NONE Successful
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see feedback_get_theme_ids_internal()
+ */
+int feedback_put_theme_ids_internal(unsigned int **theme_ids);
+
+/**
* @brief Plays specific type of reactions that are pre-defined with priority.
* @details This function can be used to react to pre-defined actions. \n
* It play specific type of system pre-defined pattern with priority.
return FEEDBACK_ERROR_NONE;
}
+API int feedback_put_theme_ids_internal(unsigned int **theme_ids)
+{
+ if (!theme_ids || !*theme_ids)
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
+
+ free(*theme_ids);
+ *theme_ids = NULL;
+
+ return FEEDBACK_ERROR_NONE;
+}
+
API int feedback_play_type_with_flags_internal(feedback_type_e type, feedback_pattern_internal_e internal_pattern, feedback_flag_e flag)
{
const struct device_ops *dev;
LOG_RESULT(TEST_FEEDBACK_GET_SOUND_THEME_ID_INTERNAL(), "TEST_FEEDBACK_GET_SOUND_THEME_ID_INTERNAL");
LOG_RESULT(TEST_FEEDBACK_SET_SOUND_THEME_ID_INTERNAL(), "TEST_FEEDBACK_SET_SOUND_THEME_ID_INTERNAL");
LOG_RESULT(TEST_FEEDBACK_GET_SOUND_THEME_IDS_INTERNAL(), "TEST_FEEDBACK_GET_SOUND_THEME_IDS_INTERNAL");
+ LOG_RESULT(TEST_FEEDBACK_PUT_SOUND_THEME_IDS_INTERNAL(), "TEST_FEEDBACK_PUT_SOUND_THEME_IDS_INTERNAL");
LOG_RESULT(TEST_FEEDBACK_PLAY_TYPE_WITH_FLAGS_INTERNAL(), "TEST_FEEDBACK_PLAY_TYPE_WITH_FLAGS_INTERNAL");
}
REPORT_AND_RETURN();
}
+static void test_put_sound_theme_ids_internal(void)
+{
+ unsigned int count_of_theme = 0;
+ unsigned int *sound_theme_ids = NULL;
+
+ feedback_initialize();
+ RESULT(feedback_put_theme_ids_internal(&sound_theme_ids),
+ FEEDBACK_ERROR_INVALID_PARAMETER, "invalid parameter");
+ RESULT(feedback_put_theme_ids_internal(NULL),
+ FEEDBACK_ERROR_INVALID_PARAMETER, "invalid parameter");
+
+ feedback_get_theme_ids_internal(FEEDBACK_TYPE_SOUND, &count_of_theme, &sound_theme_ids);
+ RESULT(feedback_put_theme_ids_internal(&sound_theme_ids),
+ FEEDBACK_ERROR_NONE, "error none");
+ feedback_deinitialize();
+}
+
+bool TEST_FEEDBACK_PUT_SOUND_THEME_IDS_INTERNAL(void)
+{
+ INIT();
+ test_put_sound_theme_ids_internal();
+ REPORT_AND_RETURN();
+}
+
static void test_feedback_play_type_with_flags_internal(void)
{
feedback_initialize();
bool TEST_FEEDBACK_GET_SOUND_THEME_ID_INTERNAL(void);
bool TEST_FEEDBACK_SET_SOUND_THEME_ID_INTERNAL(void);
bool TEST_FEEDBACK_GET_SOUND_THEME_IDS_INTERNAL(void);
+bool TEST_FEEDBACK_PUT_SOUND_THEME_IDS_INTERNAL(void);
bool TEST_FEEDBACK_PLAY_TYPE_WITH_FLAGS_INTERNAL(void);
void TEST_INTERNAL_INIT(void);