We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59896f5 commit c4c1617Copy full SHA for c4c1617
gframe/Android/COSAndroidOperator.cpp
@@ -5,7 +5,19 @@
5
#endif
6
7
#include <sys/utsname.h>
8
+#include <android/ndk-version.h>
9
+#if __NDK_MAJOR__ >= 19
10
#include <android/api-level.h>
11
+#else
12
+#include <sys/system_properties.h>
13
+#include <cstdlib>
14
+static inline int android_get_device_api_level() {
15
+ char value[92] = { 0 };
16
+ if (__system_property_get("ro.build.version.sdk", value) < 1) return -1;
17
+ int api_level = std::atoi(value);
18
+ return (api_level > 0) ? api_level : -1;
19
+}
20
+#endif
21
#include "COSAndroidOperator.h"
22
#include "porting_android.h"
23
0 commit comments