gecko-dev/mobile
Jan Henning b761a2d765 Bug 1449504 - Part 1 - Truncate overly long text before sharing via an Intent. r=jchen
At least on some devices, there seems to exist some sort of intermediate danger
zone where the intent is no longer large enough to be rejected outright by the
OS, but still big enough to render Firefox inoperable through some sort of
resource exhaustion.

From Android 6.0 onwards, this doesn't matter as otherwise we would have crashed
anyway, but on previous Android versions a much too large intent will simply be
ignored, so if we truncate, but not enough, this actually makes matters worse.

The value used in this patch was chosen by attempting to share the whole
contents of planet.mozilla.org on a Samsumg S3 Mini running Android 4.1.2.
90k characters led to resource exhaustion and the screen turning black, while
85k characters still worked. On a more modern phone, even larger amounts (e.g.
100k characters, like Chrome) worked. Therefore, to have some additional margin,
a maximum limit of 80k characters will be used.

MozReview-Commit-ID: 6etHe0KUgig

--HG--
extra : rebase_source : 5f712da6cf53572dfa5c755ef097a5961a0be891
2018-03-28 22:52:14 +02:00
..
android Bug 1449504 - Part 1 - Truncate overly long text before sharing via an Intent. r=jchen 2018-03-28 22:52:14 +02:00
locales Bug 1442738 - Update default search config. r=mconnor 2018-03-07 08:03:05 -06:00