Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9d7326a authored by Jeremy Meyer's avatar Jeremy Meyer Committed by Android (Google) Code Review
Browse files

Merge "Add ability to pass in a config string for FRROs"

parents 284cfb56 77c8a939
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -235,9 +235,11 @@ Status Idmap2Service::createFabricatedOverlay(

  for (const auto& res : overlay.entries) {
    if (res.dataType == Res_value::TYPE_STRING) {
      builder.SetResourceValue(res.resourceName, res.dataType, res.stringData.value());
      builder.SetResourceValue(res.resourceName, res.dataType, res.stringData.value(),
            res.configuration.value_or(std::string()));
    } else {
      builder.SetResourceValue(res.resourceName, res.dataType, res.data);
      builder.SetResourceValue(res.resourceName, res.dataType, res.data,
            res.configuration.value_or(std::string()));
    }
  }

+1 −0
Original line number Diff line number Diff line
@@ -24,4 +24,5 @@ parcelable FabricatedOverlayInternalEntry {
    int dataType;
    int data;
    @nullable @utf8InCpp String stringData;
    @nullable @utf8InCpp String configuration;
}
 No newline at end of file
+4 −2
Original line number Diff line number Diff line
@@ -39,10 +39,11 @@ struct FabricatedOverlay {
    Builder& SetOverlayable(const std::string& name);

    Builder& SetResourceValue(const std::string& resource_name, uint8_t data_type,
                              uint32_t data_value);
                              uint32_t data_value, const std::string& configuration);

    Builder& SetResourceValue(const std::string& resource_name, uint8_t data_type,
                              const std::string& data_string_value);
                              const std::string& data_string_value,
                              const std::string& configuration);

    WARN_UNUSED Result<FabricatedOverlay> Build();

@@ -52,6 +53,7 @@ struct FabricatedOverlay {
      DataType data_type;
      DataValue data_value;
      std::string data_string_value;
      std::string configuration;
    };

    std::string package_name_;
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ struct OverlayData {

  struct Value {
    std::string resource_name;
    std::variant<ResourceIdValue, TargetValue> value;
    std::variant<ResourceIdValue, TargetValueWithConfig> value;
  };

  struct InlineStringPoolData {
+2 −1
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ class ResourceMapping {
  // If `allow_rewriting_` is true, then the overlay-to-target map will be populated if the target
  // resource id is mapped to an overlay resource id.
  Result<Unit> AddMapping(ResourceId target_resource,
                          const std::variant<OverlayData::ResourceIdValue, TargetValue>& value);
                          const std::variant<OverlayData::ResourceIdValue,
                          TargetValueWithConfig>& value);

  TargetResourceMap target_map_;
  OverlayResourceMap overlay_map_;
Loading