summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkumarashishg <kumarashishg@google.com>2023-08-03 12:01:29 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-11 17:13:36 +0000
commite7c54eb4eb697d6445d77bc1978cca6821294682 (patch)
tree8075cb4f212344ac44dd56c61023ac449660545c
parenta16f46f4bfcba55d931c0b6bd9d57580cab674a2 (diff)
Use type safe API of readParcelableArray
Bug: 291299076 Test: Build and flash the device and check if it throws exception for non UsbInterface object Test: atest CtsUsbManagerTestCases (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:85d7e6712a9eeeed3bdd68ea3c3862c7e88bfe70) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7d8ed27e2e1214aa615065b28f4fef0f1c350e44) Merged-In: I2917c8331b6d56caaa9a6479bcd9a2d089f5f503 Change-Id: I2917c8331b6d56caaa9a6479bcd9a2d089f5f503
-rw-r--r--core/java/android/hardware/usb/UsbConfiguration.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/hardware/usb/UsbConfiguration.java b/core/java/android/hardware/usb/UsbConfiguration.java
index 66269cb772f8..b25f47b11532 100644
--- a/core/java/android/hardware/usb/UsbConfiguration.java
+++ b/core/java/android/hardware/usb/UsbConfiguration.java
@@ -172,7 +172,8 @@ public class UsbConfiguration implements Parcelable {
String name = in.readString();
int attributes = in.readInt();
int maxPower = in.readInt();
- Parcelable[] interfaces = in.readParcelableArray(UsbInterface.class.getClassLoader());
+ Parcelable[] interfaces = in.readParcelableArray(
+ UsbInterface.class.getClassLoader(), UsbInterface.class);
UsbConfiguration configuration = new UsbConfiguration(id, name, attributes, maxPower);
configuration.setInterfaces(interfaces);
return configuration;