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

Commit ca6ac5de authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8462842 from ed7c37f6 to tm-qpr1-release

Change-Id: Ic925a7b58505b46441e4f6d0d1ac8f7f8be9f12f
parents a9332b53 ed7c37f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+6 −1
Original line number Diff line number Diff line
@@ -542,8 +542,8 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
     *
     * @param contentMetadata metadata for the default Broadcast subgroup
     * @param broadcastCode Encryption will be enabled when <var>broadcastCode</var> is not null
     * @throws IllegalArgumentException if <var>contentMetadata</var> is null
     * @throws IllegalStateException if callback was not registered
     * @throws NullPointerException if <var>contentMetadata</var> is null
     * @hide
     */
    @SystemApi
@@ -554,6 +554,8 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    })
    public void startBroadcast(@NonNull BluetoothLeAudioContentMetadata contentMetadata,
            @Nullable byte[] broadcastCode) {
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");

        if (DBG) log("startBroadcasting");
        final IBluetoothLeAudio service = getService();
        if (service == null) {
@@ -579,6 +581,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
     * @param broadcastId broadcastId as defined by the Basic Audio Profile
     * @param contentMetadata updated metadata for the default Broadcast subgroup
     * @throws IllegalStateException if callback was not registered
     * @throws NullPointerException if <var>contentMetadata</var> is null
     * @hide
     */
    @SystemApi
@@ -589,6 +592,8 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    })
    public void updateBroadcast(int broadcastId,
            @NonNull BluetoothLeAudioContentMetadata contentMetadata) {
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");

        if (DBG) log("updateBroadcast");
        final IBluetoothLeAudio service = getService();
        if (service == null) {
+18 −7
Original line number Diff line number Diff line
@@ -427,9 +427,9 @@ class LeAudioClientImpl : public LeAudioClient {
        return;
      }
    } else {
      LOG_ASSERT(id == group_id)
          << " group id missmatch? leaudio id: " << group_id
          << " groups module " << id;
      ASSERT_LOG(id == group_id,
                 " group id missmatch? leaudio id: %d, groups module %d",
                 group_id, id);
      new_group = aseGroups_.FindById(group_id);
      if (!new_group) {
        new_group = aseGroups_.Add(group_id);
@@ -438,6 +438,8 @@ class LeAudioClientImpl : public LeAudioClient {
      }
    }

    LOG_DEBUG("New group %p, id: %d", new_group, new_group->group_id_);

    /* If device was in the group and it was not removed by the application,
     * lets do it now
     */
@@ -483,7 +485,15 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void remove_group_if_possible(LeAudioDeviceGroup* group) {
    if (group && group->IsEmpty() && !group->cig_created_) {
    if (!group) {
      LOG_DEBUG("group is null");
      return;
    }
    LOG_DEBUG("Group %p, id: %d, size: %d, is cig_state %s", group,
              group->group_id_, group->Size(),
              ToString(group->cig_state_).c_str());
    if (group->IsEmpty() &&
        (group->cig_state_ == le_audio::types::CigState::NONE)) {
      aseGroups_.Remove(group->group_id_);
    }
  }
@@ -1774,8 +1784,7 @@ class LeAudioClientImpl : public LeAudioClient {
      return;
    }

    LOG(INFO) << __func__ << " attaching to group  "
              << leAudioDevice->group_id_;
    LOG_INFO("Attaching to group: %d", leAudioDevice->group_id_);

    /* Restore configuration */
    LeAudioDeviceGroup* group = aseGroups_.FindById(active_group_id_);
@@ -3113,17 +3122,19 @@ class LeAudioClientImpl : public LeAudioClient {
      case bluetooth::hci::iso_manager::kIsoEventCigOnCreateCmpl: {
        auto* evt = static_cast<cig_create_cmpl_evt*>(data);
        LeAudioDeviceGroup* group = aseGroups_.FindById(evt->cig_id);
        ASSERT_LOG(group, "Group id: %d is null", evt->cig_id);
        groupStateMachine_->ProcessHciNotifOnCigCreate(
            group, evt->status, evt->cig_id, evt->conn_handles);
      } break;
      case bluetooth::hci::iso_manager::kIsoEventCigOnRemoveCmpl: {
        auto* evt = static_cast<cig_remove_cmpl_evt*>(data);
        LeAudioDeviceGroup* group = aseGroups_.FindById(evt->cig_id);
        ASSERT_LOG(group, "Group id: %d is null", evt->cig_id);
        groupStateMachine_->ProcessHciNotifOnCigRemove(evt->status, group);
        remove_group_if_possible(group);
      } break;
      default:
        LOG(ERROR) << __func__ << " Invalid event " << int{event_type};
        LOG_ERROR("Invalid event %d", +event_type);
    }
  }

+1 −0
Original line number Diff line number Diff line
@@ -1212,6 +1212,7 @@ void LeAudioDeviceGroup::Dump(int fd) {
  stream << "    == Group id: " << group_id_ << " == \n"
         << "      state: " << GetState() << "\n"
         << "      target state: " << GetTargetState() << "\n"
         << "      cig state: " << cig_state_ << "\n"
         << "      number of devices: " << Size() << "\n"
         << "      number of connected devices: " << NumOfConnected() << "\n"
         << "      active context types: "
+2 −2
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ class LeAudioDevices {
class LeAudioDeviceGroup {
 public:
  const int group_id_;
  bool cig_created_;
  types::CigState cig_state_;

  struct stream_configuration stream_conf;

@@ -192,7 +192,7 @@ class LeAudioDeviceGroup {

  explicit LeAudioDeviceGroup(const int group_id)
      : group_id_(group_id),
        cig_created_(false),
        cig_state_(types::CigState::NONE),
        stream_conf({}),
        audio_directions_(0),
        transport_latency_mtos_us_(0),
Loading