libbinder: Return UNEXPECTED_NULL when appropriate
Return a meaningful and consistent error code when libbinder encounters
a null reference that it didn't expect. This allows us to detect these
situations and cause a corresponding NullPointerException to be thrown
on the remote callsite.
While here, consolidate places we read vector<T> from a parcel into a
single templated version. This dramatically reduces code duplication.
Test: Integration tests asserting that vectors serialize correctly
passes. Integration test asserting that we throw
NullPointerException on seeing a null reference also passes.
(cherry picked from commit 4db672ddccb02b2bd70ddb4812c00a5060174c93)
1 file changed