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

Commit b515a4b

Browse files
committed
Java formatting
formatting
1 parent d2eccae commit b515a4b

File tree

4 files changed

+222
-132
lines changed

4 files changed

+222
-132
lines changed

shell/platform/android/io/flutter/app/FlutterApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
package io.flutter.app;
66

77
import android.app.Activity;
8-
import android.content.Context;
98
import android.app.Application;
9+
import android.content.Context;
1010
import androidx.annotation.CallSuper;
1111
import com.google.android.play.core.splitcompat.SplitCompat;
1212
import io.flutter.FlutterInjector;

shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
@@ -1010,37 +1014,38 @@ private native void nativeLoadDartLibrary(
10101014

10111015

10121016
/**
1013-
* Specifies a new AssetManager that has access to the dynamic feature's assets in addition
1014-
* to the base module's assets.
1017+
* Specifies a new AssetManager that has access to the dynamic feature's assets in addition to the
1018+
* base module's assets.
10151019
*
1016-
* assetBundlePath is the subdirectory that the flutter assets are stored in. The typical
1017-
* value is `flutter_assets`.
1020+
* <p>assetBundlePath is the subdirectory that the flutter assets are stored in. The typical value
1021+
* is `flutter_assets`.
10181022
*/
10191023
@UiThread
10201024
public void updateAssetManager(
1021-
@NonNull AssetManager assetManager,
1022-
@NonNull String assetBundlePath
1023-
) {
1025+
@NonNull AssetManager assetManager, @NonNull String assetBundlePath) {
10241026
ensureRunningOnMainThread();
10251027
ensureAttachedToNative();
10261028
nativeUpdateAssetManager(nativePlatformViewId, assetManager, assetBundlePath);
10271029
}
1030+
10281031
private native void nativeUpdateAssetManager(
10291032
long nativePlatformViewId,
10301033
@NonNull AssetManager assetManager,
1031-
@NonNull String assetBundlePath
1032-
);
1034+
@NonNull String assetBundlePath);
10331035

10341036
// Called when an install encounters a failure during the Android portion of installing a module.
10351037
// When transient is false, new attempts to install will automatically result in same error in
10361038
// dart before the request is passed to Android.
10371039
@SuppressWarnings("unused")
10381040
@UiThread
1039-
public void dynamicFeatureInstallFailure(@NonNull String moduleName, int loadingUnitId, @NonNull String error, boolean trans) {
1041+
public void dynamicFeatureInstallFailure(
1042+
@NonNull String moduleName, int loadingUnitId, @NonNull String error, boolean trans) {
10401043
ensureRunningOnMainThread();
10411044
nativeDynamicFeatureInstallFailure(moduleName, loadingUnitId, error, trans);
10421045
}
1043-
private native void nativeDynamicFeatureInstallFailure(@NonNull String moduleName, int loadingUnitId, @NonNull String error, boolean trans);
1046+
1047+
private native void nativeDynamicFeatureInstallFailure(
1048+
@NonNull String moduleName, int loadingUnitId, @NonNull String error, boolean trans);
10441049

10451050
// ----- End Dynamic Features Support ----
10461051

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

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,43 @@
1010
/**
1111
* Basic interface that handles downloading and loading of dynamic features.
1212
*
13-
* The Flutter default implementation is PlayStoreDynamicFeatureManager.
13+
* <p>The Flutter default implementation is PlayStoreDynamicFeatureManager.
1414
*
15-
* The methods here may be called independently or in a sequence one after the other to perform
16-
* a full install cycle of download, load assets, and load dart libs.
15+
* <p>The methods here may be called independently or in a sequence one after the other to perform a
16+
* full install cycle of download, load assets, and load dart libs.
1717
*
18-
* A dynamic feature module is uniquely identified by a module name. Each feature module may
18+
* <p>A dynamic feature module is uniquely identified by a module name. Each feature module may
1919
* contain one or more loading units, uniquely identified by the loading unit ID.
2020
*/
2121
public interface DynamicFeatureManager {
2222
/**
2323
* Request that the feature module be downloaded and installed.
24-
*
25-
* This method is called when loadLibrary() is called on a dart library.
26-
* Upon completion of download, loadAssets and loadDartLibrary should
27-
* be called to complete the dynamic feature load process.
24+
*
25+
* <p>This method is called when loadLibrary() is called on a dart library. Upon completion of
26+
* download, loadAssets and loadDartLibrary should be called to complete the dynamic feature load
27+
* process.
2828
*/
2929
public abstract void downloadFeature(String moduleName, int loadingUnitId);
3030

3131
/**
3232
* Extract and load any assets and resources from the module for use by Flutter.
3333
*
34-
* Assets shoud be loaded before the dart library is loaded, as successful loading
35-
* of the dart loading unit indicates the dynamic feature is fully loaded.
34+
* <p>Assets shoud be loaded before the dart library is loaded, as successful loading of the dart
35+
* loading unit indicates the dynamic feature is fully loaded.
3636
*
37-
* Depending on the structure of the feature module, there may or may not be assets
38-
* to extract.
37+
* <p>Depending on the structure of the feature module, there may or may not be assets to extract.
3938
*/
4039
public abstract void loadAssets(String moduleName, int loadingUnitId);
4140

4241
/**
4342
* Load the .so shared library file into the Dart VM.
44-
*
45-
* Upon successful load of the dart library, the feature corresponding to the
46-
* loadingUnitId is considered finished loading, and the dart future completes.
47-
* Developers are expected to begin using symbols and assets from the feature
48-
* module after completion.
43+
*
44+
* <p>Upon successful load of the dart library, the feature corresponding to the loadingUnitId is
45+
* considered finished loading, and the dart future completes. Developers are expected to begin
46+
* using symbols and assets from the feature module after completion.
4947
*/
5048
public abstract void loadDartLibrary(String moduleName, int loadingUnitId);
5149

52-
/**
53-
* Uninstall the specified feature module.
54-
*/
50+
/** Uninstall the specified feature module. */
5551
public abstract void uninstallFeature(String moduleName, int loadingUnitId);
5652
}

0 commit comments

Comments
 (0)