Android: Add content provider support to File::ScanDirectoryTree

This commit is contained in:
JosJuice 2020-11-08 16:57:49 +01:00
parent 525268f043
commit 2126f62111
6 changed files with 255 additions and 22 deletions

View file

@ -121,6 +121,15 @@ std::string GetAndroidContentDisplayName(const std::string& uri)
return display_name ? GetJString(env, reinterpret_cast<jstring>(display_name)) : "";
}
std::vector<std::string> GetAndroidContentChildNames(const std::string& uri)
{
JNIEnv* env = IDCache::GetEnvForThread();
jobject children =
env->CallStaticObjectMethod(IDCache::GetContentHandlerClass(),
IDCache::GetContentHandlerGetChildNames(), ToJString(env, uri));
return JStringArrayToVector(env, reinterpret_cast<jobjectArray>(children));
}
int GetNetworkIpAddress()
{
JNIEnv* env = IDCache::GetEnvForThread();