diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2018-08-27 04:37:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-27 04:37:17 +0200 |
| commit | 246b1f44598349e60ef040839ecdbd95f1de1d5f (patch) | |
| tree | 60557346f78ade02536eb2b5eafd5ffeb6214547 /Source/Android/jni/AndroidCommon/IDCache.cpp | |
| parent | b571d0c537625f3b34a4f2b98919a0fdd56d1c6f (diff) | |
| parent | a26cf8febcaf8d8f8d44a44ae834614bf89de2a8 (diff) | |
Merge pull request #7350 from zackhow/android-analytics
Android: Add usage statistics to android
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
| -rw-r--r-- | Source/Android/jni/AndroidCommon/IDCache.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index 2c457d6c9d..42a5632139 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -20,6 +20,10 @@ static jmethodID s_game_file_constructor; static jclass s_game_file_cache_class;
static jfieldID s_game_file_cache_pointer;
+static jclass s_analytics_class;
+static jmethodID s_send_analytics_report;
+static jmethodID s_get_analytics_value;
+
namespace IDCache
{
JavaVM* GetJavaVM()
@@ -37,6 +41,20 @@ jmethodID GetDisplayAlertMsg() return s_display_alert_msg;
}
+jclass GetAnalyticsClass()
+{
+ return s_analytics_class;
+}
+
+jmethodID GetSendAnalyticsReport()
+{
+ return s_send_analytics_report;
+}
+
+jmethodID GetAnalyticsValue()
+{
+ return s_get_analytics_value;
+}
jclass GetGameFileClass()
{
return s_game_file_class;
@@ -91,6 +109,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) s_game_file_cache_class = reinterpret_cast<jclass>(env->NewGlobalRef(game_file_cache_class));
s_game_file_cache_pointer = env->GetFieldID(game_file_cache_class, "mPointer", "J");
+ const jclass analytics_class = env->FindClass("org/dolphinemu/dolphinemu/utils/Analytics");
+ s_analytics_class = reinterpret_cast<jclass>(env->NewGlobalRef(analytics_class));
+ s_send_analytics_report =
+ env->GetStaticMethodID(s_analytics_class, "sendReport", "(Ljava/lang/String;[B)V");
+ s_get_analytics_value = env->GetStaticMethodID(s_analytics_class, "getValue",
+ "(Ljava/lang/String;)Ljava/lang/String;");
+
return JNI_VERSION;
}
@@ -103,6 +128,7 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) env->DeleteGlobalRef(s_native_library_class);
env->DeleteGlobalRef(s_game_file_class);
env->DeleteGlobalRef(s_game_file_cache_class);
+ env->DeleteGlobalRef(s_analytics_class);
}
#ifdef __cplusplus
|
