diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-07-04 22:02:50 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-07-04 22:02:50 +0300 |
commit | 6cf7a252e57bfea325101ff5d2f9bfca36099171 (patch) | |
tree | bd0a6babff66a6ff78542d96925097a56565e724 /app/src/main/java | |
parent | c831b4eec7edd63c82b73898ee8c879026abb81f (diff) |
Report bugs on failed database upgrade
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java | 10 |
1 files changed, 10 insertions, 0 deletions
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<TipsViewHolder> { 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); + } } } |