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

Commit 90d004aa authored by William Escande's avatar William Escande Committed by Android (Google) Code Review
Browse files

Merge "Add avrcp sysprop for absolute volume" into tm-qpr-dev

parents ed2dd384 fe26e2d5
Loading
Loading
Loading
Loading

sysprop/Android.bp

0 → 100644
+17 −0
Original line number Diff line number Diff line
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

sysprop_library {
  name: "com.android.sysprop.bluetooth",
  host_supported: true,
  srcs: [
    "avrcp.sysprop",
  ],
  property_owner: "Platform",
  api_packages: ["android.sysprop"],
  cpp: {
    min_sdk_version: "Tiramisu",
  },
  apex_available: ["com.android.btservices"],
}

sysprop/OWNERS

0 → 100644
+2 −0
Original line number Diff line number Diff line
licorne@google.com
wescande@google.com

sysprop/avrcp.sysprop

0 → 100644
+11 −0
Original line number Diff line number Diff line
module: "android.sysprop.bluetooth.Avrcp"
owner: Platform

prop {
    api_name: "absolute_volume"
    type: Boolean
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.avrcp.absolute_volume.enabled"
}
+34 −28
Original line number Diff line number Diff line
@@ -92,16 +92,16 @@ const uint8_t bta_av_meta_caps_evt_ids[] = {
  (sizeof(bta_av_meta_caps_evt_ids) / sizeof(bta_av_meta_caps_evt_ids[0]))
#endif /* BTA_AV_NUM_RC_EVT_IDS */

const uint8_t bta_avk_meta_caps_evt_ids[] = {
#if (AVRC_ADV_CTRL_INCLUDED == TRUE)
const uint8_t* get_bta_avk_meta_caps_evt_ids() {
  if (avrcp_absolute_volume_is_enabled()) {
    static const uint8_t bta_avk_meta_caps_evt_ids[] = {
        AVRC_EVT_VOLUME_CHANGE,
#endif
    };

#ifndef BTA_AVK_NUM_RC_EVT_IDS
#define BTA_AVK_NUM_RC_EVT_IDS \
  (sizeof(bta_avk_meta_caps_evt_ids) / sizeof(bta_avk_meta_caps_evt_ids[0]))
#endif /* BTA_AVK_NUM_RC_EVT_IDS */
    return bta_avk_meta_caps_evt_ids;
  } else {
    return {};
  }
}

// These are the only events used with AVRCP1.3
const uint8_t bta_av_meta_caps_evt_ids_avrcp13[] = {
@@ -113,7 +113,7 @@ const uint8_t bta_av_meta_caps_evt_ids_avrcp13[] = {
#define BTA_AV_NUM_RC_EVT_IDS_AVRCP13         \
  (sizeof(bta_av_meta_caps_evt_ids_avrcp13) / \
   sizeof(bta_av_meta_caps_evt_ids_avrcp13[0]))
#endif /* BTA_AVK_NUM_RC_EVT_IDS_AVRCP13 */
#endif /* BTA_AV_NUM_RC_EVT_IDS_AVRCP13 */

/* This configuration to be used when we are Src + TG + CT( only for abs vol) */
extern const tBTA_AV_CFG bta_av_cfg = {
@@ -136,23 +136,29 @@ extern const tBTA_AV_CFG bta_av_cfg = {

/* This configuration to be used when we are Sink + CT + TG( only for abs vol)
 */
extern const tBTA_AV_CFG bta_avk_cfg = {

const tBTA_AV_CFG* get_bta_avk_cfg() {
  static const tBTA_AV_CFG bta_avk_cfg = {
      AVRC_CO_METADATA,   /* AVRCP Company ID */
      BTA_AVK_RC_SUPF_CT, /* AVRCP controller categories */
      BTA_AVK_RC_SUPF_TG, /* AVRCP target categories */
      6,                  /* AVDTP audio channel max data queue size */
      false, /* true, to accept AVRC 1.3 group nevigation command */
      2,     /* company id count in p_meta_co_ids */
    BTA_AVK_NUM_RC_EVT_IDS,    /* event id count in p_meta_evt_ids */
      (uint8_t)(avrcp_absolute_volume_is_enabled()
                    ? 1
                    : 0),              /* event id count in p_meta_evt_ids */
      BTA_AV_RC_PASS_RSP_CODE,         /* the default response code for pass
                                          through commands */
      bta_av_meta_caps_co_ids,         /* the metadata Get Capabilities response
                                          for company id */
    bta_avk_meta_caps_evt_ids, /* the the metadata Get Capabilities
                                  response for event id */
      get_bta_avk_meta_caps_evt_ids(), /* the metadata Get Capabilities response
                                          for event id */
      {0},                             /* Default AVRCP controller name */
      {0},                             /* Default AVRCP target name */
  };
  return &bta_avk_cfg;
}

/* This configuration to be used when we are using AVRCP1.3 */
extern const tBTA_AV_CFG bta_av_cfg_compatibility = {
+1 −1
Original line number Diff line number Diff line
@@ -690,7 +690,7 @@ extern tBTA_AV_CB bta_av_cb;

/* config struct */
extern const tBTA_AV_CFG* p_bta_av_cfg;
extern const tBTA_AV_CFG bta_avk_cfg;
const tBTA_AV_CFG* get_bta_avk_cfg();
extern const tBTA_AV_CFG bta_av_cfg;
extern const tBTA_AV_CFG bta_av_cfg_compatibility;

Loading