Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
dev.flutter.scenarios.TestableFlutterActivity Class Referenceabstract
Inheritance diagram for dev.flutter.scenarios.TestableFlutterActivity:
io.flutter.embedding.android.FlutterActivity io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.Host io.flutter.embedding.android.FlutterEngineProvider io.flutter.embedding.android.FlutterEngineConfigurator io.flutter.plugin.platform.PlatformPlugin.PlatformPluginDelegate dev.flutter.scenarios.TestActivity dev.flutter.scenarios.ExternalTextureFlutterActivity dev.flutter.scenarios.GetBitmapActivity dev.flutter.scenarios.PlatformViewsActivity dev.flutter.scenarios.SpawnMultiEngineActivity dev.flutter.scenarios.SpawnedEngineActivity

Public Member Functions

void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void waitUntilFlutterRendered ()
 
- Public Member Functions inherited from io.flutter.embedding.android.FlutterActivity
 FlutterActivity ()
 
ExclusiveAppComponent< Activity > getExclusiveAppComponent ()
 
void registerOnBackInvokedCallback ()
 
void unregisterOnBackInvokedCallback ()
 
void setFrameworkHandlesBack (boolean frameworkHandlesBack)
 
void onPostResume ()
 
void release ()
 
void detachFromFlutterEngine ()
 
void onBackPressed ()
 
void startBackGesture (@NonNull BackEvent backEvent)
 
void updateBackGestureProgress (@NonNull BackEvent backEvent)
 
void commitBackGesture ()
 
void cancelBackGesture ()
 
void onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
void onUserLeaveHint ()
 
void onWindowFocusChanged (boolean hasFocus)
 
void onTrimMemory (int level)
 
Context getContext ()
 
Activity getActivity ()
 
Lifecycle getLifecycle ()
 
FlutterShellArgs getFlutterShellArgs ()
 
String getCachedEngineId ()
 
String getCachedEngineGroupId ()
 
boolean shouldDestroyEngineWithHost ()
 
String getDartEntrypointFunctionName ()
 
List< String > getDartEntrypointArgs ()
 
String getDartEntrypointLibraryUri ()
 
String getInitialRoute ()
 
String getAppBundlePath ()
 
RenderMode getRenderMode ()
 
TransparencyMode getTransparencyMode ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
PlatformPlugin providePlatformPlugin ( @Nullable Activity activity, @NonNull FlutterEngine flutterEngine)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean shouldAttachEngineToActivity ()
 
boolean shouldHandleDeeplinking ()
 
void onFlutterSurfaceViewCreated (@NonNull FlutterSurfaceView flutterSurfaceView)
 
void onFlutterTextureViewCreated (@NonNull FlutterTextureView flutterTextureView)
 
void onFlutterUiDisplayed ()
 
void onFlutterUiNoLongerDisplayed ()
 
boolean shouldRestoreAndSaveState ()
 
boolean shouldDispatchAppLifecycleState ()
 
boolean attachToEngineAutomatically ()
 
boolean popSystemNavigator ()
 
void updateSystemUiOverlays ()
 
Context getContext ()
 
boolean shouldHandleDeeplinking ()
 
Activity getActivity ()
 
Lifecycle getLifecycle ()
 
FlutterShellArgs getFlutterShellArgs ()
 
String getCachedEngineId ()
 
String getCachedEngineGroupId ()
 
boolean shouldDestroyEngineWithHost ()
 
void detachFromFlutterEngine ()
 
String getDartEntrypointFunctionName ()
 
String getDartEntrypointLibraryUri ()
 
List< String > getDartEntrypointArgs ()
 
String getAppBundlePath ()
 
String getInitialRoute ()
 
RenderMode getRenderMode ()
 
TransparencyMode getTransparencyMode ()
 
ExclusiveAppComponent< Activity > getExclusiveAppComponent ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
PlatformPlugin providePlatformPlugin ( @Nullable Activity activity, @NonNull FlutterEngine flutterEngine)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean shouldAttachEngineToActivity ()
 
void onFlutterSurfaceViewCreated (@NonNull FlutterSurfaceView flutterSurfaceView)
 
void onFlutterTextureViewCreated (@NonNull FlutterTextureView flutterTextureView)
 
void onFlutterUiDisplayed ()
 
void onFlutterUiNoLongerDisplayed ()
 
boolean shouldRestoreAndSaveState ()
 
void updateSystemUiOverlays ()
 
boolean shouldDispatchAppLifecycleState ()
 
boolean attachToEngineAutomatically ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean popSystemNavigator ()
 
default void setFrameworkHandlesBack (boolean frameworkHandlesBack)
 

Protected Member Functions

void onCreate (@Nullable Bundle savedInstanceState)
 
void notifyFlutterRendered ()
 
- Protected Member Functions inherited from io.flutter.embedding.android.FlutterActivity
void onCreate (@Nullable Bundle savedInstanceState)
 
OnBackInvokedCallback getOnBackInvokedCallback ()
 
void onStart ()
 
void onResume ()
 
void onPause ()
 
void onStop ()
 
void onSaveInstanceState (Bundle outState)
 
void onDestroy ()
 
void onActivityResult (int requestCode, int resultCode, Intent data)
 
void onNewIntent (@NonNull Intent intent)
 
BackgroundMode getBackgroundMode ()
 
FlutterEngine getFlutterEngine ()
 
Bundle getMetaData () throws PackageManager.NameNotFoundException
 

Additional Inherited Members

- Static Public Member Functions inherited from io.flutter.embedding.android.FlutterActivity
static Intent createDefaultIntent (@NonNull Context launchContext)
 
static NewEngineIntentBuilder withNewEngine ()
 
static CachedEngineIntentBuilder withCachedEngine (@NonNull String cachedEngineId)
 
static NewEngineInGroupIntentBuilder withNewEngineInGroup (@NonNull String engineGroupId)
 
- Static Public Attributes inherited from io.flutter.embedding.android.FlutterActivity
static final int FLUTTER_VIEW_ID = View.generateViewId()
 
- Protected Attributes inherited from io.flutter.embedding.android.FlutterActivity
FlutterActivityAndFragmentDelegate delegate
 
- Package Functions inherited from io.flutter.embedding.android.FlutterActivity
void setDelegate (@NonNull FlutterActivityAndFragmentDelegate delegate)
 

Detailed Description

Definition at line 15 of file TestableFlutterActivity.java.

Member Function Documentation

◆ configureFlutterEngine()

void dev.flutter.scenarios.TestableFlutterActivity.configureFlutterEngine ( @NonNull FlutterEngine  flutterEngine)
inline

Hook for subclasses to easily configure a FlutterEngine.

This method is called after provideFlutterEngine(Context).

All plugins listed in the app's pubspec are registered in the base implementation of this method unless the FlutterEngine for this activity was externally created. To avoid the automatic plugin registration for implicitly created FlutterEngines, override this method without invoking super(). To keep automatic plugin registration and further configure the FlutterEngine, override this method, invoke super(), and then configure the FlutterEngine as desired.

Reimplemented from io.flutter.embedding.android.FlutterActivity.

Reimplemented in dev.flutter.scenarios.PlatformViewsActivity.

Definition at line 19 of file TestableFlutterActivity.java.

19 {
20 // Do not call super. We have no plugins to register, and the automatic
21 // registration will fail and print a scary exception in the logs.
22 flutterEngine
23 .getDartExecutor()
24 .setMessageHandler("take_screenshot", (byteBuffer, binaryReply) -> notifyFlutterRendered());
25 }

◆ notifyFlutterRendered()

void dev.flutter.scenarios.TestableFlutterActivity.notifyFlutterRendered ( )
inlineprotected

Reimplemented in dev.flutter.scenarios.GetBitmapActivity.

Definition at line 41 of file TestableFlutterActivity.java.

41 {
42 flutterUiRenderedLatch.countDown();
43 }

◆ onCreate()

void dev.flutter.scenarios.TestableFlutterActivity.onCreate ( @Nullable Bundle  savedInstanceState)
inlineprotected

Reimplemented from io.flutter.embedding.android.FlutterActivity.

Reimplemented in dev.flutter.scenarios.ExternalTextureFlutterActivity, and dev.flutter.scenarios.TestActivity.

Definition at line 28 of file TestableFlutterActivity.java.

28 {
29 super.onCreate(savedInstanceState);
30
31 // On newer versions of Android, this is the default. Because these tests are being used to take
32 // screenshots on Skia Gold, we don't want any of the System UI to show up, even for older API
33 // versions (i.e. 28).
34 //
35 // See also:
36 // https://github.com/flutter/engine/blob/a9081cce1f0dd730577a36ee1ca6d7af5cdc5a9b/shell/platform/android/io/flutter/embedding/android/FlutterView.java#L696
37 // https://github.com/flutter/flutter/issues/143471
38 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
39 }

◆ waitUntilFlutterRendered()

void dev.flutter.scenarios.TestableFlutterActivity.waitUntilFlutterRendered ( )
inline

Reimplemented in dev.flutter.scenarios.ExternalTextureFlutterActivity.

Definition at line 45 of file TestableFlutterActivity.java.

45 {
46 try {
47 flutterUiRenderedLatch.await();
48 } catch (InterruptedException e) {
49 throw new RuntimeException(e);
50 }
51 }

The documentation for this class was generated from the following file: