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

Commit e31393fd authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

has_client: Improve subscribing for notification

To improve PTS testing, let's subscribe to all the CCC before making
operations on the control point.

Bug: 238171211
Test: manualy with PTS
Test: atest BluetoothInstrumentationTests
Tag: #feature
Merged-In: Iebb66edff13edea336de32292fc54f311f72d4ed
Change-Id: Iebb66edff13edea336de32292fc54f311f72d4ed
(cherry picked from commit c9352435)
parent fc3f47aa
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1672,6 +1672,11 @@ class HasClientImpl : public HasClient {
     * mandatory active preset index notifications.
     */
    if (device->SupportsPresets()) {
      /* Subscribe for active preset notifications */
      SubscribeForNotifications(device->conn_id, device->addr,
                                device->active_preset_handle,
                                device->active_preset_ccc_handle);

      SubscribeForNotifications(device->conn_id, device->addr,
                                device->cp_handle, device->cp_ccc_handle,
                                device->cp_ccc_val);
@@ -1691,11 +1696,6 @@ class HasClientImpl : public HasClient {
                                               value, user_data);
          },
          nullptr);

      /* Subscribe for active preset notifications */
      SubscribeForNotifications(device->conn_id, device->addr,
                                device->active_preset_handle,
                                device->active_preset_ccc_handle);
    } else {
      LOG(WARNING) << __func__
                   << ": server can only report HAS features, other "