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/omaha_request_action.cc b/omaha_request_action.cc
index c9b8aa0..8728f72 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -421,13 +421,13 @@
     PrefsInterface* prefs = system_state_->prefs();
     // Reset the active metadata value to |kPingInactiveValue|.
     auto active_key =
-        prefs->CreateSubKey(kDlcPrefsSubDir, dlc_id, kPrefsPingActive);
+        prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingActive});
     if (!prefs->SetInt64(active_key, kPingInactiveValue))
       LOG(ERROR) << "Failed to set the value of ping metadata '" << active_key
                  << "'.";
 
     auto last_rollcall_key =
-        prefs->CreateSubKey(kDlcPrefsSubDir, dlc_id, kPrefsPingLastRollcall);
+        prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingLastRollcall});
     if (!prefs->SetString(last_rollcall_key, parser_data.daystart_elapsed_days))
       LOG(ERROR) << "Failed to set the value of ping metadata '"
                  << last_rollcall_key << "'.";
@@ -436,7 +436,7 @@
       // Write the value of elapsed_days into |kPrefsPingLastActive| only if
       // the previous ping was an active one.
       auto last_active_key =
-          prefs->CreateSubKey(kDlcPrefsSubDir, dlc_id, kPrefsPingLastActive);
+          prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingLastActive});
       if (!prefs->SetString(last_active_key, parser_data.daystart_elapsed_days))
         LOG(ERROR) << "Failed to set the value of ping metadata '"
                    << last_active_key << "'.";