diff options
| author | 2018-01-26 15:10:42 -0800 | |
|---|---|---|
| committer | 2018-01-26 15:10:42 -0800 | |
| commit | 0308e6a21669ca1e5f11bfe9c8e33b62b29fc022 (patch) | |
| tree | feaccfd0597cfcf27ac517f205f8676f96c22216 | |
| parent | df27ca11010d4819d15a1429a57e05dee3954459 (diff) | |
Comment more on component callback order for N+ OS
This CL attempts to clarify that just having a ContentProvider does
not necessarily mean ContentProvider#onCreate() is always called
before Application#onCreate() on Android N and later devices because
of direct boot.
Fix: 67559645
Test: make -j doc-comment-check-docs
Change-Id: I33b7cda42146333f48fb445027f5d31f3c5af5b6
| -rw-r--r-- | core/java/android/app/Application.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/app/Application.java b/core/java/android/app/Application.java index 5822f5c8f6c1..5a739ea6d3e4 100644 --- a/core/java/android/app/Application.java +++ b/core/java/android/app/Application.java @@ -86,11 +86,21 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 { /** * Called when the application is starting, before any activity, service, * or receiver objects (excluding content providers) have been created. - * Implementations should be as quick as possible (for example using + * + * <p>Implementations should be as quick as possible (for example using * lazy initialization of state) since the time spent in this function * directly impacts the performance of starting the first activity, - * service, or receiver in a process. - * If you override this method, be sure to call super.onCreate(). + * service, or receiver in a process.</p> + * + * <p>If you override this method, be sure to call {@code super.onCreate()}.</p> + * + * <p class="note">Be aware that direct boot may also affect callback order on + * Android {@link android.os.Build.VERSION_CODES#N} and later devices. + * Until the user unlocks the device, only direct boot aware components are + * allowed to run. You should consider that all direct boot unaware + * components, including such {@link android.content.ContentProvider}, are + * disabled until user unlock happens, especially when component callback + * order matters.</p> */ @CallSuper public void onCreate() { |