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

Function GetNetworkConnectivity

engine/dlib/src/dlib/sys_android.cpp:41–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 NetworkConnectivity GetNetworkConnectivity()
42 {
43 dmAndroid::ThreadAttacher thread;
44 JNIEnv* env = thread.GetEnv();
45 if (!env)
46 {
47 return NETWORK_DISCONNECTED;
48 }
49
50 jclass def_activity_class = env->GetObjectClass(thread.GetActivity()->clazz);
51 jmethodID get_connectivity_method = env->GetMethodID(def_activity_class, "getConnectivity", "()I");
52 int reti = (int)env->CallIntMethod(thread.GetActivity()->clazz, get_connectivity_method);
53 return (NetworkConnectivity)reti;
54 }
55
56 Result Rename(const char* dst_filename, const char* src_filename)
57 {

Callers

nothing calls this directly

Calls 2

GetEnvMethod · 0.80
GetActivityMethod · 0.80

Tested by

no test coverage detected