Android: Add "Generate a New Statistics Identity"

This commit is contained in:
Ryan Meredith 2020-11-30 13:20:58 -05:00
parent ea2ec64ab4
commit aaafb9ba04
4 changed files with 12 additions and 0 deletions

View File

@ -375,6 +375,8 @@ public final class NativeLibrary
*/
public static native void ReportStartToAnalytics();
public static native void GenerateNewStatisticsId();
/**
* Begins emulation.
*/

View File

@ -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));
}

View File

@ -158,6 +158,8 @@
<string name="lock_emulation_landscape_desc">Some touch controls will require additional tweaking if played in portrait</string>
<string name="analytics">Enable usage statistics reporting</string>
<string name="analytics_desc">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.</string>
<string name="analytics_new_id">Generate a New Statistics Identity</string>
<string name="analytics_new_id_confirmation">Are you sure you want to generate a new statistics identity?</string>
<!-- Interface Preference Fragment -->
<string name="interface_submenu">Interface</string>

View File

@ -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)