static void __send_app_signal(uid_t uid, const char *req_id,
const char *pkgid, const char *appid,
- const char *key, const char *val)
+ const char *key, const char *val, int req_type)
{
pkgmgr_installer *pi;
if (pkgmgr_installer_set_uid(pi, uid))
goto catch;
- if (pkgmgr_installer_set_request_type(pi,PKGMGR_REQ_ENABLE_DISABLE_APP))
+ if (req_type == PKGMGR_REQUEST_TYPE_ENABLE_GLOBAL_APP_FOR_UID
+ || req_type == PKGMGR_REQUEST_TYPE_ENABLE_APP) {
+ if (pkgmgr_installer_set_request_type(pi, PKGMGR_REQ_ENABLE_APP))
+ goto catch;
+ } else if (req_type == PKGMGR_REQUEST_TYPE_DISABLE_GLOBAL_APP_FOR_UID
+ || req_type == PKGMGR_REQUEST_TYPE_DISABLE_APP) {
+ if (pkgmgr_installer_set_request_type(pi, PKGMGR_REQ_DISABLE_APP))
+ goto catch;
+ } else {
+ DBG("Unsupported req_type[%d]", req_type);
goto catch;
+ }
+
if (pkgmgr_installer_set_session_id(pi, req_id))
goto catch;
pkgmgr_installer_send_app_signal(pi, "app", pkgid, appid, key, val);
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
- PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR);
+ PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR, item->req_type);
/* get actual pkgid and replace it to appid which is currently stored at pkgid variable */
ret = __change_item_info(item, item->uid);
if (ret != PMINFO_R_OK || strlen(item->appid) == 0) {
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
return ret;
}
ret = pkgmgr_parser_update_app_disable_info_in_usr_db(item->appid, item->uid, 0);
if (ret != PMINFO_R_OK)
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
else
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR,
+ item->req_type);
+
return ret;
}
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
- PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR);
+ PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR, item->req_type);
/* get actual pkgid and replace it to appid which is currently stored at pkgid variable */
ret = __change_item_info(item, item->uid);
if (ret != PMINFO_R_OK || strlen(item->appid) == 0) {
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
return ret;
}
ret = __kill_app(item->appid, item->uid);
if (ret != PMINFO_R_OK) {
- __send_app_signal(item->uid, item->req_id, item->pkg_type,
- item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ __send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
}
ret = pkgmgr_parser_update_app_disable_info_in_usr_db(item->appid, item->uid, 1);
if (ret != PMINFO_R_OK)
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
else
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR,
+ item->req_type);
return ret;
}
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
- PKGMGR_INSTALLER_GLOBAL_APP_ENABLE_FOR_UID);
+ PKGMGR_INSTALLER_GLOBAL_APP_ENABLE_FOR_UID, item->req_type);
/* get actual pkgid and replace it to appid which is currently stored at pkgid variable */
ret = __change_item_info(item, item->uid);
if (ret != PMINFO_R_OK || strlen(item->appid) == 0) {
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
return ret;
}
ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(item->appid, item->uid, 0);
if (ret != PMINFO_R_OK)
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
else
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR,
+ item->req_type);
return ret;
}
__send_app_signal(item->uid, item->req_id,
item->pkgid, item->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
- PKGMGR_INSTALLER_GLOBAL_APP_DISABLE_FOR_UID);
+ PKGMGR_INSTALLER_GLOBAL_APP_DISABLE_FOR_UID, item->req_type);
/* get actual pkgid and replace it to appid which is currently stored at pkgid variable */
ret = __change_item_info(item, GLOBAL_USER);
if (ret != PMINFO_R_OK || strlen(item->appid) == 0) {
__send_app_signal(item->uid, item->req_id, item->pkgid, item->pkgid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
return ret;
}
ret = __kill_app(item->appid, item->uid);
+ ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(item->appid,
+ item->uid, 1);
- ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(item->appid, item->uid, 1);
if (ret != PMINFO_R_OK)
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_FAIL_EVENT_STR,
+ item->req_type);
else
__send_app_signal(item->uid, item->req_id, item->pkgid, item->appid,
- PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR);
+ PKGMGR_INSTALLER_END_KEY_STR, PKGMGR_INSTALLER_OK_EVENT_STR,
+ item->req_type);
return ret;
}