From aaafb9ba0414057ac89bf3f20591338e6608b1d7 Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Mon, 30 Nov 2020 13:20:58 -0500 Subject: [PATCH] Android: Add "Generate a New Statistics Identity" --- .../main/java/org/dolphinemu/dolphinemu/NativeLibrary.java | 2 ++ .../features/settings/ui/SettingsFragmentPresenter.java | 2 ++ Source/Android/app/src/main/res/values/strings.xml | 2 ++ Source/Android/jni/MainAndroid.cpp | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java index 5b609cced0..425551ff77 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -375,6 +375,8 @@ public final class NativeLibrary */ public static native void ReportStartToAnalytics(); + public static native void GenerateNewStatisticsId(); + /** * Begins emulation. */ diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index 37ca607255..2acafe765a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -238,6 +238,8 @@ public final class SettingsFragmentPresenter sl.add(new PercentSliderSetting(FloatSetting.MAIN_EMULATION_SPEED, R.string.speed_limit, 0, 0, 200, "%")); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_ANALYTICS_ENABLED, R.string.analytics, 0)); + sl.add(new RunRunnable(R.string.analytics_new_id, 0, R.string.analytics_new_id_confirmation, 0, + NativeLibrary::GenerateNewStatisticsId)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_ENABLE_SAVESTATES, R.string.enable_save_states, R.string.enable_save_states_description)); } diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 5aaa6c5d2a..e4d293b424 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -158,6 +158,8 @@ Some touch controls will require additional tweaking if played in portrait Enable usage statistics reporting If authorized, Dolphin can collect data on its performance, feature usage, and configuration, as well as data on your system\'s hardware and operating system.\n\nNo private data is ever collected. This data helps us understand how people and emulated games use Dolphin and prioritize our efforts. It also helps us identify rare configurations that are causing bugs, performance and stability issues. This authorization can be revoked at any time through Dolphin\'s settings. + Generate a New Statistics Identity + Are you sure you want to generate a new statistics identity? Interface diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 6fe6da3b61..71c4fac565 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -469,6 +469,12 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReportStartT DolphinAnalytics::Instance().ReportDolphinStart(GetAnalyticValue("DEVICE_TYPE")); } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GenerateNewStatisticsId(JNIEnv*, + jclass) +{ + DolphinAnalytics::Instance().GenerateNewIdentity(); +} + // Returns the scale factor for imgui rendering. // Based on the scaledDensity of the device's display metrics. static float GetRenderSurfaceScale(JNIEnv* env)