#include "launcher_env.h"
static const char* INTERNET_PRIVILEGE = "http://tizen.org/privilege/internet";
-bool isInternetPrivilegeExisted = false;
static int checkInternetPrivilegeCb(const char *privilegeName, void *user_data)
{
+ bool* ret = (bool*)user_data;
if (!strcmp(privilegeName, INTERNET_PRIVILEGE)) {
- isInternetPrivilegeExisted = true;
+ *ret = true;
return -1;
}
return 0;
void checkInternetPrivilegeAndDisableIPv6(const char* pkgId, const std::string& rootPath)
{
+ bool isInternetPrivilegeExisted = false;
pkgmgrinfo_pkginfo_h pkg_handle;
int ret = pkgmgrGetPkgInfo(pkgId, &pkg_handle);
if (ret != 0) {
return;
}
- ret = pkgmgrinfo_pkginfo_foreach_privilege(pkg_handle, checkInternetPrivilegeCb, NULL);
+ ret = pkgmgrinfo_pkginfo_foreach_privilege(pkg_handle, checkInternetPrivilegeCb, &isInternetPrivilegeExisted);
if (ret != PMINFO_R_OK) {
_SERR("Failed to pkgmgrinfo_pkginfo_foreach_privilege");
pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_handle);