#endif
int ms_user_get_internal_root_path(uid_t uid, char **path);
+#ifdef _USE_TVPD_MODE
+int ms_user_get_aot_content_path(uid_t uid, char **path);
+#endif
bool ms_user_is_valid_path(uid_t uid, const char *path);
bool ms_user_thumb_support(uid_t uid, const char *path);
int ms_user_get_root_thumb_store_path(uid_t uid, char **path);
INTERNAL_ROOT,
THUMB_ROOT,
WORDBOOK_DB,
- MEDIA_SHARED
+ MEDIA_SHARED,
+#ifdef _USE_TVPD_MODE
+ AOT_CONTENT,
+#endif
} ms_user_path_type_e;
static int __ms_user_get_path(ms_user_path_type_e type, uid_t uid, char **path)
case MEDIA_SHARED:
result = tzplatform_context_getenv(context[idx], TZ_USER_MEDIASHARED);
break;
+#endif
+#ifdef _USE_TVPD_MODE
+ case AOT_CONTENT:
+ result = tzplatform_context_mkpath(context[idx], TZ_USER_SHARE, "waydroid/data/aot_share/content");
+ break;
#endif
default:
ret = MS_MEDIA_ERR_INTERNAL;
return g_str_has_prefix(path, internal_path);
}
+#ifdef _USE_TVPD_MODE
+int ms_user_get_aot_content_path(uid_t uid, char **path)
+{
+ if (uid != getuid())
+ return __ms_user_get_path(AOT_CONTENT, uid, path);
+
+ *path = g_strdup(tzplatform_mkpath(TZ_USER_SHARE, "waydroid/data/aot_share/content"));
+
+ return MS_MEDIA_ERR_NONE;
+}
+
+static bool __ms_user_is_aot_content(uid_t uid, const char *path)
+{
+ g_autofree gchar *aot_content_path = NULL;
+ ms_user_get_aot_content_path(uid, &aot_content_path);
+
+ return g_str_has_prefix(path, aot_content_path);
+}
+#endif
+
bool ms_user_is_valid_path(uid_t uid, const char *path)
{
if (__ms_user_is_internal(uid, path))
if (g_str_has_prefix(path, tzplatform_getenv(TZ_SYS_STORAGE)))
return true;
+#ifdef _USE_TVPD_MODE
+ if (__ms_user_is_aot_content(uid, path))
+ return true;
+#endif
+
MSAPI_DBG_ERR("Invalid path[%s]", path);
return false;