[components] For https://github.com/mozilla-mobile/android-components/issues/11954...
commitbb59a08515d4acde3fa1fd31a65f9fa95e8794c9
authorJamie Nicol <jamie@jamienicol.me>
Mon, 4 Apr 2022 12:28:37 +0000 (4 13:28 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 4 Apr 2022 20:24:25 +0000 (4 20:24 +0000)
tree6cb5de5d1d3d378f48a2c8f8a904cb70638297b5
parentc285f63fff2e47a2afbd9ab45dc323f8bb85370d
[components] For https://github.com/mozilla-mobile/android-components/issues/11954 - Adapt crash prompt for background child process crashes

Although we currently prefer showing the crash notification over the
crash prompt for background process crashes, users can still open the
prompt by clicking on the notification. Unfortunately in its current
state the prompt is unsuitable for background process crashes. This
patch makes some adjustments to the prompt for the background process
case to make it less jarring:

* The title now matches the crash notification title for background
  child process crashes, eg "Sorry. A problem occurred in Firefox."
  rather than "Sorry. Firefox had a problem and crashed."
* We avoid setting the FLAG_ACTIVITY_CLEAR_TASK flag on the intent,
  meaning the browser remains visible behind the dialog.
* We remove the "Restart Firefox" button, as the browser has continued
  running and therefore does not need to be restarted.
mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/prompt/CrashPrompt.kt
mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/prompt/CrashReporterActivity.kt
mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/prompt/CrashReporterActivityTest.kt