#include "amd_inotify.h"
#include "amd_launch.h"
#include "amd_noti.h"
+#include "amd_proc.h"
#include "amd_request.h"
#include "amd_signal.h"
#include "amd_socket.h"
{
int cmd = APP_GET_INFO_ERROR;
int len = 0;
- int ret;
- char appid[MAX_PACKAGE_STR_SIZE] = {0,};
+ const char *appid;
app_status_h app_status;
app_status = _app_status_find(pid);
if (app_status) {
- snprintf(appid, sizeof(appid), "%s",
- _app_status_get_appid(app_status));
- SECURE_LOGD("appid for %d is %s", pid, appid);
+ appid = _app_status_get_appid(app_status);
+ SECURE_LOGD("App ID of %d is %s", pid, appid);
+ } else {
+ appid = _proc_get_name(pid);
+ if (appid)
+ SECURE_LOGD("Process name of %d is %s", pid, appid);
+ }
+
+ if (appid) {
len = strlen(appid);
cmd = APP_GET_INFO_OK;
}
- ret = aul_sock_send_raw_with_fd(fd, cmd, (unsigned char *)appid,
+ return aul_sock_send_raw_with_fd(fd, cmd, (unsigned char *)appid,
len, AUL_SOCK_NOREPLY);
-
- return ret;
}
int _app_status_get_pkgid_bypid(int fd, int pid)