ErrorReporter: Link to the market the app was installed from, rather than hardcoding Google Play.

This commit is contained in:
Andreas Schildbach 2021-02-08 17:05:48 +01:00
parent 8dc28f01c5
commit 973b2011c5
4 changed files with 8 additions and 8 deletions

View file

@ -326,7 +326,6 @@
<string name="alert_crash_report_new_version">Es gibt eine neue Öffi-Version %s. Du solltest aktualisieren, denn möglicherweise wurde dein Problem schon behoben.</string>
<string name="alert_crash_report_message">Möchtest du einen Fehlerbericht senden, um dabei zu helfen das Problem zu lösen?</string>
<string name="alert_crash_report_positive">Senden</string>
<string name="alert_crash_report_update">Google Play</string>
<string name="alert_crash_report_download">Herunterladen</string>
<string name="alert_crash_report_negative">Schließen</string>
<string name="notification_channel_appwidget_name">App-Widget-Aktivität</string>

View file

@ -327,7 +327,6 @@
<string name="alert_crash_report_new_version">There is a new Offi version %s available. You should update, as your problem might already have been fixed.</string>
<string name="alert_crash_report_message">Would you like to send a crash report, helping to fix this issue in the future?</string>
<string name="alert_crash_report_positive">Send</string>
<string name="alert_crash_report_update">Google Play</string>
<string name="alert_crash_report_download">Download</string>
<string name="alert_crash_report_negative">Dismiss</string>
<string name="notification_channel_appwidget_name">App-widget activity</string>

View file

@ -31,7 +31,6 @@ public class Constants {
public static final String PLAN_STATIONS_FILENAME = "plans-stations.txt";
public static final String MARKET_APP_URL = "market://details?id=%s";
public static final String GOOGLE_PLAY_APP_URL = "https://play.google.com/store/apps/details?id=%s";
public static final String BITCOIN_ADDRESS = "bc1q8ruc8hanp7hrzfs48dvtuzz4ukmpe7cgsvvzrt";
public static final String REPORT_EMAIL = "oeffi.app@gmail.com";

View file

@ -362,11 +362,14 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
: context.getString(R.string.alert_crash_report_message));
builder.setNegativeButton(R.string.alert_crash_report_negative, (dialog, which) -> stackTraceFile.delete());
if (newVersion != null) {
builder.setNeutralButton(R.string.alert_crash_report_update, (dialog, which) -> {
stackTraceFile.delete();
context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=" + context.getPackageName())));
});
final Installer installer = Installer.from(context);
if (installer != null) {
builder.setNeutralButton(installer.displayName, (dialog, which) -> {
stackTraceFile.delete();
context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=" + context.getPackageName())));
});
}
builder.setPositiveButton(R.string.alert_crash_report_download, (dialog, which) -> {
stackTraceFile.delete();
context.startActivity(