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

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

Mark findViewById(int) @Nullable

Change-Id: I9bf7c08a896bd9c28400ff832179abc579fd502f
parent e29c45ad
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -743,6 +743,7 @@ public class Activity extends ContextThemeWrapper
    final FragmentManagerImpl mFragments = new FragmentManagerImpl();
    final FragmentContainer mContainer = new FragmentContainer() {
        @Override
        @Nullable
        public View findViewById(int id) {
            return Activity.this.findViewById(id);
        }
@@ -2068,6 +2069,7 @@ public class Activity extends ContextThemeWrapper
     *
     * @return The view if found or null otherwise.
     */
    @Nullable
    public View findViewById(int id) {
        return getWindow().findViewById(id);
    }
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.app;

import com.android.internal.app.WindowDecorActionBar;

import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
@@ -476,6 +477,7 @@ public class Dialog implements DialogInterface, Window.Callback,
     * @param id the identifier of the view to find
     * @return The view with the given id or null.
     */
    @Nullable
    public View findViewById(int id) {
        return mWindow.findViewById(id);
    }
+1 −0
Original line number Diff line number Diff line
@@ -2008,6 +2008,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        mChildFragmentManager = new FragmentManagerImpl();
        mChildFragmentManager.attachActivity(mActivity, new FragmentContainer() {
            @Override
            @Nullable
            public View findViewById(int id) {
                if (mView == null) {
                    throw new IllegalStateException("Fragment does not have a view");
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorListenerAdapter;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
@@ -394,6 +395,7 @@ final class FragmentManagerState implements Parcelable {
 * Callbacks from FragmentManagerImpl to its container.
 */
interface FragmentContainer {
    @Nullable
    public View findViewById(int id);
    public boolean hasView();
}
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.service.dreams;
import java.io.FileDescriptor;
import java.io.PrintWriter;

import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.AlarmManager;
@@ -442,6 +443,7 @@ public class DreamService extends Service implements Window.Callback {
     *
     * @return The view if found or null otherwise.
     */
    @Nullable
    public View findViewById(int id) {
        return getWindow().findViewById(id);
    }
Loading