Skip to content

Commit

Permalink
CRAS: remove legacy API fallback to SetAudioConfig
Browse files Browse the repository at this point in the history
We used to call the legacy API as a fallback to ensure the functionality
does not break. The new API has merged for a long time, thus we remove
it now.

BUG=None
TEST=Verify A2DP works

Change-Id: I9e9baa5cb262e966155e4ae084e1f7a2dbe427f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5082979
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Jeremy Wu <jrwu@google.com>
Tested-by: Jeremy Wu <jrwu@google.com>
Reviewed-by: Ching Yun Chang <whalechang@google.com>
  • Loading branch information
Jeremy Wu authored and Chromeos LUCI committed Dec 4, 2023
1 parent 9f1d74f commit 51c069e
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions cras/src/server/cras_fl_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,32 +514,7 @@ int floss_media_a2dp_set_audio_config(struct fl_media* fm,
dbus_message_unref(set_audio_config);

if (rc < 0) {
// TODO: remove this fallback-to-legacy API once aosp/2627857 is merged
rc = create_dbus_method_call(
&set_audio_config,
/* dest= */ BT_SERVICE_NAME,
/* path= */ fm->obj_path,
/* iface= */ BT_MEDIA_INTERFACE,
/* method_name= */ "SetAudioConfig",
/* num_args= */ 3,
/* arg1= */ DBUS_TYPE_INT32, &dbus_sample_rate,
/* arg2= */ DBUS_TYPE_INT32, &dbus_bits_per_sample,
/* arg3= */ DBUS_TYPE_INT32, &dbus_channel_mode);
if (rc < 0) {
return rc;
}

rc = call_method_and_parse_reply(
/* conn= */ fm->conn,
/* method_call= */ set_audio_config,
/* dbus_ret_type= */ DBUS_TYPE_BOOLEAN,
/* dbus_ret_value_ptr= */ &response,
/* log_on_error= */ true);

dbus_message_unref(set_audio_config);
if (rc < 0) {
return rc;
}
return rc;
}

if (response == FALSE) {
Expand Down

0 comments on commit 51c069e

Please sign in to comment.