summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorScott Kennedy <skennedy@google.com>2015-02-11 15:33:10 -0800
committerScott Kennedy <skennedy@google.com>2015-02-11 15:33:10 -0800
commitc051955392840cb94bd6f0b2a8107a48d2ffc8b0 (patch)
tree6a8b7599542854ee5a22b78d6454fd7e6c5d8dfd /core/java/android
parente29c45adda7496612dd85e487d2b6917efd3e30e (diff)
downloadframeworks_base-c051955392840cb94bd6f0b2a8107a48d2ffc8b0.zip
frameworks_base-c051955392840cb94bd6f0b2a8107a48d2ffc8b0.tar.gz
frameworks_base-c051955392840cb94bd6f0b2a8107a48d2ffc8b0.tar.bz2
Mark findViewById(int) @Nullable
Change-Id: I9bf7c08a896bd9c28400ff832179abc579fd502f
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/Activity.java2
-rw-r--r--core/java/android/app/Dialog.java2
-rw-r--r--core/java/android/app/Fragment.java1
-rw-r--r--core/java/android/app/FragmentManager.java2
-rw-r--r--core/java/android/service/dreams/DreamService.java2
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/android/view/Window.java1
7 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index e95fbfc..aa1c70e 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -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);
}
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 70e6e5a..a3662b2 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -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);
}
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index ab28d95..f319309 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -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");
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index ccceef4..afdc917 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -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();
}
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index 3c57dda..fa5ac42 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -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);
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 04aafc1..ad5d651 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -17109,6 +17109,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param id The id to search for.
* @return The view that has the given id in the hierarchy or null
*/
+ @Nullable
public final View findViewById(int id) {
if (id < 0) {
return null;
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 1456b52..8964862 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -984,6 +984,7 @@ public abstract class Window {
*
* @return The view if found or null otherwise.
*/
+ @Nullable
public View findViewById(int id) {
return getDecorView().findViewById(id);
}