Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swallow exceptions on draw, forward to onError (facebook#46964)
Summary: Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing. Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco. ## Changelog [Android][Fixed] - Apps will no longer fatally crash when trying to draw large images Reviewed By: tdn120 Differential Revision: D64144596
- Loading branch information