update_engine: Multi-level |PrefsInterface::CreateSubKey()|

Currently, |PrefsInterface::CreateSubKey()| is limited to always provide
a namespace and subpref, but this can be generalized to a multi-level
namespace alongside a supplied key.

BUG=chromium:928805
TEST=FEATURES=test emerge-$B update_engine

Change-Id: Ib81e93e8319714caa85cd2fe6495d3cb9b0e82ed
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2195623
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Andrew Lassalle <andrewlassalle@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/common/prefs_interface.h b/common/prefs_interface.h
index b559697..3aad480 100644
--- a/common/prefs_interface.h
+++ b/common/prefs_interface.h
@@ -20,6 +20,7 @@
 #include <stdint.h>
 
 #include <string>
+#include <vector>
 
 namespace chromeos_update_engine {
 
@@ -80,9 +81,7 @@
   virtual bool Delete(const std::string& key) = 0;
 
   // Creates a key which is part of a sub preference.
-  static std::string CreateSubKey(const std::string& name_space,
-                                  const std::string& sub_pref,
-                                  const std::string& key);
+  static std::string CreateSubKey(const std::vector<std::string>& ns_with_key);
 
   // Add an observer to watch whenever the given |key| is modified. The
   // OnPrefSet() and OnPrefDelete() methods will be called whenever any of the