| 340 | } |
| 341 | |
| 342 | bool GetApplicationInfo(const char* id, ApplicationInfo* info) |
| 343 | { |
| 344 | memset(info, 0, sizeof(*info)); |
| 345 | |
| 346 | dmAndroid::ThreadAttacher thread; |
| 347 | JNIEnv* env = thread.GetEnv(); |
| 348 | if (!env) |
| 349 | { |
| 350 | return false; |
| 351 | } |
| 352 | |
| 353 | jclass def_activity_class = env->GetObjectClass(thread.GetActivity()->clazz); |
| 354 | jmethodID isAppInstalled = env->GetMethodID(def_activity_class, "isAppInstalled", "(Ljava/lang/String;)Z"); |
| 355 | jstring str_url = env->NewStringUTF(id); |
| 356 | jboolean installed = env->CallBooleanMethod(thread.GetActivity()->clazz, isAppInstalled, str_url); |
| 357 | env->DeleteLocalRef(str_url); |
| 358 | |
| 359 | info->m_Installed = installed; |
| 360 | return installed; |
| 361 | } |
| 362 | |
| 363 | static const char* FixAndroidResourcePath(const char* path) |
| 364 | { |
nothing calls this directly
no test coverage detected