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

Commit 39037b8d authored by Henri Chataing's avatar Henri Chataing
Browse files

btif_a2dp_source: Remove unused APIs

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, no logical change
Change-Id: I059fb39e5a92bd75a166b0325373d7f0533054b6
parent 9919522b
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -34,11 +34,6 @@
// module.
bool btif_a2dp_source_init(void);

// Startup the A2DP Source module.
// This function should be called by the BTIF state machine after
// btif_a2dp_source_init() to prepare to start streaming.
bool btif_a2dp_source_startup(void);

// Start the A2DP Source session.
// This function should be called by the BTIF state machine after
// btif_a2dp_source_startup() to start the streaming session for |peer_address|.
@@ -70,14 +65,6 @@ void btif_a2dp_source_shutdown(std::promise<void>);
// cleanup.
void btif_a2dp_source_cleanup(void);

// Check whether the A2DP Source media task is running.
// Returns true if the A2DP Source media task is running, otherwise false.
bool btif_a2dp_source_media_task_is_running(void);

// Check whether the A2DP Source media task is shutting down.
// Returns true if the A2DP Source media task is shutting down.
bool btif_a2dp_source_media_task_is_shutting_down(void);

// Return true if the A2DP Source module is streaming.
bool btif_a2dp_source_is_streaming(void);

+2 −17
Original line number Diff line number Diff line
@@ -233,12 +233,12 @@ static BtifA2dpSource btif_a2dp_source_cb;
static uint8_t btif_a2dp_source_dynamic_audio_buffer_size = MAX_OUTPUT_A2DP_FRAME_QUEUE_SZ;

static void btif_a2dp_source_init_delayed(void);
static bool btif_a2dp_source_startup(void);
static void btif_a2dp_source_startup_delayed(void);
static void btif_a2dp_source_start_session_delayed(const RawAddress& peer_address,
                                                   std::promise<void> start_session_promise);
static void btif_a2dp_source_end_session_delayed(const RawAddress& peer_address);
static void btif_a2dp_source_shutdown_delayed(std::promise<void>);
static void btif_a2dp_source_cleanup_delayed(void);
static void btif_a2dp_source_audio_tx_start_event(void);
static void btif_a2dp_source_audio_tx_stop_event(void);
static void btif_a2dp_source_audio_tx_flush_event(void);
@@ -388,7 +388,7 @@ static void btif_a2dp_source_init_delayed(void) {
                               btif_av_is_a2dp_offload_enabled());
}

bool btif_a2dp_source_startup(void) {
static bool btif_a2dp_source_startup(void) {
  log::info("state={}", btif_a2dp_source_cb.StateStr());

  if (btif_a2dp_source_cb.State() != BtifA2dpSource::kStateOff) {
@@ -555,25 +555,10 @@ void btif_a2dp_source_cleanup(void) {
  std::promise<void> shutdown_complete_promise;
  btif_a2dp_source_shutdown(std::move(shutdown_complete_promise));

  btif_a2dp_source_thread.DoInThread(FROM_HERE, base::BindOnce(&btif_a2dp_source_cleanup_delayed));

  // Exit the thread
  btif_a2dp_source_thread.ShutDown();
}

static void btif_a2dp_source_cleanup_delayed(void) {
  log::info("state={}", btif_a2dp_source_cb.StateStr());
  // Nothing to do
}

bool btif_a2dp_source_media_task_is_running(void) {
  return btif_a2dp_source_cb.State() == BtifA2dpSource::kStateRunning;
}

bool btif_a2dp_source_media_task_is_shutting_down(void) {
  return btif_a2dp_source_cb.State() == BtifA2dpSource::kStateShuttingDown;
}

// This runs on worker thread
bool btif_a2dp_source_is_streaming(void) { return btif_a2dp_source_cb.media_alarm.IsScheduled(); }