Make Parcel::readOutVectorSizeWithCheck public

There are still a few cases of manually defined binder interfaces and
they need to check the size of the vectors against something. That
something is defined here with kMaxAllocationSize.

Test: libsensorserviceaidl_fuzzer
Bug: None
Change-Id: Ie33c74609f9a12212c2e02c81f76477d607a17c0
diff --git a/libs/binder/include/binder/Parcel.h b/libs/binder/include/binder/Parcel.h
index e28d374..eca084f 100644
--- a/libs/binder/include/binder/Parcel.h
+++ b/libs/binder/include/binder/Parcel.h
@@ -538,6 +538,12 @@
     template<typename T>
     status_t            resizeOutVector(std::unique_ptr<std::vector<T>>* val) const __attribute__((deprecated("use std::optional version instead")));
 
+    // Retrieve the size of an out vector and check against internal limits to
+    // the size.
+    // The returned size may be negative so caller must handle appropriately.
+    // elemSize is the size of the element on the wire, if unknown use `1`.
+    status_t readOutVectorSizeWithCheck(size_t elmSize, int32_t* size) const;
+
     // Like Parcel.java's readExceptionCode().  Reads the first int32
     // off of a Parcel's header, returning 0 or the negative error
     // code on exceptions, but also deals with skipping over rich
@@ -639,8 +645,6 @@
     status_t            flattenBinder(const sp<IBinder>& binder);
     status_t            unflattenBinder(sp<IBinder>* out) const;
 
-    status_t readOutVectorSizeWithCheck(size_t elmSize, int32_t* size) const;
-
     template<class T>
     status_t            readAligned(T *pArg) const;