summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2017-01-06 09:53:45 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2017-01-13 13:19:47 +0900
commitd3d95bed2be286846c93c987528a944ef7062fba (patch)
tree53f323112b1247dfde04346eb7c58a33ca2981c1
parentcff2f1ac46f4125c3252ed612aaca122c8031264 (diff)
downloadapplication-d3d95bed2be286846c93c987528a944ef7062fba.tar.gz
application-d3d95bed2be286846c93c987528a944ef7062fba.tar.bz2
application-d3d95bed2be286846c93c987528a944ef7062fba.zip
Support multiple instance launch
- Add new internal APIs app_control_set_instance_id() app_control_get_instance_id() - When the application is launched by using multiple instance launch, It has the specified instance ID. - Requires: [aul] https://review.tizen.org/gerrit/#/c/108620/ [amd] https://review.tizen.org/gerrit/#/c/109746/ [rua] https://review.tizen.org/gerrit/#/c/109906/ [app-manager] https://review.tizen.org/gerrit/#/c/110114/ Change-Id: I057e5bd09890a489245b93fe143d49d189462119 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xapp_control/app_control.c31
-rw-r--r--include/app_control_internal.h28
2 files changed, 58 insertions, 1 deletions
diff --git a/app_control/app_control.c b/app_control/app_control.c
index 9efcba0..5a3f983 100755
--- a/app_control/app_control.c
+++ b/app_control/app_control.c
@@ -1218,3 +1218,34 @@ int app_control_enable_app_started_result_event(app_control_h app_control)
return APP_CONTROL_ERROR_NONE;
}
+int app_control_set_instance_id(app_control_h app_control, const char *instance_id)
+{
+ int ret;
+
+ if (app_control_validate(app_control) || instance_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+ ret = aul_svc_set_instance_id(app_control->data, instance_id);
+ if (ret < 0)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "Out of memory");
+
+ return APP_CONTROL_ERROR_NONE;
+}
+
+int app_control_get_instance_id(app_control_h app_control, char **instance_id)
+{
+ const char *id;
+
+ if (app_control_validate(app_control) || instance_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+ id = aul_svc_get_instance_id(app_control->data);
+ if (id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "Failed to get the instance id");
+
+ *instance_id = strdup(id);
+ if (*instance_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "Failed to duplicate the instance id");
+
+ return APP_CONTROL_ERROR_NONE;
+}
diff --git a/include/app_control_internal.h b/include/app_control_internal.h
index 99aa537..afd8399 100644
--- a/include/app_control_internal.h
+++ b/include/app_control_internal.h
@@ -204,6 +204,33 @@ int app_control_set_defapp(app_control_h app_control, const char *app_id);
*
*/
int app_control_unset_defapp(const char *app_id);
+
+/**
+ * @brief Sets the instance ID of the application
+ *
+ * @since_tizen tizen_3.0
+ * @param[in] app_control The app_control handle
+ * @param[in] instance_id The instance ID of the application
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_OUT_OF_MEMORY Out of memory
+ */
+int app_control_set_instance_id(app_control_h app_control, const char *instance_id);
+
+/**
+ * @brief Gets the instance ID of the application
+ *
+ * @since_tizen tizen_3.0
+ * @param[in] app_control The app_control handle
+ * @param[out] instance_id The instance ID of the application
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_OUT_OF_MEMORY Out of memory
+ */
+int app_control_get_instance_id(app_control_h app_control, char **instance_id);
+
/**
* @}
*/
@@ -213,4 +240,3 @@ int app_control_unset_defapp(const char *app_id);
#endif
#endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */
-