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

Commit db5fd42a authored by Scott Kennedy's avatar Scott Kennedy
Browse files

Mark the root argument as @Nullable in LayoutInflater#inflate()

Change-Id: I174ff06268ece7a47ce22c98eb0377fa1b5a4a36
parent 069db2ae
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.view;

import android.annotation.Nullable;
import android.graphics.Canvas;
import android.os.Handler;
import android.os.Message;
@@ -367,7 +368,7 @@ public abstract class LayoutInflater {
     *         this is the root View; otherwise it is the root of the inflated
     *         XML file.
     */
    public View inflate(int resource, ViewGroup root) {
    public View inflate(int resource, @Nullable ViewGroup root) {
        return inflate(resource, root, root != null);
    }

@@ -387,7 +388,7 @@ public abstract class LayoutInflater {
     *         this is the root View; otherwise it is the root of the inflated
     *         XML file.
     */
    public View inflate(XmlPullParser parser, ViewGroup root) {
    public View inflate(XmlPullParser parser, @Nullable ViewGroup root) {
        return inflate(parser, root, root != null);
    }

@@ -408,7 +409,7 @@ public abstract class LayoutInflater {
     *         attachToRoot is true, this is root; otherwise it is the root of
     *         the inflated XML file.
     */
    public View inflate(int resource, ViewGroup root, boolean attachToRoot) {
    public View inflate(int resource, @Nullable ViewGroup root, boolean attachToRoot) {
        final Resources res = getContext().getResources();
        if (DEBUG) {
            Log.d(TAG, "INFLATING from resource: \"" + res.getResourceName(resource) + "\" ("
@@ -445,7 +446,7 @@ public abstract class LayoutInflater {
     *         attachToRoot is true, this is root; otherwise it is the root of
     *         the inflated XML file.
     */
    public View inflate(XmlPullParser parser, ViewGroup root, boolean attachToRoot) {
    public View inflate(XmlPullParser parser, @Nullable ViewGroup root, boolean attachToRoot) {
        synchronized (mConstructorArgs) {
            Trace.traceBegin(Trace.TRACE_TAG_VIEW, "inflate");