hidl_string: Add cstr + length constructor

This will allow non-terminated strings to be turned into a hidl_string
with only one copy among other things.

Test: libhidl_test
Fixes: 34221748
Change-Id: I443f7920a65d23b7bcb583db55c3cec7266ec2d4
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index dce2585..5237088 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -44,6 +44,10 @@
     copyFrom(s, strlen(s));
 }
 
+hidl_string::hidl_string(const char *s, size_t length) : hidl_string() {
+    copyFrom(s, length);
+}
+
 hidl_string::hidl_string(const hidl_string &other): hidl_string() {
     copyFrom(other.c_str(), other.size());
 }