diff options
author | Bernardo Rufino <brufino@google.com> | 2021-12-07 20:01:45 +0000 |
---|---|---|
committer | Bernardo Rufino <brufino@google.com> | 2021-12-15 18:21:38 +0000 |
commit | 54298877a7406e73b9f746f59751614a74a2e500 (patch) | |
tree | 9a4722b27528e0f6497a05ff496900285f21e9b4 /framework/java/android/bluetooth/BluetoothHeadsetClientCall.java | |
parent | c28a013414f9492750009623a18ce20789603e95 (diff) |
Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadsetClientCall.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHeadsetClientCall.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java index 3f1ef84612..5ff76cbf1d 100644 --- a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java +++ b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java @@ -293,7 +293,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable, Attributabl new Parcelable.Creator<BluetoothHeadsetClientCall>() { @Override public BluetoothHeadsetClientCall createFromParcel(Parcel in) { - return new BluetoothHeadsetClientCall((BluetoothDevice) in.readParcelable(null), + return new BluetoothHeadsetClientCall((BluetoothDevice) in.readParcelable(null, android.bluetooth.BluetoothDevice.class), in.readInt(), UUID.fromString(in.readString()), in.readInt(), in.readString(), in.readInt() == 1, in.readInt() == 1, in.readInt() == 1); |