Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d0b4b1c

Browse files
committed
Documentation
1 parent fd2f748 commit d0b4b1c

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

shell/common/platform_view.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ class PlatformView {
628628
const uint8_t* snapshot_data,
629629
const uint8_t* snapshot_instructions);
630630

631+
// TODO(garyq): Implement a proper asset_resolver replacement instead of
632+
// overwriting the entire asset manager.
631633
//--------------------------------------------------------------------------
632634
/// @brief Sets the asset manager of the engine to asset_manager
633635
///

shell/platform/android/io/flutter/embedding/engine/dynamicfeatures/DynamicFeatureManager.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package io.flutter.embedding.engine.dynamicfeatures;
66

7+
// TODO: add links to external documentation on how to use split aot features.
78
/**
89
* Basic interface that handles downloading and loading of dynamic features.
910
*
@@ -22,10 +23,13 @@
2223
* should typically ensure the new assets are available to the engine's asset manager by passing an
2324
* updated android AssetManager to the engine.
2425
*
25-
* <p>The methods here may also be called manually via platform channel messages.
26+
* <p>The loadAssets and loadDartLibrary methods are separated out because they may also be called
27+
* manually via platform channel messages. A full downloadDynamicFeature implementation should call
28+
* these two methods as needed.
2629
*
2730
* <p>A dynamic feature module is uniquely identified by a module name as defined in bundle_config.yaml.
28-
* Each feature module may contain one or more loading units, uniquely identified by the loading unit ID.
31+
* Each feature module may contain one or more loading units, uniquely identified by the loading unit ID
32+
* and assets.
2933
*/
3034
public interface DynamicFeatureManager {
3135
/**
@@ -37,9 +41,9 @@ public interface DynamicFeatureManager {
3741
*
3842
* <p>This method begins the download and installation of the specified feature module. For example,
3943
* the Play Store dynamic delivery implementation uses SplitInstallManager to request the download of
40-
* the module. Download is not complete when this method returns. Upon completion of
41-
* download, loadAssets and loadDartLibrary should be called to complete the dynamic feature load
42-
* process.
44+
* the module. Download is not complete when this method returns. The download process should be
45+
* listened for and upon completion of download, listeners should invoke loadAssets and loadDartLibrary
46+
* to complete the dynamic feature load process.
4347
*
4448
* <p>Both parameters are not always necessary to identify which module to install. Asset-only modules
4549
* do not have an associated loadingUnitId. Instead, an invalid ID like -1 may be passed to download

shell/platform/android/io/flutter/embedding/engine/dynamicfeatures/PlayStoreDynamicFeatureManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ public class PlayStoreDynamicFeatureManager implements DynamicFeatureManager {
3636
private static final String TAG = "PlayStoreDynamicFeatureManager";
3737

3838
private @NonNull SplitInstallManager splitInstallManager;
39-
private @NonNull Map<Integer, String> sessionIdToName;
40-
private @NonNull Map<Integer, Integer> sessionIdToLoadingUnitId;
4139
private @NonNull FlutterJNI flutterJNI;
4240
private @NonNull Context context;
41+
// Each request to install a feature module gets a session ID. These maps associate
42+
// the session ID with the loading unit and module name that was requested.
43+
private @NonNull Map<Integer, String> sessionIdToName;
44+
private @NonNull Map<Integer, Integer> sessionIdToLoadingUnitId;
4345

4446
private FeatureInstallStateUpdatedListener listener;
4547

0 commit comments

Comments
 (0)