Remove unused read/write hidl_version functions.
Originally, these were for hwsm, but the version is encoded in
hidl_string as an FQName now instead. I would try to delete hidl_version
entirely since it doesn't make much sense in HidlSupport.h anymore, but
the number of users means that it is hard to move (it is being used to
help manage interfaces).
It's unlikely that these functions will ever be brought back too. Since
hidl_version can be expressed in the HIDL language, it doesn't make
sense as a primitive in the HIDL language.
Bug: N/A
Test: TH
Change-Id: I09f3920c13dfeab08f562e8d57c47507b06961ed
diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp
index 62b1755..f3af124 100644
--- a/transport/HidlBinderSupport.cpp
+++ b/transport/HidlBinderSupport.cpp
@@ -163,20 +163,6 @@
parentOffset + hidl_string::kOffsetOfBuffer);
}
-android::status_t writeToParcel(const hidl_version &version, android::hardware::Parcel& parcel) {
- return parcel.writeUint32(static_cast<uint32_t>(version.get_major()) << 16 | version.get_minor());
-}
-
-hidl_version* readFromParcel(const android::hardware::Parcel& parcel) {
- uint32_t version;
- android::status_t status = parcel.readUint32(&version);
- if (status != OK) {
- return nullptr;
- } else {
- return new hidl_version(version >> 16, version & 0xFFFF);
- }
-}
-
status_t readFromParcel(Status *s, const Parcel& parcel) {
int32_t exception;
status_t status = parcel.readInt32(&exception);
diff --git a/transport/include/hidl/HidlBinderSupport.h b/transport/include/hidl/HidlBinderSupport.h
index a098805..44a56b4 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -28,7 +28,7 @@
#include <hwbinder/Parcel.h>
#include <log/log.h> // TODO(b/65843592): remove. Too many users depending on this transitively.
-// Defines functions for hidl_string, hidl_version, Status, hidl_vec, MQDescriptor,
+// Defines functions for hidl_string, Status, hidl_vec, MQDescriptor,
// etc. to interact with Parcel.
namespace android {
@@ -72,13 +72,6 @@
status_t writeEmbeddedToParcel(const hidl_string &string,
Parcel *parcel, size_t parentHandle, size_t parentOffset);
-// ---------------------- hidl_version
-
-status_t writeToParcel(const hidl_version &version, android::hardware::Parcel& parcel);
-
-// Caller is responsible for freeing the returned object.
-hidl_version* readFromParcel(const android::hardware::Parcel& parcel);
-
// ---------------------- Status
// Bear in mind that if the client or service is a Java endpoint, this