@@ -952,6 +952,7 @@ public void setDynamicFeatureManager(@NonNull DynamicFeatureManager dynamicFeatu
952952 }
953953
954954 private Context dynamicFeatureContext ;
955+
955956 @ UiThread
956957 public void setDynamicFeatureContext (@ NonNull Context context ) {
957958 ensureRunningOnMainThread ();
@@ -961,7 +962,16 @@ public void setDynamicFeatureContext(@NonNull Context context) {
961962 @ SuppressWarnings ("unused" )
962963 @ UiThread
963964 public void downloadDynamicFeature (int loadingUnitId ) {
964- String loadingUnitIdResName = dynamicFeatureContext .getResources ().getString (dynamicFeatureContext .getResources ().getIdentifier ("loadingUnit" + loadingUnitId , "string" , dynamicFeatureContext .getPackageName ()));
965+ String loadingUnitIdResName =
966+ dynamicFeatureContext
967+ .getResources ()
968+ .getString (
969+ dynamicFeatureContext
970+ .getResources ()
971+ .getIdentifier (
972+ "loadingUnit" + loadingUnitId ,
973+ "string" ,
974+ dynamicFeatureContext .getPackageName ()));
965975 downloadDynamicFeature (loadingUnitIdResName , loadingUnitId );
966976 }
967977
@@ -974,14 +984,13 @@ public void downloadDynamicFeature(String moduleName, int loadingUnitId) {
974984
975985 /**
976986 * This should be called for every loading unit to be loaded into the dart isolate.
977- *
978- * abi, libName, and apkPaths are used together to search the installed apks for the
979- * desired .so library. If not found, soPath may be provided as a fallback if a
980- * pre-extracted .so exists, especially on older devices with libs compressed in the
981- * apk.
982987 *
983- * Successful loading of the dart library also completes the loadLibrary() future
984- * that triggered the install/load process.
988+ * <p>abi, libName, and apkPaths are used together to search the installed apks for the desired
989+ * .so library. If not found, soPath may be provided as a fallback if a pre-extracted .so exists,
990+ * especially on older devices with libs compressed in the apk.
991+ *
992+ * <p>Successful loading of the dart library also completes the loadLibrary() future that
993+ * triggered the install/load process.
985994 */
986995 @ UiThread
987996 public void loadDartLibrary (
@@ -992,14 +1001,9 @@ public void loadDartLibrary(
9921001 @ NonNull String soPath ) {
9931002 ensureRunningOnMainThread ();
9941003 ensureAttachedToNative ();
995- nativeLoadDartLibrary (
996- nativePlatformViewId ,
997- loadingUnitId ,
998- libName ,
999- apkPaths ,
1000- abi ,
1001- soPath );
1004+ nativeLoadDartLibrary (nativePlatformViewId , loadingUnitId , libName , apkPaths , abi , soPath );
10021005 }
1006+
10031007 private native void nativeLoadDartLibrary (
10041008 long nativePlatformViewId ,
10051009 int loadingUnitId ,
@@ -1008,39 +1012,39 @@ private native void nativeLoadDartLibrary(
10081012 @ NonNull String abi ,
10091013 @ NonNull String soPath );
10101014
1011-
10121015 /**
1013- * Specifies a new AssetManager that has access to the dynamic feature's assets in addition
1014- * to the base module's assets.
1016+ * Specifies a new AssetManager that has access to the dynamic feature's assets in addition to the
1017+ * base module's assets.
10151018 *
1016- * assetBundlePath is the subdirectory that the flutter assets are stored in. The typical
1017- * value is `flutter_assets`.
1019+ * <p> assetBundlePath is the subdirectory that the flutter assets are stored in. The typical value
1020+ * is `flutter_assets`.
10181021 */
10191022 @ UiThread
10201023 public void updateAssetManager (
1021- @ NonNull AssetManager assetManager ,
1022- @ NonNull String assetBundlePath
1023- ) {
1024+ @ NonNull AssetManager assetManager , @ NonNull String assetBundlePath ) {
10241025 ensureRunningOnMainThread ();
10251026 ensureAttachedToNative ();
10261027 nativeUpdateAssetManager (nativePlatformViewId , assetManager , assetBundlePath );
10271028 }
1029+
10281030 private native void nativeUpdateAssetManager (
10291031 long nativePlatformViewId ,
10301032 @ NonNull AssetManager assetManager ,
1031- @ NonNull String assetBundlePath
1032- );
1033+ @ NonNull String assetBundlePath );
10331034
10341035 // Called when an install encounters a failure during the Android portion of installing a module.
10351036 // When transient is false, new attempts to install will automatically result in same error in
10361037 // dart before the request is passed to Android.
10371038 @ SuppressWarnings ("unused" )
10381039 @ UiThread
1039- public void dynamicFeatureInstallFailure (@ NonNull String moduleName , int loadingUnitId , @ NonNull String error , boolean trans ) {
1040+ public void dynamicFeatureInstallFailure (
1041+ @ NonNull String moduleName , int loadingUnitId , @ NonNull String error , boolean trans ) {
10401042 ensureRunningOnMainThread ();
10411043 nativeDynamicFeatureInstallFailure (moduleName , loadingUnitId , error , trans );
10421044 }
1043- private native void nativeDynamicFeatureInstallFailure (@ NonNull String moduleName , int loadingUnitId , @ NonNull String error , boolean trans );
1045+
1046+ private native void nativeDynamicFeatureInstallFailure (
1047+ @ NonNull String moduleName , int loadingUnitId , @ NonNull String error , boolean trans );
10441048
10451049 // ----- End Dynamic Features Support ----
10461050
0 commit comments