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

Commit 52d62ec3 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: SetName: Don't set the property if unchanged

This shall decrease the rate that SaveImmediately is called on shutting
down, avoid crashing when the disk is busy.

Bug: 310147428
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: Toggle BT fast, SaveImmediately is not called
Flag: EXEMPT, Floss-only changes
Change-Id: I2f132c586ccc9df839251be11c462a25e187d111
parent 6e878356
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2247,6 +2247,9 @@ impl IBluetooth for Bluetooth {
    }

    fn set_name(&self, name: String) -> bool {
        if self.get_name() == name {
            return true;
        }
        self.intf.lock().unwrap().set_adapter_property(BluetoothProperty::BdName(name)) == 0
    }