*/
int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
+/**
+ * @par Description:
+ * This API trigger to resume application asynchronously.
+ * If the application is running, this API send a resume event to the App.
+ * If the application is not running, this API return AUL_R_ERROR.
+ * Although the application is running, if the application cannot receive resume event,
+ * AUL try to raise the application's default windows.
+ * @par Purpose:
+ * This API is for caller.
+ * This API's purpose is to send resume event.
+ * @par Typical use case:
+ * In multiple application model, If you want to only resume specific application, Use this API
+ *
+ * @param[in] pid application's pid to be resumed
+ * @return 0 if success, negative value(<0) if fail
+ * @retval AUL_R_OK - success
+ * @retval AUL_R_EINVAL - invaild pid
+ * @retval AUL_R_ECOM - internal AUL IPC error
+ * @retval AUL_R_ERROR - general error (include application is not running)
+ * @warning This API need to require root or inhouse permisssion \n
+ * If you have not the permission, this API return AUL_R_ERROR. \n
+ * @remark
+ * This API is only available to User Session.
+ */
+int aul_resume_pid_async(int pid);
+
+/**
+ * @par Description:
+ * This API trigger to resume application asynchronously.
+ * If the application is running, this API send a resume event to the App.
+ * If the application is not running, this API return AUL_R_ERROR.
+ * Although the application is running, if the application cannot receive resume event,
+ * AUL try to raise the application's default windows.
+ * @par Purpose:
+ * This API is for caller.
+ * This API's purpose is to send resume event.
+ * @par Typical use case:
+ * In multiple application model, If you want to only resume specific application, Use this API
+ *
+ * @param[in] pid application's pid to be resumed
+ * @param[in] uid User ID
+ * @return 0 if success, negative value(<0) if fail
+ * @retval AUL_R_OK - success
+ * @retval AUL_R_EINVAL - invaild pid
+ * @retval AUL_R_ECOM - internal AUL IPC error
+ * @retval AUL_R_ERROR - general error (include application is not running)
+ * @warning This API need to require root or inhouse permisssion \n
+ * If you have not the permission, this API return AUL_R_ERROR. \n
+ * @remark
+ * This API is only available to System user.
+ */
+int aul_resume_pid_async_for_uid(int pid, uid_t uid);
+
#ifdef __cplusplus
}
#endif
case APP_OPEN:
case APP_RESUME:
case APP_RESUME_BY_PID:
+ case APP_RESUME_BY_PID_ASYNC:
ret = __app_resume_local();
break;
default:
return ret;
}
+API int aul_resume_pid_async(int pid)
+{
+ return aul_resume_pid_async_for_uid(pid, getuid());
+}
+
+API int aul_resume_pid_async_for_uid(int pid, uid_t uid)
+{
+ char pid_str[MAX_PID_STR_BUFSZ];
+ int ret;
+
+ if (pid <= 0)
+ return AUL_R_EINVAL;
+
+ snprintf(pid_str, sizeof(pid_str), "%d", pid);
+ ret = app_request_to_launchpad_for_uid(APP_RESUME_BY_PID_ASYNC,
+ pid_str, NULL, uid);
+ return ret;
+}
+
return aul_app_get_last_caller_pid_for_uid(apn_pid, atoi(gargv[3]));
}
+static int resume_pid_async_test(void)
+{
+ static int num;
+
+ printf("aul_resume_pid_async %d test] %d \n", num++, apn_pid);
+ return aul_resume_pid_async(apn_pid);
+}
+
+static int resume_pid_async_test_for_uid(void)
+{
+ static int num;
+
+ printf("aul_resume_pid_async_for_uid %d test] %d \n", num++, apn_pid);
+ return aul_resume_pid_async_for_uid(apn_pid, atoi(gargv[3]));
+}
+
static int test_regex()
{
char *token;
"[usage] get_last_caller_pid <pid>"},
{"get_last_caller_pid_for_uid", get_last_caller_pid_test_for_uid, "aul_app_get_last_caller_pid_for_uid test",
"[usage] get_last_caller_pid_for_uid <pid> <uid"},
+ {"resume_pid_async", resume_pid_async_test, "aul_resume_pid_async",
+ "[usage] resume_pid_async <pid>"},
+ {"resume_pid_async_for_uid", resume_pid_async_test_for_uid, "aul_resume_pid_async_for_uid",
+ "[usage] resume_pid_async_for_uid <pid> <uid>"},
};
int callfunc(char *testname)