When using the chromium linker on Android, our main APK uses several methods in org.chromium.base.LibraryLoader and org.chromium.base.Linker to load native libraries into the current process.
Now that we are splitting Chrome into several parts (e.g. one main Chrome apk + at least one "feature module" APK, using app bundles), it would be convenient to provide something like org.chromium.base.LibraryLoader.loadLibrary() that can be used as a replacement for System.loadLibrary(), but will use the chromium linker when necessary, or fallback to the system one otherwise.
This would make loading native code from the feature module's dex bytecode trivial under all circumstances.
At the moment, one has to essentially do something like this:
if (LibraryLoader.useCrazyLinker()) {
Linker.loadLibrary("foo");
} else {
System.loadLibrary("foo");
}
Plus some additional steps to ensure that the feature module APK path is known to the crazy linker (in order to load the native libraries directly from it without extraction).
The new LibraryLoader.loadLibrary() would handle all this complexity and always do the right thing.