5#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_
10#include "flutter/assets/asset_manager.h"
11#include "flutter/fml/macros.h"
12#include "flutter/fml/unique_fd.h"
13#include "flutter/lib/ui/window/viewport_metrics.h"
14#include "flutter/runtime/platform_data.h"
15#include "flutter/shell/common/run_configuration.h"
16#include "flutter/shell/common/shell.h"
17#include "flutter/shell/common/thread_host.h"
18#include "flutter/shell/platform/android/apk_asset_provider.h"
19#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
20#include "flutter/shell/platform/android/platform_message_handler_android.h"
21#include "flutter/shell/platform/android/platform_view_android.h"
45 std::shared_ptr<PlatformViewAndroidJNI> jni_facade);
80 std::unique_ptr<AndroidShellHolder>
Spawn(
81 std::shared_ptr<PlatformViewAndroidJNI> jni_facade,
82 const std::string& entrypoint,
83 const std::string& libraryUrl,
84 const std::string& initial_route,
85 const std::vector<std::string>& entrypoint_args)
const;
87 void Launch(std::unique_ptr<APKAssetProvider> apk_asset_provider,
88 const std::string& entrypoint,
89 const std::string& libraryUrl,
90 const std::vector<std::string>& entrypoint_args);
103 return shell_->GetPlatformMessageHandler();
110 const std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;
112 std::shared_ptr<ThreadHost> thread_host_;
113 std::unique_ptr<Shell> shell_;
114 bool is_valid_ =
false;
115 uint64_t next_pointer_flow_id_ = 0;
116 std::unique_ptr<APKAssetProvider> apk_asset_provider_;
130 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade,
131 const std::shared_ptr<ThreadHost>& thread_host,
132 std::unique_ptr<Shell>
shell,
133 std::unique_ptr<APKAssetProvider> apk_asset_provider,
135 static void ThreadDestructCallback(
void*
value);
136 std::optional<RunConfiguration> BuildRunConfiguration(
137 const std::string& entrypoint,
138 const std::string& libraryUrl,
139 const std::vector<std::string>& entrypoint_args)
const;
141 bool IsNDKImageDecoderAvailable();
This is the Android owner of the core engine Shell.
const flutter::Settings & GetSettings() const
std::unique_ptr< AndroidShellHolder > Spawn(std::shared_ptr< PlatformViewAndroidJNI > jni_facade, const std::string &entrypoint, const std::string &libraryUrl, const std::string &initial_route, const std::vector< std::string > &entrypoint_args) const
This is a factory for a derived AndroidShellHolder from an existing AndroidShellHolder.
void NotifyLowMemoryWarning()
void UpdateDisplayMetrics()
const std::shared_ptr< PlatformMessageHandler > & GetPlatformMessageHandler() const
fml::WeakPtr< PlatformViewAndroid > GetPlatformView()
Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, bool base64_encode)
void Launch(std::unique_ptr< APKAssetProvider > apk_asset_provider, const std::string &entrypoint, const std::string &libraryUrl, const std::vector< std::string > &entrypoint_args)
AndroidShellHolder(const flutter::Settings &settings, std::shared_ptr< PlatformViewAndroidJNI > jni_facade)
ScreenshotType
The type of the screenshot to obtain of the previously rendered layer tree.
A POD type used to return the screenshot data along with the size of the frame.