const struct appinfo *ai;
const char *app_path;
const char *pkg_type;
+ const char *pkg_id;
const char *hwacc;
char tmpbuf[MAX_PID_STR_BUFSZ];
hwacc = appinfo_get_value(ai, AIT_HWACC);
app_path = appinfo_get_value(ai, AIT_EXEC);
pkg_type = appinfo_get_value(ai, AIT_TYPE);
+ pkg_id = appinfo_get_value(ai, AIT_PKGID);
__set_stime(kb);
bundle_add_str(kb, AUL_K_HWACC, hwacc);
bundle_add_str(kb, AUL_K_EXEC, app_path);
bundle_add_str(kb, AUL_K_PACKAGETYPE, pkg_type);
+ bundle_add_str(kb, AUL_K_PKGID, pkg_id);
pid = app_agent_send_cmd(uid, APP_START, kb);
if (pid > 0)
const char *multiple = NULL;
const char *app_path = NULL;
const char *pkg_type = NULL;
+ const char *pkg_id = NULL;
int pid = -1;
char tmpbuf[MAX_PID_STR_BUFSZ];
const char *hwacc;
app_path = appinfo_get_value(ai, AIT_EXEC);
pkg_type = appinfo_get_value(ai, AIT_TYPE);
+ pkg_id = appinfo_get_value(ai, AIT_PKGID);
if ((ret = __compare_signature(ai, cmd, caller_uid, appid, caller_appid, fd)) != 0)
return ret;
bundle_add(kb, AUL_K_HWACC, hwacc);
bundle_add(kb, AUL_K_EXEC, app_path);
bundle_add(kb, AUL_K_PACKAGETYPE, pkg_type);
+ bundle_add(kb, AUL_K_PKGID, pkg_id);
pid = app_agent_send_cmd(caller_uid, cmd, kb);
}
#define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
/** AUL internal private key - To support data control*/
#define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
-
+/** AUL internal private key */
+#define AUL_K_PKGID "__AUL_PKGID_"
/**
* @brief This is callback function for aul_launch_init
int aul_remove_caller_cb(int pid);
int aul_invoke_caller_cb(int pid);
+void aul_set_preinit_window(void *evas_object);
+void* aul_get_preinit_window(const char *win_name);
+void aul_set_preinit_background(void *evas_object);
+void* aul_get_preinit_background(void);
+void aul_set_preinit_conformant(void *evas_object);
+void* aul_get_preinit_conformant(void);
+void aul_set_preinit_appid(const char *appid);
+void aul_set_preinit_pkgid(const char *pkgid);
+
int aul_update_freezer_status(int pid, const char* type);
int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
static int aul_initialized = 0;
static int aul_fd;
+static void *__window_object = NULL;
+static void *__bg_object = NULL;
+static void *__conformant_object = NULL;
static int (*_aul_handler) (aul_type type, bundle *kb, void *data) = NULL;
static void *_aul_data;
-
-
static int app_resume();
static int app_terminate();
static void __clear_internal_key(bundle *kb);
return 0;
}
+SLPAPI void aul_set_preinit_window(void *evas_object)
+{
+ __window_object = evas_object;
+}
+
+SLPAPI void* aul_get_preinit_window(const char *win_name)
+{
+ return __window_object;
+}
+
+SLPAPI void aul_set_preinit_background(void *evas_object)
+{
+ __bg_object = evas_object;
+}
+
+SLPAPI void* aul_get_preinit_background(void)
+{
+ return __bg_object;
+}
+
+SLPAPI void aul_set_preinit_conformant(void *evas_object)
+{
+ __conformant_object = evas_object;
+}
+
+SLPAPI void* aul_get_preinit_conformant(void)
+{
+ return __conformant_object;
+}
+
SLPAPI int aul_pause_app(const char *appid)
{
int ret;
void *user_param;
} internal_param_t;
+static const char *__appid = NULL;
+static const char *__pkgid = NULL;
+
SLPAPI int aul_app_is_running(const char *appid)
{
int ret = 0;
if (appid == NULL)
return 0;
- ret = __app_send_raw(AUL_UTIL_PID, APP_IS_RUNNING, (unsigned char*)appid, strlen(appid));
+ ret = __app_send_raw(AUL_UTIL_PID, APP_IS_RUNNING, (unsigned char*)appid,
+ strlen(appid));
- if(ret > 0)
+ if (ret > 0)
return true;
return 0;
if (pkt == NULL)
return AUL_R_ERROR;
- for( pkt_data = (char *)pkt->data; ; pkt_data = NULL) {
+ for ( pkt_data = (char *)pkt->data; ; pkt_data = NULL) {
token = strtok_r(pkt_data, ";", &saveptr1);
if (token == NULL)
break;
return AUL_R_OK;
}
+SLPAPI void aul_set_preinit_appid(const char *appid)
+{
+ __appid = appid;
+}
+
+SLPAPI void aul_set_preinit_pkgid(const char *pkgid)
+{
+ __pkgid = pkgid;
+}
+
static int __get_info_bypid(int pid, char *appid, int len, int cmd)
{
char *result;
if (pid != getpid()) {
pkt = __app_send_cmd_with_result(AUL_UTIL_PID,
- APP_GET_APPID_BYPID, (unsigned char *)&pid,
- sizeof(pid));
+ APP_GET_APPID_BYPID, (unsigned char *)&pid,
+ sizeof(pid));
if (pkt == NULL)
return AUL_R_ERROR;
if (pkt->cmd == APP_GET_INFO_ERROR) {
free(pkt);
return AUL_R_OK;
} else {
+ if (__appid) {
+ snprintf(appid, len, "%s", __appid);
+ return AUL_R_OK;
+ }
+
ret = __get_appid_bypid(pid, appid, len);
if (ret == 0)
return AUL_R_OK;
app_pkt_t *pkt = NULL;
int pgid;
int cmd = APP_GET_PKGID_BYPID;
+ int cpid = getpid();
- if (pid == getpid() || getuid()==0 || geteuid()==0) {
+ if (pid == cpid && __pkgid) {
+ snprintf(pkgid, len, "%s", __pkgid);
+ return AUL_R_OK;
+ }
+
+ if (pid == cpid || getuid() == 0 || geteuid() == 0) {
if (__get_info_bypid(pid, pkgid, len, cmd) == 0) {
SECURE_LOGD("pkgid for %d is %s", pid, pkgid);
return AUL_R_OK;
return AUL_R_EINVAL;
pkt = __app_send_cmd_with_result(AUL_UTIL_PID, cmd,
- (unsigned char *)&pid, sizeof(pid));
+ (unsigned char *)&pid, sizeof(pid));
if (pkt == NULL)
return AUL_R_ERROR;
free(pkt);
return AUL_R_OK;
}
+