Parcel: add new methods for interface list/array
New methods are to write a list/array of interface objects and to read them again. Basically these methods are quite similar to those for IBinder objects. But when reading IInterface objects, we need to create an array of the exact type and need a way of converting IBinder into IInterface value. Two functional interfaces (newArray and asInterface) are just like while Parcelable.Creator does. We could pass "Stub" class which is generated by the AIDL compiler and use reflection to create a typed array instance and call `asInterface` method. But rather than relying on reflection, passing `IMyInterface[]::new` and `IMyInterface.Stub::asInterface` would be simple enough to use. Bug: 205195901 Test: atest -d android.os.cts.ParcelTest Change-Id: I275db9ebf52d3b9713fa105d81da3a1d289d96a8
Loading
Please register or sign in to comment