vold: Pass std::string by const reference

In a couple places, we change to pass a std::string argument
instead of by copy.

Test: TreeHugger
Change-Id: Ib179299a2322fcbab4e6d192051218823ad66a36
diff --git a/KeyStorage.h b/KeyStorage.h
index 6aaf3ad..276b6b9 100644
--- a/KeyStorage.h
+++ b/KeyStorage.h
@@ -31,7 +31,7 @@
 // If only "secret" is nonempty, it is used to decrypt in a non-Keymaster process.
 class KeyAuthentication {
   public:
-    KeyAuthentication(std::string t, std::string s) : token{t}, secret{s} {};
+    KeyAuthentication(const std::string& t, const std::string& s) : token{t}, secret{s} {};
 
     bool usesKeymaster() const { return !token.empty() || secret.empty(); };
 
diff --git a/MetadataCrypt.cpp b/MetadataCrypt.cpp
index 8b4d04e..5c8a075 100644
--- a/MetadataCrypt.cpp
+++ b/MetadataCrypt.cpp
@@ -84,7 +84,7 @@
 
 // Note: It is possible to orphan a key if it is removed before deleting
 // Update this once keymaster APIs change, and we have a proper commit.
-static void commit_key(std::string dir) {
+static void commit_key(const std::string& dir) {
     while (!android::base::WaitForProperty("vold.checkpoint_committed", "1")) {
         LOG(ERROR) << "Wait for boot timed out";
     }