hidl_string: allow null cstr

Automatically converting nullptr to empty string rather than erroring.
This gets rid of null values at the hal layer (rather than passing them
to the server) and simplifies code that would have to check for nulls.

Test: libhidl_test
Fixes: 35421240
Change-Id: Iada25da5407c3eccdd28704d993ffdee8b15c5fe
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 80f95b6..d22c257 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -126,7 +126,7 @@
 
     // copy constructor.
     hidl_string(const hidl_string &);
-    // copy from a C-style string.
+    // copy from a C-style string. nullptr will create an empty string
     hidl_string(const char *);
     // copy the first length characters from a C-style string.
     hidl_string(const char *, size_t length);