Merge "Adjust Class<T> parameter bounds in new Bundle APIs"
This commit is contained in:
@@ -29570,7 +29570,7 @@ package android.os {
|
|||||||
method @Deprecated @Nullable public android.os.Parcelable[] getParcelableArray(@Nullable String);
|
method @Deprecated @Nullable public android.os.Parcelable[] getParcelableArray(@Nullable String);
|
||||||
method @Nullable public <T> T[] getParcelableArray(@Nullable String, @NonNull Class<T>);
|
method @Nullable public <T> T[] getParcelableArray(@Nullable String, @NonNull Class<T>);
|
||||||
method @Deprecated @Nullable public <T extends android.os.Parcelable> java.util.ArrayList<T> getParcelableArrayList(@Nullable String);
|
method @Deprecated @Nullable public <T extends android.os.Parcelable> java.util.ArrayList<T> getParcelableArrayList(@Nullable String);
|
||||||
method @Nullable public <T> java.util.ArrayList<T> getParcelableArrayList(@Nullable String, @NonNull Class<T>);
|
method @Nullable public <T> java.util.ArrayList<T> getParcelableArrayList(@Nullable String, @NonNull Class<? extends T>);
|
||||||
method @Deprecated @Nullable public java.io.Serializable getSerializable(@Nullable String);
|
method @Deprecated @Nullable public java.io.Serializable getSerializable(@Nullable String);
|
||||||
method @Nullable public <T extends java.io.Serializable> T getSerializable(@Nullable String, @NonNull Class<T>);
|
method @Nullable public <T extends java.io.Serializable> T getSerializable(@Nullable String, @NonNull Class<T>);
|
||||||
method public short getShort(String);
|
method public short getShort(String);
|
||||||
@@ -29579,7 +29579,7 @@ package android.os {
|
|||||||
method @Nullable public android.util.Size getSize(@Nullable String);
|
method @Nullable public android.util.Size getSize(@Nullable String);
|
||||||
method @Nullable public android.util.SizeF getSizeF(@Nullable String);
|
method @Nullable public android.util.SizeF getSizeF(@Nullable String);
|
||||||
method @Deprecated @Nullable public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(@Nullable String);
|
method @Deprecated @Nullable public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(@Nullable String);
|
||||||
method @Nullable public <T> android.util.SparseArray<T> getSparseParcelableArray(@Nullable String, @NonNull Class<T>);
|
method @Nullable public <T> android.util.SparseArray<T> getSparseParcelableArray(@Nullable String, @NonNull Class<? extends T>);
|
||||||
method @Nullable public java.util.ArrayList<java.lang.String> getStringArrayList(@Nullable String);
|
method @Nullable public java.util.ArrayList<java.lang.String> getStringArrayList(@Nullable String);
|
||||||
method public boolean hasFileDescriptors();
|
method public boolean hasFileDescriptors();
|
||||||
method public void putAll(android.os.Bundle);
|
method public void putAll(android.os.Bundle);
|
||||||
|
|||||||
@@ -1453,7 +1453,7 @@ public class BaseBundle {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Nullable
|
@Nullable
|
||||||
<T> ArrayList<T> getArrayList(@Nullable String key, @NonNull Class<T> clazz) {
|
<T> ArrayList<T> getArrayList(@Nullable String key, @NonNull Class<? extends T> clazz) {
|
||||||
unparcel();
|
unparcel();
|
||||||
try {
|
try {
|
||||||
return getValue(key, ArrayList.class, requireNonNull(clazz));
|
return getValue(key, ArrayList.class, requireNonNull(clazz));
|
||||||
|
|||||||
@@ -1059,7 +1059,8 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
|
|||||||
@SuppressLint("NullableCollection")
|
@SuppressLint("NullableCollection")
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Nullable
|
@Nullable
|
||||||
public <T> ArrayList<T> getParcelableArrayList(@Nullable String key, @NonNull Class<T> clazz) {
|
public <T> ArrayList<T> getParcelableArrayList(@Nullable String key,
|
||||||
|
@NonNull Class<? extends T> clazz) {
|
||||||
// The reason for not using <T extends Parcelable> is because the caller could provide a
|
// The reason for not using <T extends Parcelable> is because the caller could provide a
|
||||||
// super class to restrict the children that doesn't implement Parcelable itself while the
|
// super class to restrict the children that doesn't implement Parcelable itself while the
|
||||||
// children do, more details at b/210800751 (same reasoning applies here).
|
// children do, more details at b/210800751 (same reasoning applies here).
|
||||||
@@ -1107,7 +1108,7 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Nullable
|
@Nullable
|
||||||
public <T> SparseArray<T> getSparseParcelableArray(@Nullable String key,
|
public <T> SparseArray<T> getSparseParcelableArray(@Nullable String key,
|
||||||
@NonNull Class<T> clazz) {
|
@NonNull Class<? extends T> clazz) {
|
||||||
// The reason for not using <T extends Parcelable> is because the caller could provide a
|
// The reason for not using <T extends Parcelable> is because the caller could provide a
|
||||||
// super class to restrict the children that doesn't implement Parcelable itself while the
|
// super class to restrict the children that doesn't implement Parcelable itself while the
|
||||||
// children do, more details at b/210800751 (same reasoning applies here).
|
// children do, more details at b/210800751 (same reasoning applies here).
|
||||||
|
|||||||
Reference in New Issue
Block a user