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

Commit 77c8a939 authored by Jeremy Meyer's avatar Jeremy Meyer
Browse files

Add ability to pass in a config string for FRROs

This enables passing them and and storing them in the .frro file but no
further.

Bug: 243066074
Test: Manual
Change-Id: I5c9723e69d175a536f9739619c6b6bf3162a5027
parent a6a9b179
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -235,9 +235,11 @@ Status Idmap2Service::createFabricatedOverlay(


  for (const auto& res : overlay.entries) {
  for (const auto& res : overlay.entries) {
    if (res.dataType == Res_value::TYPE_STRING) {
    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 {
    } 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 Original line Diff line number Diff line
@@ -24,4 +24,5 @@ parcelable FabricatedOverlayInternalEntry {
    int dataType;
    int dataType;
    int data;
    int data;
    @nullable @utf8InCpp String stringData;
    @nullable @utf8InCpp String stringData;
    @nullable @utf8InCpp String configuration;
}
}
 No newline at end of file
+4 −2
Original line number Original line Diff line number Diff line
@@ -39,10 +39,11 @@ struct FabricatedOverlay {
    Builder& SetOverlayable(const std::string& name);
    Builder& SetOverlayable(const std::string& name);


    Builder& SetResourceValue(const std::string& resource_name, uint8_t data_type,
    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,
    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();
    WARN_UNUSED Result<FabricatedOverlay> Build();


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


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


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


  struct InlineStringPoolData {
  struct InlineStringPoolData {
+2 −1
Original line number Original line 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
  // 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.
  // resource id is mapped to an overlay resource id.
  Result<Unit> AddMapping(ResourceId target_resource,
  Result<Unit> AddMapping(ResourceId target_resource,
                          const std::variant<OverlayData::ResourceIdValue, TargetValue>& value);
                          const std::variant<OverlayData::ResourceIdValue,
                          TargetValueWithConfig>& value);


  TargetResourceMap target_map_;
  TargetResourceMap target_map_;
  OverlayResourceMap overlay_map_;
  OverlayResourceMap overlay_map_;
Loading