summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2019-04-11 20:46:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-11 20:46:24 +0000
commit618940c95fa6dbc282aed59b82ff06c21bf05927 (patch)
tree91e5825389b41e5aff00e70741f9345f5895080d
parent44058c6efa36484fbbbaa6a5259769733a1886d6 (diff)
parent1fe58ea321d322292ac557da004b37f7c0110c68 (diff)
Merge "Update AppComponentFactory.instantiateClassLoader docs" into qt-dev
-rw-r--r--core/java/android/app/AppComponentFactory.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/core/java/android/app/AppComponentFactory.java b/core/java/android/app/AppComponentFactory.java
index 2cec7f0fc323..5b02817b7bfb 100644
--- a/core/java/android/app/AppComponentFactory.java
+++ b/core/java/android/app/AppComponentFactory.java
@@ -35,11 +35,22 @@ import android.content.pm.ApplicationInfo;
public class AppComponentFactory {
/**
- * Allows application to override the creation of the default class loader.
- * This can be used to perform things such as dependency injection or setting up
- * a custom class loader hierarchy.
+ * Selects the class loader which will be used by the platform to instantiate app components.
+ * <p>
+ * The default implementation of this method returns the {@code cl} parameter unchanged.
+ * Applications can override this method to set up a custom class loader or a custom class
+ * loader hierarchy and return it to the platform.
+ * <p>
+ * The method is a hook invoked before any application components are instantiated or the
+ * application Context is initialized. It is intended to allow the application's classes to
+ * be loaded from a different source than the base/split APK(s).
+ * <p>
+ * The default class loader {@code cl} is created by the platform and used to load the
+ * application's base or split APK(s). Its parent is typically the boot class loader, unless
+ * running under instrumentation. Its classname is configurable using the
+ * {@link android.R.attr#classLoader} manifest attribute.
*
- * @param cl The default classloader instantiated by platform.
+ * @param cl The default class loader created by the platform.
* @param aInfo Information about the application being loaded.
*/
public @NonNull ClassLoader instantiateClassLoader(@NonNull ClassLoader cl,