...
- * int is_defapp_browser_app(bundle *b, char *key)
- * {
+ * int appsvc_data_is_array(bundle *b, char *key)
+ * {
* return appsvc_data_is_array(b, key);
* }
*
int appsvc_subapp_terminate_request_pid(int pid);
+/**
+ * @par Description:
+ * This function sets an uri to launch application based on appsvc.
+ *
+ * @param[in] b bundle object
+ * @param[in] char *mode
+ *
+ * @return 0 if success, negative value(<0) if fail
+ * @retval APPSVC_RET_OK - success
+ * @retval APPSVC_RET_ERROR - general error
+ * @retval APPSVC_RET_EINVAL - invalid argument(content)
+ *
+ * @pre None.
+ * @post None.
+ * @see None.
+ * @remarks None.
+ *
+ * @par Sample code:
+ * @code
+#include <appsvc.h>
+
+...
+{
+ appsvc_set_launch_mode(app_control->data, mode);
+}
+ * @endcode
+ *
+ */
+int appsvc_set_launch_mode(bundle *b, const char *mode);
+
+/**
+ * @par Description:
+ * This function sets an uri to launch application based on appsvc.
+ *
+ * @param[in] b bundle object
+ *
+ * @return Pointer for launch mode string if success, NULL if fail
+ *
+ * @pre None.
+ * @post None.
+ * @see None.
+ * @remarks None.
+ *
+ * @par Sample code:
+ * @code
+#include <appsvc.h>
+
+...
+{
+ appsvc_get_launch_mode(app_control->data);
+}
+ * @endcode
+ *
+ */
+const char *appsvc_get_launch_mode(bundle *b);
#ifdef __cplusplus
}
#endif
/** APP SVC internal private key */
#define APP_SVC_K_WIN_ID "__APP_SVC_K_WIN_ID__"
+/** APP SVC internal private key */
+#define APP_SVC_K_LAUNCH_MODE "__APP_SVC_LAUNCH_MODE__"
#endif /* __PRIV_KEY_H__ */
return __set_bundle(b, APP_SVC_K_CATEGORY, category);
}
+SLPAPI int appsvc_set_launch_mode(bundle *b, const char *mode)
+{
+ if (b == NULL) {
+ _E("bundle for appsvc_set_launch_mode is NULL");
+ return APPSVC_RET_EINVAL;
+ }
+
+ return __set_bundle(b, APP_SVC_K_LAUNCH_MODE, mode);
+}
static int __get_list_with_condition_mime_extened(char *op, char *uri, char *mime,
char *m_type, char *s_type, GSList **pkg_list, uid_t uid)
{
return bundle_get_val(b, APP_SVC_K_CATEGORY);
}
+SLPAPI const char *appsvc_get_launch_mode(bundle *b)
+{
+ return bundle_get_val(b, APP_SVC_K_LAUNCH_MODE);
+}
+
SLPAPI int appsvc_create_result_bundle(bundle *inb, bundle **outb)
{
int ret = -1;
SLPAPI int appsvc_subapp_terminate_request_pid(int pid)
{
- return aul_subapp_terminate_request_pid(pid);
-}
+ int cpid = getpid();
+ int lcnt;
+ int *lpids = NULL;
+ int i;
+
+ aul_app_group_get_leader_pids(&lcnt, &lpids);
+ for (i = 0; i < lcnt; i++) {
+ if (lpids[i] == cpid) {
+ int cnt;
+ int *pids = NULL;
+
+ aul_app_group_get_group_pids(cpid, &cnt, &pids);
+
+ if (cnt == 0) {
+ free(lpids);
+ return aul_subapp_terminate_request_pid(pid);
+ }
+
+ if (pids != NULL)
+ free(pids);
+ break;
+ }
+ }
+ if (lpids != NULL)
+ free(lpids);
+
+ return aul_app_group_clear_top();
+}