+AUL_API int aul_get_app_res_control_allowed_resource_path(const char* res_type,
+ char** path) {
+ if (res_type == nullptr || path == nullptr) {
+ _E("Invalid parameter");
+ return AUL_R_EINVAL;
+ }
+
+ auto* context = GetCurrentContext();
+ if (context == nullptr)
+ return AUL_R_ERROR;
+
+ std::string result = context->GetResControlAllowedResPath() + res_type + "/";
+
+ if (access(result.c_str(), F_OK) != 0)
+ return AUL_R_EREJECTED;
+
+ *path = strdup(result.c_str());
+ if (*path == nullptr) {
+ LOGE("Out of memory");
+ return AUL_R_ENOMEM;
+ }
+
+ return AUL_R_OK;
+}
+
+AUL_API int aul_get_app_res_control_global_resource_path(const char* res_type,
+ char** path) {
+ if (res_type == nullptr || path == nullptr) {
+ _E("Invalid parameter");
+ return AUL_R_EINVAL;
+ }
+
+ auto* context = GetCurrentContext();
+ if (context == nullptr)
+ return AUL_R_ERROR;
+
+ std::string result = context->GetResControlGlobalResPath() + res_type + "/";
+
+ if (access(result.c_str(), F_OK) != 0)
+ return AUL_R_EREJECTED;
+
+ *path = strdup(result.c_str());
+ if (*path == nullptr) {
+ LOGE("Out of memory");
+ return AUL_R_ENOMEM;
+ }
+
+ return AUL_R_OK;
+}
+