From 6cf7a252e57bfea325101ff5d2f9bfca36099171 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sat, 4 Jul 2020 21:02:50 +0200 Subject: Report bugs on failed database upgrade --- .../nextcloud/deck/ui/exception/tips/TipsAdapter.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/src/main/java') diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java index fa4113b1e..a059b2956 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java @@ -133,6 +133,16 @@ public class TipsAdapter extends RecyclerView.Adapter { add(R.string.error_dialog_capabilities_not_parsable); } } + } else if (throwable instanceof RuntimeException) { + if (throwable.getMessage() != null && throwable.getMessage().contains("database")) { + Intent reportIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.url_report_bug))) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_report_issue); + add(R.string.error_dialog_tip_database_upgrade_failed, reportIntent); + Intent clearIntent = new Intent(ACTION_APPLICATION_DETAILS_SETTINGS) + .setData(Uri.parse("package:" + BuildConfig.APPLICATION_ID)) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_deck_info); + add(R.string.error_dialog_tip_clear_storage, clearIntent); + } } } -- cgit v1.2.3