int privilege_db_manager_is_privacy_white_list(const char* pkgid, const char* privilege)
{
- if (DISABLE_ASKUSER)
- return 1;
-
- if (access(ASKUSER_RUNTIME_DISABLE_PATH, F_OK) == 0) {
- _LOGD("askuser is disabled in run-time.");
- return 1;
- }
-
sqlite3 *db = NULL;
sqlite3_stmt *stmt = NULL;
int ret = __initialize_db(PRIVILEGE_DB_TYPE_INFO, &db);
{
TryReturn(pkgid != NULL && privilege != NULL, , PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] pkgid or privilege is NULL");
int ret = PRVMGR_ERR_NONE;
- ret = privilege_db_manager_is('p', privilege);
+ ret = privilege_info_is_privacy(privilege);
if (ret == 1) {
ret = privilege_db_manager_is_privacy_white_list(pkgid, privilege);
if (ret == 1) {
*type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL;
ret = PRVMGR_ERR_NONE;
} else {
- LOGE("privilege_db_manager_is_disabled_privilege failed");
+ LOGE("privilege_db_manager_is_disabled_privilege failed. ret = %d", ret);
ret = PRVMGR_ERR_INTERNAL_ERROR;
}
} else {
- LOGE("privilege_db_manager_is failed");
+ LOGE("privilege_info_is_privacy() failed. ret = %d", ret);
ret = PRVMGR_ERR_INTERNAL_ERROR;
}
return ret;
int privilege_package_info_set_privacy_privilege(const uid_t uid, const char* pkgid, privilege_manager_package_type_e pkg_type, const char* api_version, GList* privilege_list)
{
+ if (DISABLE_ASKUSER)
+ return PRVMGR_ERR_NONE;
+
TryReturn(pkgid != NULL && api_version != NULL && privilege_list != NULL, , PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] pkgid, api_version, and privilege_list must not be NULL.");
int ret = privilege_db_manager_set_package_privacy_privilege_info(uid, pkgid, pkg_type, api_version, privilege_list);
if (ret != PRIVILEGE_DB_MANAGER_ERR_NONE) {
int privilege_package_info_unset_package_privilege_info(const uid_t uid, const char* pkgid)
{
+ if (DISABLE_ASKUSER)
+ return PRVMGR_ERR_NONE;
+
TryReturn(pkgid != NULL, , PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] pkgid must not be NULL.");
int ret = privilege_db_manager_unset_package_privilege_info(uid, pkgid);
if (ret != PRIVILEGE_DB_MANAGER_ERR_NONE) {