Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0308e6a2 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
parent df27ca11
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -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() {