5package io.flutter.embedding.engine;
7import static io.flutter.Build.API_LEVELS;
10import android.content.res.AssetManager;
12import android.graphics.ColorSpace;
13import android.graphics.ImageDecoder;
14import android.graphics.SurfaceTexture;
17import android.util.DisplayMetrics;
21import android.view.SurfaceHolder;
22import androidx.annotation.Keep;
23import androidx.annotation.NonNull;
24import androidx.annotation.Nullable;
25import androidx.annotation.UiThread;
26import androidx.annotation.VisibleForTesting;
28import io.flutter.embedding.engine.FlutterEngine.EngineLifecycleListener;
29import io.flutter.embedding.engine.dart.PlatformMessageHandler;
30import io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager;
31import io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack;
32import io.flutter.embedding.engine.renderer.FlutterUiDisplayListener;
33import io.flutter.embedding.engine.renderer.SurfaceTextureWrapper;
34import io.flutter.embedding.engine.systemchannels.SettingsChannel;
35import io.flutter.plugin.common.StandardMessageCodec;
36import io.flutter.plugin.localization.LocalizationPlugin;
37import io.flutter.plugin.platform.PlatformViewsController;
38import io.flutter.util.Preconditions;
39import io.flutter.view.AccessibilityBridge;
40import io.flutter.view.FlutterCallbackInformation;
41import io.flutter.view.TextureRegistry;
42import java.io.IOException;
43import java.lang.ref.WeakReference;
44import java.nio.ByteBuffer;
45import java.util.ArrayList;
47import java.util.Locale;
49import java.util.concurrent.CopyOnWriteArraySet;
50import java.util.concurrent.locks.ReentrantReadWriteLock;
107 private static final String TAG =
"FlutterJNI";
113 private ReentrantReadWriteLock shellHolderLock =
new ReentrantReadWriteLock();
119 mainLooper = Looper.getMainLooper();
144 Log.
w(
TAG,
"FlutterJNI.loadLibrary called more than once");
147 System.loadLibrary(
"flutter");
148 FlutterJNI.loadLibraryCalled =
true;
151 private static boolean loadLibraryCalled =
false;
153 private static native
void nativePrefetchDefaultFontManager();
164 if (
FlutterJNI.prefetchDefaultFontManagerCalled) {
165 Log.
w(
TAG,
"FlutterJNI.prefetchDefaultFontManager called more than once");
168 FlutterJNI.nativePrefetchDefaultFontManager();
169 FlutterJNI.prefetchDefaultFontManagerCalled =
true;
172 private static boolean prefetchDefaultFontManagerCalled =
false;
174 private static native
void nativeInit(
175 @NonNull Context context,
176 @NonNull String[]
args,
177 @Nullable String bundlePath,
178 @NonNull String appStoragePath,
179 @NonNull String engineCachesPath,
180 long initTimeMillis);
195 @NonNull Context context,
196 @NonNull String[]
args,
197 @Nullable String bundlePath,
198 @NonNull String appStoragePath,
199 @NonNull String engineCachesPath,
200 long initTimeMillis) {
202 Log.
w(
TAG,
"FlutterJNI.init called more than once");
206 context,
args, bundlePath, appStoragePath, engineCachesPath, initTimeMillis);
207 FlutterJNI.initCalled =
true;
210 private static boolean initCalled =
false;
213 @Nullable
private static AsyncWaitForVsyncDelegate asyncWaitForVsyncDelegate;
222 private static float refreshRateFPS = 60.0f;
224 private static float displayWidth = -1.0f;
225 private static float displayHeight = -1.0f;
226 private static float displayDensity = -1.0f;
229 @Nullable
private static String vmServiceUri;
231 private native
boolean nativeGetIsSoftwareRenderingEnabled();
240 return nativeGetIsSoftwareRenderingEnabled();
284 FlutterJNI.refreshRateFPS = refreshRateFPS;
289 FlutterJNI.displayWidth =
width;
290 FlutterJNI.displayHeight =
height;
291 FlutterJNI.displayDensity = density;
295 nativeUpdateDisplayMetrics(nativeShellHolderId);
298 private native
void nativeUpdateDisplayMetrics(
long nativeShellHolderId);
304 nativeUpdateRefreshRate(refreshRateFPS);
307 private native
void nativeUpdateRefreshRate(
float refreshRateFPS);
318 asyncWaitForVsyncDelegate = delegate;
323 private static void asyncWaitForVsync(
final long cookie) {
324 if (asyncWaitForVsyncDelegate !=
null) {
325 asyncWaitForVsyncDelegate.asyncWaitForVsync(cookie);
327 throw new IllegalStateException(
328 "An AsyncWaitForVsyncDelegate must be registered with FlutterJNI before asyncWaitForVsync() is invoked.");
332 private native
void nativeOnVsync(
long frameDelayNanos,
long refreshPeriodNanos,
long cookie);
342 public void onVsync(
long frameDelayNanos,
long refreshPeriodNanos,
long cookie) {
343 nativeOnVsync(frameDelayNanos, refreshPeriodNanos, cookie);
351 private native
boolean nativeFlutterTextUtilsIsEmoji(
int codePoint);
354 return nativeFlutterTextUtilsIsEmoji(codePoint);
357 private native
boolean nativeFlutterTextUtilsIsEmojiModifier(
int codePoint);
360 return nativeFlutterTextUtilsIsEmojiModifier(codePoint);
363 private native
boolean nativeFlutterTextUtilsIsEmojiModifierBase(
int codePoint);
366 return nativeFlutterTextUtilsIsEmojiModifierBase(codePoint);
369 private native
boolean nativeFlutterTextUtilsIsVariationSelector(
int codePoint);
372 return nativeFlutterTextUtilsIsVariationSelector(codePoint);
375 private native
boolean nativeFlutterTextUtilsIsRegionalIndicator(
int codePoint);
378 return nativeFlutterTextUtilsIsRegionalIndicator(codePoint);
386 @Nullable
private Long nativeShellHolderId;
387 @Nullable
private AccessibilityDelegate accessibilityDelegate;
395 private final Set<EngineLifecycleListener> engineLifecycleListeners =
new CopyOnWriteArraySet<>();
398 private final Set<FlutterUiDisplayListener> flutterUiDisplayListeners =
399 new CopyOnWriteArraySet<>();
401 @NonNull
private final Looper mainLooper;
409 return nativeShellHolderId !=
null;
420 ensureRunningOnMainThread();
421 ensureNotAttachedToNative();
422 shellHolderLock.writeLock().lock();
426 shellHolderLock.writeLock().unlock();
432 return nativeAttach(flutterJNI);
435 private native
long nativeAttach(@NonNull
FlutterJNI flutterJNI);
453 @Nullable String entrypointFunctionName,
454 @Nullable String pathToEntrypointFunction,
455 @Nullable String initialRoute,
457 ensureRunningOnMainThread();
458 ensureAttachedToNative();
462 entrypointFunctionName,
463 pathToEntrypointFunction,
467 spawnedJNI.nativeShellHolderId !=
null && spawnedJNI.nativeShellHolderId != 0,
468 "Failed to spawn new JNI connected shell from existing shell.");
474 long nativeSpawningShellId,
475 @Nullable String entrypointFunctionName,
476 @Nullable String pathToEntrypointFunction,
477 @Nullable String initialRoute,
478 @Nullable List<String> entrypointArgs);
494 ensureRunningOnMainThread();
495 ensureAttachedToNative();
496 shellHolderLock.writeLock().lock();
498 nativeDestroy(nativeShellHolderId);
499 nativeShellHolderId =
null;
501 shellHolderLock.writeLock().unlock();
505 private native
void nativeDestroy(
long nativeShellHolderId);
507 private void ensureNotAttachedToNative() {
508 if (nativeShellHolderId !=
null) {
509 throw new RuntimeException(
510 "Cannot execute operation because FlutterJNI is attached to native.");
514 private void ensureAttachedToNative() {
515 if (nativeShellHolderId ==
null) {
516 throw new RuntimeException(
517 "Cannot execute operation because FlutterJNI is not attached to native.");
530 ensureRunningOnMainThread();
531 flutterUiDisplayListeners.add(listener);
540 ensureRunningOnMainThread();
541 flutterUiDisplayListeners.remove(listener);
545 long imageGeneratorPointer,
int width,
int height);
554 @SuppressWarnings(
"unused")
559 ImageDecoder.Source
source = ImageDecoder.createSource(
buffer);
561 return ImageDecoder.decodeBitmap(
570 decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE);
575 }
catch (IOException
e) {
576 Log.
e(
TAG,
"Failed to decode image",
e);
584 @SuppressWarnings(
"unused")
588 ensureRunningOnMainThread();
591 listener.onFlutterUiDisplayed();
599 ensureRunningOnMainThread();
602 listener.onFlutterUiNoLongerDisplayed();
615 ensureRunningOnMainThread();
616 ensureAttachedToNative();
617 nativeSurfaceCreated(nativeShellHolderId,
surface);
620 private native
void nativeSurfaceCreated(
long nativeShellHolderId, @NonNull Surface
surface);
631 ensureRunningOnMainThread();
632 ensureAttachedToNative();
633 nativeSurfaceWindowChanged(nativeShellHolderId,
surface);
636 private native
void nativeSurfaceWindowChanged(
637 long nativeShellHolderId, @NonNull Surface
surface);
648 ensureRunningOnMainThread();
649 ensureAttachedToNative();
650 nativeSurfaceChanged(nativeShellHolderId,
width,
height);
653 private native
void nativeSurfaceChanged(
long nativeShellHolderId,
int width,
int height);
664 ensureRunningOnMainThread();
665 ensureAttachedToNative();
667 nativeSurfaceDestroyed(nativeShellHolderId);
670 private native
void nativeSurfaceDestroyed(
long nativeShellHolderId);
681 float devicePixelRatio,
684 int physicalPaddingTop,
685 int physicalPaddingRight,
686 int physicalPaddingBottom,
687 int physicalPaddingLeft,
688 int physicalViewInsetTop,
689 int physicalViewInsetRight,
690 int physicalViewInsetBottom,
691 int physicalViewInsetLeft,
692 int systemGestureInsetTop,
693 int systemGestureInsetRight,
694 int systemGestureInsetBottom,
695 int systemGestureInsetLeft,
696 int physicalTouchSlop,
697 int[] displayFeaturesBounds,
698 int[] displayFeaturesType,
699 int[] displayFeaturesState) {
700 ensureRunningOnMainThread();
701 ensureAttachedToNative();
702 nativeSetViewportMetrics(
708 physicalPaddingRight,
709 physicalPaddingBottom,
711 physicalViewInsetTop,
712 physicalViewInsetRight,
713 physicalViewInsetBottom,
714 physicalViewInsetLeft,
715 systemGestureInsetTop,
716 systemGestureInsetRight,
717 systemGestureInsetBottom,
718 systemGestureInsetLeft,
720 displayFeaturesBounds,
722 displayFeaturesState);
725 private native
void nativeSetViewportMetrics(
726 long nativeShellHolderId,
727 float devicePixelRatio,
730 int physicalPaddingTop,
731 int physicalPaddingRight,
732 int physicalPaddingBottom,
733 int physicalPaddingLeft,
734 int physicalViewInsetTop,
735 int physicalViewInsetRight,
736 int physicalViewInsetBottom,
737 int physicalViewInsetLeft,
738 int systemGestureInsetTop,
739 int systemGestureInsetRight,
740 int systemGestureInsetBottom,
741 int systemGestureInsetLeft,
742 int physicalTouchSlop,
743 int[] displayFeaturesBounds,
744 int[] displayFeaturesType,
745 int[] displayFeaturesState);
753 ensureRunningOnMainThread();
754 ensureAttachedToNative();
755 nativeDispatchPointerDataPacket(nativeShellHolderId,
buffer, position);
758 private native
void nativeDispatchPointerDataPacket(
759 long nativeShellHolderId, @NonNull ByteBuffer
buffer,
int position);
764 ensureRunningOnMainThread();
765 this.platformViewsController = platformViewsController;
781 ensureRunningOnMainThread();
782 this.accessibilityDelegate = accessibilityDelegate;
792 @SuppressWarnings(
"unused")
794 private void updateSemantics(
795 @NonNull ByteBuffer
buffer,
796 @NonNull String[] strings,
797 @NonNull ByteBuffer[] stringAttributeArgs) {
798 ensureRunningOnMainThread();
799 if (accessibilityDelegate !=
null) {
800 accessibilityDelegate.updateSemantics(
buffer, strings, stringAttributeArgs);
815 @SuppressWarnings(
"unused")
817 private void updateCustomAccessibilityActions(
818 @NonNull ByteBuffer
buffer, @NonNull String[] strings) {
819 ensureRunningOnMainThread();
820 if (accessibilityDelegate !=
null) {
821 accessibilityDelegate.updateCustomAccessibilityActions(
buffer, strings);
835 ensureAttachedToNative();
837 ByteBuffer encodedArgs =
null;
841 position = encodedArgs.position();
856 int nodeId,
int action, @Nullable ByteBuffer
args,
int argsPosition) {
857 ensureRunningOnMainThread();
858 ensureAttachedToNative();
859 nativeDispatchSemanticsAction(nativeShellHolderId, nodeId,
action,
args, argsPosition);
862 private native
void nativeDispatchSemanticsAction(
863 long nativeShellHolderId,
866 @Nullable ByteBuffer
args,
875 ensureRunningOnMainThread();
876 ensureAttachedToNative();
877 nativeSetSemanticsEnabled(nativeShellHolderId, enabled);
880 private native
void nativeSetSemanticsEnabled(
long nativeShellHolderId,
boolean enabled);
886 ensureRunningOnMainThread();
887 ensureAttachedToNative();
888 nativeSetAccessibilityFeatures(nativeShellHolderId,
flags);
891 private native
void nativeSetAccessibilityFeatures(
long nativeShellHolderId,
int flags);
901 ensureRunningOnMainThread();
902 ensureAttachedToNative();
903 nativeRegisterTexture(
904 nativeShellHolderId, textureId,
new WeakReference<SurfaceTextureWrapper>(textureWrapper));
907 private native
void nativeRegisterTexture(
908 long nativeShellHolderId,
910 @NonNull WeakReference<SurfaceTextureWrapper> textureWrapper);
920 ensureRunningOnMainThread();
921 ensureAttachedToNative();
922 nativeRegisterImageTexture(
925 new WeakReference<TextureRegistry.ImageConsumer>(imageTexture));
928 private native
void nativeRegisterImageTexture(
929 long nativeShellHolderId,
931 @NonNull WeakReference<TextureRegistry.ImageConsumer> imageTexture);
942 ensureRunningOnMainThread();
943 ensureAttachedToNative();
944 nativeMarkTextureFrameAvailable(nativeShellHolderId, textureId);
947 private native
void nativeMarkTextureFrameAvailable(
long nativeShellHolderId,
long textureId);
952 ensureRunningOnMainThread();
953 ensureAttachedToNative();
954 nativeScheduleFrame(nativeShellHolderId);
957 private native
void nativeScheduleFrame(
long nativeShellHolderId);
965 ensureRunningOnMainThread();
966 ensureAttachedToNative();
967 nativeUnregisterTexture(nativeShellHolderId, textureId);
970 private native
void nativeUnregisterTexture(
long nativeShellHolderId,
long textureId);
982 @NonNull String bundlePath,
983 @Nullable String entrypointFunctionName,
984 @Nullable String pathToEntrypointFunction,
985 @NonNull AssetManager assetManager,
987 ensureRunningOnMainThread();
988 ensureAttachedToNative();
989 nativeRunBundleAndSnapshotFromLibrary(
992 entrypointFunctionName,
993 pathToEntrypointFunction,
998 private native
void nativeRunBundleAndSnapshotFromLibrary(
999 long nativeShellHolderId,
1000 @NonNull String bundlePath,
1001 @Nullable String entrypointFunctionName,
1002 @Nullable String pathToEntrypointFunction,
1003 @NonNull AssetManager
manager,
1004 @Nullable List<String> entrypointArgs);
1035 ensureRunningOnMainThread();
1036 this.platformMessageHandler = platformMessageHandler;
1039 private native
void nativeCleanupMessageData(
long messageData);
1050 nativeCleanupMessageData(messageData);
1055 @SuppressWarnings(
"unused")
1058 @NonNull
final String channel,
1061 final long messageData) {
1062 if (platformMessageHandler !=
null) {
1063 platformMessageHandler.handleMessageFromDart(channel,
message, replyId, messageData);
1065 nativeCleanupMessageData(messageData);
1073 @SuppressWarnings(
"unused")
1074 private
void handlePlatformMessageResponse(
int replyId, ByteBuffer reply) {
1075 if (platformMessageHandler !=
null) {
1076 platformMessageHandler.handlePlatformMessageResponse(replyId, reply);
1088 ensureRunningOnMainThread();
1090 nativeDispatchEmptyPlatformMessage(nativeShellHolderId, channel, responseId);
1094 "Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: "
1102 private native
void nativeDispatchEmptyPlatformMessage(
1103 long nativeShellHolderId, @NonNull String channel,
int responseId);
1108 @NonNull String channel, @Nullable ByteBuffer
message,
int position,
int responseId) {
1109 ensureRunningOnMainThread();
1111 nativeDispatchPlatformMessage(nativeShellHolderId, channel,
message, position, responseId);
1115 "Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: "
1123 private native
void nativeDispatchPlatformMessage(
1124 long nativeShellHolderId,
1125 @NonNull String channel,
1133 shellHolderLock.readLock().lock();
1136 nativeInvokePlatformMessageEmptyResponseCallback(nativeShellHolderId, responseId);
1140 "Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: "
1144 shellHolderLock.readLock().unlock();
1149 private native
void nativeInvokePlatformMessageEmptyResponseCallback(
1150 long nativeShellHolderId,
int responseId);
1154 int responseId, @NonNull ByteBuffer
message,
int position) {
1157 throw new IllegalArgumentException(
"Expected a direct ByteBuffer.");
1159 shellHolderLock.readLock().lock();
1162 nativeInvokePlatformMessageResponseCallback(
1163 nativeShellHolderId, responseId,
message, position);
1167 "Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: "
1171 shellHolderLock.readLock().unlock();
1176 private native
void nativeInvokePlatformMessageResponseCallback(
1177 long nativeShellHolderId,
int responseId, @Nullable ByteBuffer
message,
int position);
1187 ensureRunningOnMainThread();
1188 engineLifecycleListeners.add(engineLifecycleListener);
1198 ensureRunningOnMainThread();
1199 engineLifecycleListeners.remove(engineLifecycleListener);
1203 @SuppressWarnings(
"unused")
1204 private
void onPreEngineRestart() {
1206 listener.onPreEngineRestart();
1210 @SuppressWarnings(
"unused")
1213 ensureRunningOnMainThread();
1214 if (platformViewsController ==
null) {
1215 throw new RuntimeException(
1216 "platformViewsController must be set before attempting to position an overlay surface");
1218 platformViewsController.onDisplayOverlaySurface(
id,
x,
y,
width,
height);
1221 @SuppressWarnings(
"unused")
1224 ensureRunningOnMainThread();
1225 if (platformViewsController ==
null) {
1226 throw new RuntimeException(
1227 "platformViewsController must be set before attempting to begin the frame");
1229 platformViewsController.onBeginFrame();
1232 @SuppressWarnings(
"unused")
1235 ensureRunningOnMainThread();
1236 if (platformViewsController ==
null) {
1237 throw new RuntimeException(
1238 "platformViewsController must be set before attempting to end the frame");
1240 platformViewsController.onEndFrame();
1243 @SuppressWarnings(
"unused")
1246 ensureRunningOnMainThread();
1247 if (platformViewsController ==
null) {
1248 throw new RuntimeException(
1249 "platformViewsController must be set before attempting to position an overlay surface");
1251 return platformViewsController.createOverlaySurface();
1254 @SuppressWarnings(
"unused")
1257 ensureRunningOnMainThread();
1258 if (platformViewsController ==
null) {
1259 throw new RuntimeException(
1260 "platformViewsController must be set before attempting to destroy an overlay surface");
1262 platformViewsController.destroyOverlaySurfaces();
1271 ensureRunningOnMainThread();
1272 this.localizationPlugin = localizationPlugin;
1276 @SuppressWarnings(
"unused")
1279 if (localizationPlugin ==
null) {
1280 return new String[0];
1282 List<Locale> supportedLocales =
new ArrayList<Locale>();
1283 final int localeDataLength = 3;
1284 for (
int i = 0;
i < strings.length;
i += localeDataLength) {
1285 String languageCode = strings[
i + 0];
1286 String countryCode = strings[
i + 1];
1287 String scriptCode = strings[
i + 2];
1289 Locale.Builder localeBuilder =
new Locale.Builder();
1290 if (!languageCode.isEmpty()) {
1291 localeBuilder.setLanguage(languageCode);
1293 if (!countryCode.isEmpty()) {
1294 localeBuilder.setRegion(countryCode);
1296 if (!scriptCode.isEmpty()) {
1297 localeBuilder.setScript(scriptCode);
1299 supportedLocales.add(localeBuilder.build());
1302 Locale
result = localizationPlugin.resolveNativeLocale(supportedLocales);
1305 return new String[0];
1307 String[]
output =
new String[localeDataLength];
1318 if (metrics ==
null) {
1321 "getScaledFontSize called with configurationId "
1322 + String.valueOf(configurationId)
1323 +
", which can't be found.");
1326 return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, fontSize, metrics)
1336 ensureRunningOnMainThread();
1337 this.deferredComponentManager = deferredComponentManager;
1338 if (deferredComponentManager !=
null) {
1339 deferredComponentManager.setJNI(
this);
1353 @SuppressWarnings(
"unused")
1356 if (deferredComponentManager !=
null) {
1357 deferredComponentManager.installDeferredComponent(loadingUnitId,
null);
1362 "No DeferredComponentManager found. Android setup must be completed before using split AOT deferred components.");
1384 ensureRunningOnMainThread();
1385 ensureAttachedToNative();
1386 nativeLoadDartDeferredLibrary(nativeShellHolderId, loadingUnitId, searchPaths);
1389 private native
void nativeLoadDartDeferredLibrary(
1390 long nativeShellHolderId,
int loadingUnitId, @NonNull String[] searchPaths);
1404 @NonNull AssetManager assetManager, @NonNull String assetBundlePath) {
1405 ensureRunningOnMainThread();
1406 ensureAttachedToNative();
1407 nativeUpdateJavaAssetManager(nativeShellHolderId, assetManager, assetBundlePath);
1410 private native
void nativeUpdateJavaAssetManager(
1411 long nativeShellHolderId,
1412 @NonNull AssetManager assetManager,
1413 @NonNull String assetBundlePath);
1429 @SuppressWarnings(
"unused")
1432 int loadingUnitId, @NonNull String
error,
boolean isTransient) {
1433 ensureRunningOnMainThread();
1434 nativeDeferredComponentInstallFailure(loadingUnitId,
error, isTransient);
1437 private native
void nativeDeferredComponentInstallFailure(
1438 int loadingUnitId, @NonNull String
error,
boolean isTransient);
1453 ensureRunningOnMainThread();
1454 if (platformViewsController ==
null) {
1455 throw new RuntimeException(
1456 "platformViewsController must be set before attempting to position a platform view");
1458 platformViewsController.onDisplayPlatformView(
1459 viewId,
x,
y,
width,
height, viewWidth, viewHeight, mutatorsStack);
1465 ensureRunningOnMainThread();
1466 ensureAttachedToNative();
1467 return nativeGetBitmap(nativeShellHolderId);
1471 private native Bitmap nativeGetBitmap(
long nativeShellHolderId);
1482 ensureRunningOnMainThread();
1483 ensureAttachedToNative();
1484 nativeNotifyLowMemoryWarning(nativeShellHolderId);
1487 private native
void nativeNotifyLowMemoryWarning(
long nativeShellHolderId);
1489 private void ensureRunningOnMainThread() {
1490 if (Looper.myLooper() != mainLooper) {
1491 throw new RuntimeException(
1492 "Methods marked with @UiThread must be executed on the main thread. Current thread: "
1493 + Thread.currentThread().getName());
1519 @NonNull ByteBuffer
buffer,
1520 @NonNull String[] strings,
1521 @NonNull ByteBuffer[] stringAttributeArgs);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void e(@NonNull String tag, @NonNull String message)
static void w(@NonNull String tag, @NonNull String message)
FlutterJNI provideFlutterJNI()
void setSemanticsEnabled(boolean enabled)
void updateJavaAssetManager( @NonNull AssetManager assetManager, @NonNull String assetBundlePath)
void addIsDisplayingFlutterUiListener(@NonNull FlutterUiDisplayListener listener)
void onSurfaceDestroyed()
void cleanupMessageData(long messageData)
void requestDartDeferredLibrary(int loadingUnitId)
void runBundleAndSnapshotFromLibrary( @NonNull String bundlePath, @Nullable String entrypointFunctionName, @Nullable String pathToEntrypointFunction, @NonNull AssetManager assetManager, @Nullable List< String > entrypointArgs)
static String getObservatoryUri()
void setDeferredComponentManager( @Nullable DeferredComponentManager deferredComponentManager)
void init( @NonNull Context context, @NonNull String[] args, @Nullable String bundlePath, @NonNull String appStoragePath, @NonNull String engineCachesPath, long initTimeMillis)
boolean isCodePointEmojiModifier(int codePoint)
long performNativeAttach(@NonNull FlutterJNI flutterJNI)
void dispatchEmptyPlatformMessage(@NonNull String channel, int responseId)
void setPlatformViewsController(@NonNull PlatformViewsController platformViewsController)
boolean getIsSoftwareRenderingEnabled()
void dispatchSemanticsAction(int nodeId, @NonNull AccessibilityBridge.Action action, @Nullable Object args)
void notifyLowMemoryWarning()
void invokePlatformMessageEmptyResponseCallback(int responseId)
void detachFromNativeAndReleaseResources()
void registerTexture(long textureId, @NonNull SurfaceTextureWrapper textureWrapper)
void setAccessibilityDelegate(@Nullable AccessibilityDelegate accessibilityDelegate)
void deferredComponentInstallFailure(int loadingUnitId, @NonNull String error, boolean isTransient)
void dispatchPointerDataPacket(@NonNull ByteBuffer buffer, int position)
void registerImageTexture(long textureId, @NonNull TextureRegistry.ImageConsumer imageTexture)
void onSurfaceCreated(@NonNull Surface surface)
void addEngineLifecycleListener(@NonNull EngineLifecycleListener engineLifecycleListener)
void setLocalizationPlugin(@Nullable LocalizationPlugin localizationPlugin)
boolean isCodePointEmojiModifierBase(int codePoint)
boolean isCodePointRegionalIndicator(int codePoint)
float getScaledFontSize(float fontSize, int configurationId)
void setViewportMetrics(float devicePixelRatio, int physicalWidth, int physicalHeight, int physicalPaddingTop, int physicalPaddingRight, int physicalPaddingBottom, int physicalPaddingLeft, int physicalViewInsetTop, int physicalViewInsetRight, int physicalViewInsetBottom, int physicalViewInsetLeft, int systemGestureInsetTop, int systemGestureInsetRight, int systemGestureInsetBottom, int systemGestureInsetLeft, int physicalTouchSlop, int[] displayFeaturesBounds, int[] displayFeaturesType, int[] displayFeaturesState)
static native void nativeImageHeaderCallback(long imageGeneratorPointer, int width, int height)
void unregisterTexture(long textureId)
void handlePlatformMessage( @NonNull final String channel, ByteBuffer message, final int replyId, final long messageData)
void onRenderingStopped()
void onSurfaceChanged(int width, int height)
void dispatchSemanticsAction(int nodeId, @NonNull AccessibilityBridge.Action action)
void onSurfaceWindowChanged(@NonNull Surface surface)
FlutterOverlaySurface createOverlaySurface()
static native FlutterCallbackInformation nativeLookupCallbackInformation(long handle)
static String getVMServiceUri()
void destroyOverlaySurfaces()
void dispatchSemanticsAction(int nodeId, int action, @Nullable ByteBuffer args, int argsPosition)
static Bitmap decodeImage(@NonNull ByteBuffer buffer, long imageGeneratorAddress)
boolean isCodePointEmoji(int codePoint)
void setPlatformMessageHandler(@Nullable PlatformMessageHandler platformMessageHandler)
void setRefreshRateFPS(float refreshRateFPS)
void removeIsDisplayingFlutterUiListener(@NonNull FlutterUiDisplayListener listener)
void prefetchDefaultFontManager()
void setAsyncWaitForVsyncDelegate(@Nullable AsyncWaitForVsyncDelegate delegate)
void onVsync(long frameDelayNanos, long refreshPeriodNanos, long cookie)
void updateDisplayMetrics(int displayId, float width, float height, float density)
boolean isCodePointVariantSelector(int codePoint)
FlutterJNI spawn( @Nullable String entrypointFunctionName, @Nullable String pathToEntrypointFunction, @Nullable String initialRoute, @Nullable List< String > entrypointArgs)
void setAccessibilityFeatures(int flags)
void loadDartDeferredLibrary(int loadingUnitId, @NonNull String[] searchPaths)
void onDisplayOverlaySurface(int id, int x, int y, int width, int height)
void dispatchPlatformMessage( @NonNull String channel, @Nullable ByteBuffer message, int position, int responseId)
void markTextureFrameAvailable(long textureId)
void removeEngineLifecycleListener( @NonNull EngineLifecycleListener engineLifecycleListener)
void invokePlatformMessageResponseCallback(int responseId, @NonNull ByteBuffer message, int position)
String[] computePlatformResolvedLocale(@NonNull String[] strings)
void onDisplayPlatformView(int viewId, int x, int y, int width, int height, int viewWidth, int viewHeight, FlutterMutatorsStack mutatorsStack)
static DisplayMetrics getPastDisplayMetrics(int configId)
ByteBuffer encodeMessage(@Nullable Object message)
static final StandardMessageCodec INSTANCE
static void checkState(boolean expression)
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
void updateSemantics( @NonNull ByteBuffer buffer, @NonNull String[] strings, @NonNull ByteBuffer[] stringAttributeArgs)
void updateCustomAccessibilityActions(@NonNull ByteBuffer buffer, @NonNull String[] strings)
void asyncWaitForVsync(final long cookie)
def Build(configs, env, options)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size