int aul_app_is_running_with_instance_id(const char *appid,
const char *instance_id, bool *running);
+/**
+ * @brief Sends a preparation request for an app-defined loader.
+ * @since_tizen 5.5
+ *
+ * @param[in] loader_name The loader name
+ * @return @c the loader ID on success,
+ * otherwise a negative error value
+ *
+ * @remarks This function is only for App Framework internally.
+ */
+int aul_prepare_app_defined_loader(const char *loader_name);
+int aul_prepare_app_defined_loader_for_uid(const char *loader_name, uid_t uid);
+
#ifdef __cplusplus
}
#endif
LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED = 137,
LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED = 138,
APP_SEND_RESUME_REQUEST = 139,
+ APP_PREPARE_APP_DEFINED_LOADER = 140,
APP_CMD_MAX
};
return "LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED";
case APP_SEND_RESUME_REQUEST:
return "APP_SEND_RESUME_REQUEST";
+ case APP_PREPARE_APP_DEFINED_LOADER:
+ return "APP_PREPARE_APP_DEFINED_LOADER";
default:
return "CUSTOM_COMMAND";
}
return __send_request(APP_TERMINATE, uid, appid, NULL);
}
+
+API int aul_prepare_app_defined_loader(const char *loader_name)
+{
+ return aul_prepare_app_defined_loader_for_uid(loader_name, getuid());
+}
+
+API int aul_prepare_app_defined_loader_for_uid(const char *loader_name,
+ uid_t uid)
+{
+ char buf[MAX_PID_STR_BUFSZ];
+ bundle *b;
+ int ret;
+
+ if (!loader_name) {
+ _E("Invalid parameter");
+ return AUL_R_EINVAL;
+ }
+
+ b = bundle_create();
+ if (!b) {
+ _E("Out of memory");
+ return AUL_R_ENOMEM;
+ }
+
+ bundle_add(b, AUL_K_LOADER_NAME, loader_name);
+ snprintf(buf, sizeof(buf), "%u", uid);
+ bundle_add(b, AUL_K_TARGET_UID, buf);
+
+ ret = app_send_cmd_for_uid(AUL_UTIL_PID, uid,
+ APP_PREPARE_APP_DEFINED_LOADER, b);
+ bundle_free(b);
+ if (ret < 0) {
+ _E("Failed to prepare app-defined loader. error(%d)", ret);
+ return ret;
+ }
+
+ _I("loader id(%d)", ret);
+ return ret;
+}