Allow string type when fabricating FRROs
This includes all of the work of passing the string all the way down to
the native code but then does nothing with it. Storing and retrieving of
it will be in follow up changes.
Test: Manual
Bug: 232940948
Change-Id: Ie00cc23680a0132588744991bf829afad6ba336f
diff --git a/cmds/idmap2/libidmap2/FabricatedOverlay.cpp b/cmds/idmap2/libidmap2/FabricatedOverlay.cpp
index 8352dbb..4d49674 100644
--- a/cmds/idmap2/libidmap2/FabricatedOverlay.cpp
+++ b/cmds/idmap2/libidmap2/FabricatedOverlay.cpp
@@ -65,7 +65,13 @@
FabricatedOverlay::Builder& FabricatedOverlay::Builder::SetResourceValue(
const std::string& resource_name, uint8_t data_type, uint32_t data_value) {
- entries_.emplace_back(Entry{resource_name, data_type, data_value});
+ entries_.emplace_back(Entry{resource_name, data_type, data_value, ""});
+ return *this;
+}
+
+FabricatedOverlay::Builder& FabricatedOverlay::Builder::SetResourceValue(
+ const std::string& resource_name, uint8_t data_type, const std::string& data_string_value) {
+ entries_.emplace_back(Entry{resource_name, data_type, 0, data_string_value});
return *this;
}
@@ -111,7 +117,8 @@
entry = type->second.insert(std::make_pair(entry_name.to_string(), TargetValue())).first;
}
- entry->second = TargetValue{res_entry.data_type, res_entry.data_value};
+ entry->second = TargetValue{
+ res_entry.data_type, res_entry.data_value, res_entry.data_string_value};
}
pb::FabricatedOverlay overlay_pb;