Move things around

This commit is contained in:
topjohnwu
2022-05-22 19:36:47 -07:00
parent c8492b0c58
commit dfa36fb25d
4 changed files with 10 additions and 12 deletions
@@ -37,7 +37,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public Activity instantiateActivity(ClassLoader cl, String className, Intent intent)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
if (receiver != null)
return receiver.instantiateActivity(DelegateClassLoader.cl, className, intent);
return receiver.instantiateActivity(DynLoad.activeClassLoader, className, intent);
return create(className, DownloadActivity.class);
}
@@ -45,7 +45,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public BroadcastReceiver instantiateReceiver(ClassLoader cl, String className, Intent intent)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
if (receiver != null)
return receiver.instantiateReceiver(DelegateClassLoader.cl, className, intent);
return receiver.instantiateReceiver(DynLoad.activeClassLoader, className, intent);
return create(className, DummyReceiver.class);
}
@@ -53,7 +53,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public Service instantiateService(ClassLoader cl, String className, Intent intent)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
if (receiver != null)
return receiver.instantiateService(DelegateClassLoader.cl, className, intent);
return receiver.instantiateService(DynLoad.activeClassLoader, className, intent);
return create(className, DummyService.class);
}
@@ -61,7 +61,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public ContentProvider instantiateProvider(ClassLoader cl, String className)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
if (receiver != null)
return receiver.instantiateProvider(DelegateClassLoader.cl, className);
return receiver.instantiateProvider(DynLoad.activeClassLoader, className);
return create(className, DummyProvider.class);
}
@@ -69,7 +69,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
throws IllegalAccessException, InstantiationException {
try {
// noinspection unchecked
return (T) DelegateClassLoader.cl.loadClass(name).newInstance();
return (T) DynLoad.activeClassLoader.loadClass(name).newInstance();
} catch (ClassNotFoundException e) {
return fallback.newInstance();
}