commit | 7d8ed27e2e1214aa615065b28f4fef0f1c350e44 | [log] [tgz] |
---|---|---|
author | kumarashishg <kumarashishg@google.com> | Thu Aug 03 12:01:29 2023 +0000 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Thu Aug 03 15:41:28 2023 +0000 |
tree | 14d7ad45e4f429606545bd089740e6ba6d93ef42 | |
parent | 50eda5e3ab1653236370e8e666de8062c67cf47a [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) Merged-In: I2917c8331b6d56caaa9a6479bcd9a2d089f5f503 Change-Id: I2917c8331b6d56caaa9a6479bcd9a2d089f5f503
diff --git a/core/java/android/hardware/usb/UsbConfiguration.java b/core/java/android/hardware/usb/UsbConfiguration.java index 66269cb..b25f47b 100644 --- a/core/java/android/hardware/usb/UsbConfiguration.java +++ b/core/java/android/hardware/usb/UsbConfiguration.java
@@ -172,7 +172,8 @@ 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;