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

Commit a1af13db authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add flag for enabling Rust aconfigd_system" into main

parents 1906a950 5bd57513
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -14,3 +14,11 @@ flag {
  bug: "369808805"
  description: "When enabled, launch aconfigd from config infra module."
}

flag {
  name: "enable_system_aconfigd_rust"
  namespace: "core_experiments_team_internal"
  bug: "378079539"
  description: "When enabled, the aconfigd cc_binary target becomes a no-op, and the rust_binary aconfigd-system target starts up."
  is_fixed_read_only: true
}
+11 −0
Original line number Diff line number Diff line
@@ -39,6 +39,11 @@ pub mod auto_generated {
    pub fn enable_aconfigd_from_mainline() -> bool {
        aconfig_flags_rust::enable_only_new_storage()
    }

    /// Returns the value for the enable_system_aconfigd_rust flag.
    pub fn enable_system_aconfigd_rust() -> bool {
        aconfig_flags_rust::enable_system_aconfigd_rust()
    }
}

/// Module used when building with cargo
@@ -55,4 +60,10 @@ pub mod auto_generated {
        // Used only to enable typechecking and testing with cargo
        true
    }

    /// Returns a placeholder value for the enable_system_aconfigd_rust flag.
    pub fn enable_system_aconfigd_rust() -> bool {
        // Used only to enable typechecking and testing with cargo
        true
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -93,7 +93,12 @@ fn read_from_socket() -> Result<Vec<ProtoFlagQueryReturnMessage>> {
        special_fields: SpecialFields::new(),
    };

    let mut socket = UnixStream::connect("/dev/socket/aconfigd")?;
    let socket_name = if aconfig_flags::auto_generated::enable_system_aconfigd_rust() {
        "/dev/socket/aconfigd_system"
    } else {
        "/dev/socket/aconfigd"
    };
    let mut socket = UnixStream::connect(socket_name)?;

    let message_buffer = messages.write_to_bytes()?;
    let mut message_length_buffer: [u8; 4] = [0; 4];