From a6b2355b8d559aba2f1f13394c91f563f9b9e1a4 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Tue, 26 Nov 2024 04:22:09 -0800 Subject: [PATCH] Introduce Android ImageManger (#47721) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47721 This diff splits Cxx ImageManger into Cxx and Android variants. They both are currently no-op, but the Android one will be used for image prefetching, just as `RCTImageManager.mm` for iOS. Changelog: [Internal] Reviewed By: javache Differential Revision: D65753319 fbshipit-source-id: 774ff09b6b397facee7f645706dd97ba6d1177d7 --- .../platform/android/ImageManager.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/renderer/imagemanager/platform/android/ImageManager.cpp diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/android/ImageManager.cpp b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/android/ImageManager.cpp new file mode 100644 index 00000000000000..7d4380753a13a4 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/android/ImageManager.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "ImageManager.h" + +namespace facebook::react { + +ImageManager::ImageManager( + const ContextContainer::Shared& /*contextContainer*/) { + // Silence unused-private-field warning. + (void)self_; + // Not implemented. +} + +ImageManager::~ImageManager() = default; + +ImageRequest ImageManager::requestImage( + const ImageSource& imageSource, + SurfaceId /*surfaceId*/) const { + // Not implemented. + return {imageSource, nullptr, {}}; +} + +} // namespace facebook::react