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

Commit c771e7e8 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add @NonNull annotation to getDecorView()

The function Window::getDecorView() cannot return null, because the view
is being constructed in the case where it actually is null. Therefore,
annotate the method with @NonNull.

Test: no functional change
Change-Id: I1a350e0af8f314f696bb1acde225633abb935a42
parent 23621825
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1657,7 +1657,7 @@ public abstract class Window {
     *
     * @return Returns the top-level window decor view.
     */
    public abstract View getDecorView();
    public abstract @NonNull View getDecorView();

    /**
     * Retrieve the current decor view, but only if it has already been created;
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.WindowManager.LayoutParams.*;

import android.annotation.NonNull;
import android.app.ActivityManager;
import android.app.SearchManager;
import android.os.UserHandle;
@@ -2066,7 +2067,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    }

    @Override
    public final View getDecorView() {
    public final @NonNull View getDecorView() {
        if (mDecor == null || mForceDecorInstall) {
            installDecor();
        }