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

Commit ce5445ce authored by Jeremy Wu's avatar Jeremy Wu Committed by Automerger Merge Worker
Browse files

Merge "Floss: expose DBus method to notify HFP audio disconnection" am:...

Merge "Floss: expose DBus method to notify HFP audio disconnection" am: bde209a7 am: 5a59ed41 am: e515815a

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2210975



Change-Id: Ia80cf52823dbff19d70eded7b44065e329304680
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 714f7375 e515815a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -70,6 +70,11 @@ impl IBluetoothMediaCallback for BluetoothMediaCallbackDBus {
    fn on_hfp_volume_changed(&self, volume: u8, addr: String) {
    fn on_hfp_volume_changed(&self, volume: u8, addr: String) {
        dbus_generated!()
        dbus_generated!()
    }
    }

    #[dbus_method("OnHfpAudioDisconnected")]
    fn on_hfp_audio_disconnected(&self, addr: String) {
        dbus_generated!()
    }
}
}


#[allow(dead_code)]
#[allow(dead_code)]
+9 −0
Original line number Original line Diff line number Diff line
@@ -106,6 +106,11 @@ pub trait IBluetoothMediaCallback: RPCProxy {
    /// client to reflect the change on the audio stack. The volume should be
    /// client to reflect the change on the audio stack. The volume should be
    /// in the range of 0 to 15.
    /// in the range of 0 to 15.
    fn on_hfp_volume_changed(&self, volume: u8, addr: String);
    fn on_hfp_volume_changed(&self, volume: u8, addr: String);

    /// Triggered when HFP audio is disconnected, in which case it could be
    /// waiting for the audio client to issue a reconnection request. We need
    /// to notify audio client of this event for it to do appropriate handling.
    fn on_hfp_audio_disconnected(&self, addr: String);
}
}


/// Serializable device used in.
/// Serializable device used in.
@@ -346,6 +351,10 @@ impl BluetoothMedia {
                    }
                    }
                    BthfAudioState::Disconnected => {
                    BthfAudioState::Disconnected => {
                        info!("[{}]: hfp audio disconnected.", addr.to_string());
                        info!("[{}]: hfp audio disconnected.", addr.to_string());

                        self.callbacks.lock().unwrap().for_all_callbacks(|callback| {
                            callback.on_hfp_audio_disconnected(addr.to_string());
                        });
                    }
                    }
                    BthfAudioState::Connecting => {
                    BthfAudioState::Connecting => {
                        info!("[{}]: hfp audio connecting.", addr.to_string());
                        info!("[{}]: hfp audio connecting.", addr.to_string());