Return real error strings from installd.

Now that we've moved installd to Binder, we can return nice detailed
error strings explaining why a call failed.  This is particularly
valuable when we record the error message into the PackageManager
persistent log, because up until now those errors were limited to
an unhelpful "installd returned -1" message.

Also perform uniform enforcement of all incoming package name and
UUID arguments.

Test: builds, boots, apps install/uninstall fine
Bug: 13758960, 30944031
Change-Id: Ic1f65ce8c10b1329e01d6a49d72cafa879c4d8bc
diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h
index ead73fe..e084781 100644
--- a/cmds/installd/utils.h
+++ b/cmds/installd/utils.h
@@ -102,7 +102,8 @@
                      const char* leaf,
                      userid_t userid);
 
-int is_valid_package_name(const char* pkgname);
+bool is_valid_filename(const std::string& name);
+bool is_valid_package_name(const std::string& packageName);
 
 int delete_dir_contents(const std::string& pathname, bool ignore_if_missing = false);
 int delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing = false);