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

Commit e6fdde37 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Find cover art supported feature and send up to JNI am: 64145b9c

Change-Id: I52ae2bcc01fa792d084426527c13a4d08e087be6
parents 7e09c4f3 64145b9c
Loading
Loading
Loading
Loading
+22 −16
Original line number Diff line number Diff line
@@ -1720,26 +1720,32 @@ tBTA_AV_FEAT bta_avk_check_peer_features(uint16_t service_uuid) {
      if (peer_rc_version >= AVRC_REV_1_3)
        peer_features |= (BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_METADATA);

      /*
       * Though Absolute Volume came after in 1.4 and above, but there are few
       * devices
       * in market which supports absolute Volume and they are still 1.3
       * TO avoid IOT issuses with those devices, we check for 1.3 as minimum
       * version
       */
      if (peer_rc_version >= AVRC_REV_1_3) {
        /* get supported features */
      /* Get supported features */
      tSDP_DISC_ATTR* p_attr =
          SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
      if (p_attr != NULL) {
        uint16_t categories = p_attr->attr_value.v.u16;
          if (categories & AVRC_SUPF_CT_CAT2)
        /*
         * Though Absolute Volume came after in 1.4 and above, but there are
         * few devices in market which supports absolute Volume and they are
         * still 1.3. To avoid IOP issuses with those devices, we check for
         * 1.3 as minimum version
         */
        if (peer_rc_version >= AVRC_REV_1_3) {
          if (categories & AVRC_SUPF_TG_CAT2)
            peer_features |= (BTA_AV_FEAT_ADV_CTRL);
          if (categories & AVRC_SUPF_CT_APP_SETTINGS)
          if (categories & AVRC_SUPF_TG_APP_SETTINGS)
            peer_features |= (BTA_AV_FEAT_APP_SETTING);
          if (categories & AVRC_SUPF_CT_BROWSE)
          if (categories & AVRC_SUPF_TG_BROWSE)
            peer_features |= (BTA_AV_FEAT_BROWSE);
        }

        /* AVRCP Cover Artwork over BIP */
        if (peer_rc_version >= AVRC_REV_1_6) {
          if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET &&
              categories & AVRC_SUPF_TG_PLAYER_COVER_ART)
            peer_features |= (BTA_AV_FEAT_COVER_ARTWORK);
        }
      }
    }
    /* get next record; if none found, we're done */
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ typedef uint8_t tBTA_AV_STATUS;
#define BTA_AV_FEAT_DELAY_RPT 0x0400 /* allow delay reporting */
#define BTA_AV_FEAT_ACP_START \
  0x0800 /* start stream when 2nd SNK was accepted   */
#define BTA_AV_FEAT_COVER_ARTWORK 0x1000 /* use cover art feature */
#define BTA_AV_FEAT_APP_SETTING 0x2000 /* Player app setting support */

/* Internal features */
+1 −1
Original line number Diff line number Diff line
@@ -3103,7 +3103,7 @@ bt_status_t btif_av_sink_execute_service(bool enable) {
    tBTA_AV_FEAT features = BTA_AV_FEAT_NO_SCO_SSPD | BTA_AV_FEAT_RCCT |
                            BTA_AV_FEAT_METADATA | BTA_AV_FEAT_VENDOR |
                            BTA_AV_FEAT_ADV_CTRL | BTA_AV_FEAT_RCTG |
                            BTA_AV_FEAT_BROWSE;
                            BTA_AV_FEAT_BROWSE | BTA_AV_FEAT_COVER_ARTWORK;
    BTA_AvEnable(BTA_SEC_AUTHENTICATE, features, bta_av_sink_callback);
    btif_av_sink.RegisterAllBtaHandles();
    return BT_STATUS_SUCCESS;
+6 −0
Original line number Diff line number Diff line
@@ -485,6 +485,11 @@ void handle_rc_ctrl_features(btif_rc_device_cb_t* p_dev) {
    rc_features |= BTRC_FEAT_BROWSE;
  }

  /* Add cover art feature capability */
  if (p_dev->rc_features & BTA_AV_FEAT_COVER_ARTWORK) {
    rc_features |= BTRC_FEAT_COVER_ARTWORK;
  }

  BTIF_TRACE_DEBUG("%s: Update rc features to CTRL: %d", __func__, rc_features);
  do_in_jni_thread(FROM_HERE, base::Bind(bt_rc_ctrl_callbacks->getrcfeatures_cb,
                                         p_dev->rc_addr, rc_features));
@@ -1750,6 +1755,7 @@ static bt_status_t init_ctrl(btrc_ctrl_callbacks_t* callbacks) {
           sizeof(btif_rc_cb.rc_multi_cb[idx]));
    btif_rc_cb.rc_multi_cb[idx].rc_vol_label = MAX_LABEL;
    btif_rc_cb.rc_multi_cb[idx].rc_volume = MAX_VOLUME;
    btif_rc_cb.rc_multi_cb[idx].rc_features_processed = FALSE;
  }
  lbl_init();

+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ typedef enum {
  BTRC_FEAT_METADATA = 0x01,        /* AVRCP 1.3 */
  BTRC_FEAT_ABSOLUTE_VOLUME = 0x02, /* Supports TG role and volume sync */
  BTRC_FEAT_BROWSE = 0x04, /* AVRCP 1.4 and up, with Browsing support */
  BTRC_FEAT_COVER_ARTWORK = 0x8,    /* AVRCP 1.6 and up, Cover Art */
} btrc_remote_features_t;

typedef enum {