From 09841962201df110504e97b2d4cf822af71bcffc Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 22 Oct 2018 01:04:59 -0700 Subject: [PATCH] Make image to work Summary: ImageManager is used to update the LocalData of Image views, as part of this process we call ImageManager::requestImage in cross platform code. Event if Android doesn't use ImageRequest we need to return an empty non-operation version of this object. Reviewed By: shergin Differential Revision: D10429663 fbshipit-source-id: 3621ece72f7291e2e6ab6a84b238ac16b595fc18 --- ReactCommon/fabric/imagemanager/ImageRequest.h | 2 ++ .../fabric/imagemanager/platform/android/ImageManager.cpp | 2 +- .../fabric/imagemanager/platform/android/ImageRequest.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ReactCommon/fabric/imagemanager/ImageRequest.h b/ReactCommon/fabric/imagemanager/ImageRequest.h index 1a84a1833d2..9151f498b71 100644 --- a/ReactCommon/fabric/imagemanager/ImageRequest.h +++ b/ReactCommon/fabric/imagemanager/ImageRequest.h @@ -33,6 +33,8 @@ class ImageRequest final { */ class ImageNoLongerNeededException; + ImageRequest(); + /* * `ImageRequest` is constructed with `ImageSource` and * `ImageResponse` future which must be moved in inside the object. diff --git a/ReactCommon/fabric/imagemanager/platform/android/ImageManager.cpp b/ReactCommon/fabric/imagemanager/platform/android/ImageManager.cpp index 4221aac1e20..6c81c831b63 100644 --- a/ReactCommon/fabric/imagemanager/platform/android/ImageManager.cpp +++ b/ReactCommon/fabric/imagemanager/platform/android/ImageManager.cpp @@ -20,7 +20,7 @@ ImageManager::~ImageManager() { ImageRequest ImageManager::requestImage(const ImageSource &imageSource) const { // Not implemented. - abort(); + return {}; } } // namespace react diff --git a/ReactCommon/fabric/imagemanager/platform/android/ImageRequest.cpp b/ReactCommon/fabric/imagemanager/platform/android/ImageRequest.cpp index ec88e317028..35b2ecfd860 100644 --- a/ReactCommon/fabric/imagemanager/platform/android/ImageRequest.cpp +++ b/ReactCommon/fabric/imagemanager/platform/android/ImageRequest.cpp @@ -10,6 +10,8 @@ namespace facebook { namespace react { +ImageRequest::ImageRequest() {} + ImageRequest::ImageRequest( const ImageSource &imageSource, folly::Future &&responseFuture) {