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

Commit 639478bd authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: Deprecated InitFlags

The InitFlags argument is not used in btif so this patch has no logical
change.

Bug: 370387120
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: USE=floss_upstream emerge-zork floss
Flag: EXEMPT, no logical change
Change-Id: I9e02024959486a14dca14875b2adaa31183d332c
parent 62b8eede
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -772,7 +772,7 @@ impl IBluetooth for BluetoothDBus {
        dbus_generated!()
    }

    fn init(&mut self, _init_flags: Vec<String>, _hci_index: i32) -> bool {
    fn init(&mut self, _hci_index: i32) -> bool {
        // Not implemented by server
        true
    }
+1 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ impl IBluetooth for IBluetoothDBus {
    }

    // Not exposed over D-Bus. The stack is automatically initialized when the daemon starts.
    fn init(&mut self, _init_flags: Vec<String>, _hci_index: i32) -> bool {
    fn init(&mut self, _hci_index: i32) -> bool {
        dbus_generated!()
    }

+1 −9
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ const INIT_LOGGING_MAX_RETRY: u8 = 3;
/// Runs the Bluetooth daemon serving D-Bus IPC.
fn main() -> Result<(), Box<dyn Error>> {
    let matches = App::new("Bluetooth Adapter Daemon")
        // Allows multiple INIT_ flags to be given at the end of the arguments.
        .setting(AppSettings::TrailingVarArg)
        .arg(
            Arg::with_name("hci")
@@ -82,7 +81,6 @@ fn main() -> Result<(), Box<dyn Error>> {
                .short("v")
                .help("Enables VERBOSE and additional tags for debug logging. Use with --debug."),
        )
        .arg(Arg::from_usage("[init-flags] 'Fluoride INIT_ flags'").multiple(true))
        .arg(
            Arg::with_name("log-output")
                .long("log-output")
@@ -100,12 +98,6 @@ fn main() -> Result<(), Box<dyn Error>> {
    let virt_index = matches.value_of("index").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0));
    let hci_index = matches.value_of("hci").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0));

    // The remaining flags are passed down to Fluoride as is.
    let init_flags: Vec<String> = match matches.values_of("init-flags") {
        Some(args) => args.map(String::from).collect(),
        None => vec![],
    };

    let logging = Arc::new(Mutex::new(Box::new(BluetoothLogging::new(
        is_debug,
        is_verbose_debug,
@@ -178,7 +170,7 @@ fn main() -> Result<(), Box<dyn Error>> {
        let battery_provider_manager =
            Arc::new(Mutex::new(Box::new(BatteryProviderManager::new(tx.clone()))));

        bluetooth.lock().unwrap().init(init_flags, hci_index);
        bluetooth.lock().unwrap().init(hci_index);
        bluetooth.lock().unwrap().enable();

        // These constructions require |intf| to be already init-ed.
+3 −7
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ pub trait IBluetooth {
    fn unregister_connection_callback(&mut self, callback_id: u32) -> bool;

    /// Inits the bluetooth interface. Should always be called before enable.
    fn init(&mut self, init_flags: Vec<String>, hci_index: i32) -> bool;
    fn init(&mut self, hci_index: i32) -> bool;

    /// Enables the adapter.
    ///
@@ -2223,12 +2223,8 @@ impl IBluetooth for Bluetooth {
        self.connection_callbacks.remove_callback(callback_id)
    }

    fn init(&mut self, init_flags: Vec<String>, hci_index: i32) -> bool {
        self.intf.lock().unwrap().initialize(
            get_bt_dispatcher(self.tx.clone()),
            init_flags,
            hci_index,
        )
    fn init(&mut self, hci_index: i32) -> bool {
        self.intf.lock().unwrap().initialize(get_bt_dispatcher(self.tx.clone()), hci_index)
    }

    fn enable(&mut self) -> bool {
+0 −3
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ cc_library_static {
    srcs: [
        "btav/btav_shim.cc",
        "btav_sink/btav_sink_shim.cc",
        "btif/btif_shim.cc",
        "controller/controller_shim.cc",
        "csis/csis_shim.cc",
        "gatt/gatt_ble_advertiser_shim.cc",
@@ -83,7 +82,6 @@ gensrcs {
    tools: ["cxxbridge"],
    cmd: "$(location cxxbridge) $(in) --header > $(out)",
    srcs: [
        "src/btif.rs",
        "src/controller.rs",
        "src/profiles/a2dp.rs",
        "src/profiles/avrcp.rs",
@@ -102,7 +100,6 @@ gensrcs {
    tools: ["cxxbridge"],
    cmd: "$(location cxxbridge) $(in) > $(out)",
    srcs: [
        "src/btif.rs",
        "src/controller.rs",
        "src/profiles/a2dp.rs",
        "src/profiles/avrcp.rs",
Loading