MCPcopy Create free account
hub / github.com/defold/defold / GetApplicationInfo

Function GetApplicationInfo

engine/dlib/src/dlib/sys_android.cpp:342–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

GetEnvMethod · 0.80
GetActivityMethod · 0.80

Tested by

no test coverage detected