diff options
| author | 2023-10-10 10:01:51 -0700 | |
|---|---|---|
| committer | 2023-10-10 13:15:56 -0700 | |
| commit | e8edb9d1fbdbcd9674a3acc2ef253eb3dfecbf43 (patch) | |
| tree | ed4ed23dce13e3466d7eeb9186303363f650050d | |
| parent | 704eb7e583099a903992ce28cb1009db2fa2fb10 (diff) | |
Mark Message.peekData as returning a nullable value.
This API is not currently annotated. This will highlight this
possibility to any callers and hopefully enable better static analysis.
Bug: 274764512
Test: m framework -j
Change-Id: I4b46c828625dd5ccff9d45cb56e5cfaf4c184917
| -rw-r--r-- | core/api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/os/Message.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 7ee12d1c3ae0..acea416976d1 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -33188,7 +33188,7 @@ package android.os { method public static android.os.Message obtain(android.os.Handler, int, Object); method public static android.os.Message obtain(android.os.Handler, int, int, int); method public static android.os.Message obtain(android.os.Handler, int, int, int, Object); - method public android.os.Bundle peekData(); + method @Nullable public android.os.Bundle peekData(); method public void recycle(); method public void sendToTarget(); method public void setAsynchronous(boolean); diff --git a/core/java/android/os/Message.java b/core/java/android/os/Message.java index 72fb4ae03a63..cc184828cc33 100644 --- a/core/java/android/os/Message.java +++ b/core/java/android/os/Message.java @@ -16,6 +16,7 @@ package android.os; +import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.util.TimeUtils; import android.util.proto.ProtoOutputStream; @@ -436,6 +437,7 @@ public final class Message implements Parcelable { * @see #getData() * @see #setData(Bundle) */ + @Nullable public Bundle peekData() { return data; } |