#define Config_h_
#if !defined(PACKAGE_NAME)
-#define PACKAGE_NAME "org.tizen.task-mgr"
+#define PACKAGE_NAME "org.tizen.w-task-mgr"
#endif
#if !defined(PROJECT_NAME)
-#define PROJECT_NAME "task-mgr"
+#define PROJECT_NAME "w-task-mgr"
#endif
#ifdef LOGGER_TAG
* @brief Resumes the given application.
*
* @param[in] appid The ID of the application
+ * @param[in] instanceId The instance ID of the application
* @param[in] uri The URI of the data
*
* @return true or false on failure
*/
- bool launchApp(const std::string &appid, const std::string &uri = std::string());
+ bool launchApp(const std::string &appid, const std::string &instanceId = std::string(), const std::string &uri = std::string());
/**
* @brief Get or create list of launched applications
*
void MainController::onClicked(TaskListViewItem &item)
{
LOG("");
- App::getInst().getTaskMngr().launchApp(item.getAppInfo().appid, item.getAppInfo().uri);
+ App::getInst().getTaskMngr().launchApp(item.getAppInfo().appid, item.getAppInfo().instanceId, item.getAppInfo().uri);
}
void MainController::onItemBeforeDelete(TaskListViewItem &item)
return !ret;
}
-bool TaskMngrService::launchApp(const std::string &appid, const std::string &uri)
+bool TaskMngrService::launchApp(const std::string &appid, const std::string &instanceId, const std::string &uri)
{
TRACE;
int ret = 0;
app_control_h service = nullptr;
+ app_context_h context = nullptr;
+
+ if (!instanceId.empty())
+ app_manager_get_app_context_by_instance_id(appid.c_str(), instanceId.c_str(), &context);
+ else
+ app_manager_get_app_context(appid.c_str(), &context);
+
+ if (context) {
+ LOG("Application ID is running ", appid);
+ ret = app_manager_resume_app(context);
+ app_context_destroy(context);
+ if (ret == APP_MANAGER_ERROR_NONE)
+ return true;
+ else
+ LOG("Failed to resume application ", appid);
+ }
app_control_create(&service);
if (!service)
item.pkgid = variable;
free(variable);
variable = nullptr;
-
- if (item.pkgid == "org.tizen.task-mgr" || item.pkgid == "org.tizen.taskmanager") {
- LOG_WARN("ignoring app: ", item.pkgid);
- return false;
- }
}
app_info_get_app_id(appInfo, &variable);