Commit e9af7739 authored by topjohnwu's avatar topjohnwu

Remove usage of AndroidX CoreComponentFactory

parent eadf6e8b
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
android:extractNativeLibs="true" android:extractNativeLibs="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:multiArch="true" android:multiArch="true"
tools:remove="android:appComponentFactory"
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning"> tools:ignore="UnusedAttribute,GoogleAppIndexingWarning">
<activity <activity
......
...@@ -150,9 +150,13 @@ public class DynLoad { ...@@ -150,9 +150,13 @@ public class DynLoad {
// Create the receiver component factory // Create the receiver component factory
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && componentFactory != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && componentFactory != null) {
Object factory = cl.loadClass(appInfo.appComponentFactory).newInstance();
var delegate = (DelegateComponentFactory) componentFactory; var delegate = (DelegateComponentFactory) componentFactory;
delegate.receiver = (AppComponentFactory) factory; if (appInfo.appComponentFactory == null) {
delegate.receiver = new AppComponentFactory();
} else {
Object factory = cl.loadClass(appInfo.appComponentFactory).newInstance();
delegate.receiver = (AppComponentFactory) factory;
}
} }
activeClassLoader = cl; activeClassLoader = cl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment