Small cleanup in DeferredComponentManager.java‎ (#178585)

this change : 
- fixes the link in docs that is specified as a text
- removes `unnecessary` `public/abstract` modifiers in a `public
interface`

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matt Boetger <matt.boetger@gmail.com>
Co-authored-by: Matt Boetger <boetger@google.com>
This commit is contained in:
Mohellebi abdessalem 2025-11-19 02:32:49 +01:00 committed by GitHub
parent 1e11a4ce0a
commit 5e94425aef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,8 @@ import io.flutter.embedding.engine.systemchannels.DeferredComponentChannel;
*
* <p>DeferredComponentManager handles the embedder/Android level tasks of downloading, installing,
* and loading Dart deferred libraries. A typical code-flow begins with a Dart call to loadLibrary()
* on deferred imported library. See https://dart.dev/guides/language/language-tour#deferred-loading
* on deferred imported library. See <a
* href="https://dart.dev/guides/language/language-tour#deferred-loading">https://dart.dev/guides/language/language-tour#deferred-loading</a>
* This call retrieves a unique identifier called the loading unit id, which is assigned by
* gen_snapshot during compilation. The loading unit id is passed down through the engine and
* invokes installDeferredComponent. Once the component is downloaded, loadAssets and
@ -45,7 +46,7 @@ public interface DeferredComponentManager {
* is fully initialized, this method should be called to provide the FlutterJNI instance to use
* for use in loadDartLibrary and loadAssets.
*/
public abstract void setJNI(FlutterJNI flutterJNI);
void setJNI(FlutterJNI flutterJNI);
/**
* Sets the DeferredComponentChannel system channel to handle the framework API to directly call
@ -66,7 +67,7 @@ public interface DeferredComponentManager {
* DeferredComponentChannel.completeInstallSuccess} while errors and failures should call {@link
* DeferredComponentChannel.completeInstallError}.
*/
public abstract void setDeferredComponentChannel(DeferredComponentChannel channel);
void setDeferredComponentChannel(DeferredComponentChannel channel);
/**
* Request that the deferred component be downloaded and installed.
@ -121,7 +122,7 @@ public interface DeferredComponentManager {
* an associated Dart deferred library, loading unit id should a negative value and
* componentName must be non-null.
*/
public abstract void installDeferredComponent(int loadingUnitId, String componentName);
void installDeferredComponent(int loadingUnitId, String componentName);
/**
* Gets the current state of the installation session corresponding to the specified loadingUnitId
@ -156,7 +157,7 @@ public interface DeferredComponentManager {
* @param loadingUnitId The unique identifier associated with a Dart deferred library.
* @param componentName The deferred component name as defined in bundle_config.yaml.
*/
public abstract String getDeferredComponentInstallState(int loadingUnitId, String componentName);
String getDeferredComponentInstallState(int loadingUnitId, String componentName);
/**
* Extract and load any assets and resources from the deferred component for use by Flutter.
@ -178,7 +179,7 @@ public interface DeferredComponentManager {
* @param loadingUnitId The unique identifier associated with a Dart deferred library.
* @param componentName The deferred component name as defined in bundle_config.yaml.
*/
public abstract void loadAssets(int loadingUnitId, String componentName);
void loadAssets(int loadingUnitId, String componentName);
/**
* Load the .so shared library file into the Dart VM.
@ -205,7 +206,7 @@ public interface DeferredComponentManager {
* Play Store deferred component delivery, this name corresponds to the root name on the
* installed APKs in which to search for the desired shared library .so file.
*/
public abstract void loadDartLibrary(int loadingUnitId, String componentName);
void loadDartLibrary(int loadingUnitId, String componentName);
/**
* Request that the specified component be uninstalled.
@ -229,10 +230,10 @@ public interface DeferredComponentManager {
* @param loadingUnitId The unique identifier associated with a Dart deferred library.
* @param componentName The deferred component name as defined in bundle_config.yaml.
*/
public abstract boolean uninstallDeferredComponent(int loadingUnitId, String componentName);
boolean uninstallDeferredComponent(int loadingUnitId, String componentName);
/**
* Cleans up and releases resources. This object is no longer usable after calling this method.
*/
public abstract void destroy();
void destroy();
}