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

Commit 8c19c135 authored by tedwang's avatar tedwang Committed by Hansong Zhang
Browse files

Add respond track not selected interim when register notification

Respond interim with Identifier 0xFFFFFFFFFFFFFFFF register
notification for EVENT_TRACK_CHANGE for pts test

Bug: 79378129
Test: PTS AVRCP/TG/NFY/BV-04-C
Change-Id: Ia861bf4682e9daf9c7c3842df9f95381171da574
Merged-In: Ia861bf4682e9daf9c7c3842df9f95381171da574
(cherry picked from commit 3f6171c4)
parent a68c7ee4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ TRC_HID_DEV=2
# SMP Pair options (formatted as hex bytes) auth, io, ikey, rkey, ksize
#PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10

# PTS AVRCP Test mode
#PTS_AvrcpTest=true

# SMP Certification Failure Cases
# Set any of the following SMP error values (from smp_api_types.h)
# to induce pairing failues for various PTS SMP test cases.
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ static const char STACK_CONFIG_MODULE[] = "stack_config_module";

typedef struct {
  bool (*get_trace_config_enabled)(void);
  bool (*get_pts_avrcp_test)(void);
  bool (*get_pts_secure_only_mode)(void);
  bool (*get_pts_conn_updates_disabled)(void);
  bool (*get_pts_crosskey_sdp_disable)(void);
+11 −7
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@

namespace {
const char* TRACE_CONFIG_ENABLED_KEY = "TraceConf";
const char* PTS_AVRCP_TEST = "PTS_AvrcpTest";
const char* PTS_SECURE_ONLY_MODE = "PTS_SecurePairOnly";
const char* PTS_LE_CONN_UPDATED_DISABLED = "PTS_DisableConnUpdates";
const char* PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair";
@@ -77,6 +78,11 @@ static bool get_trace_config_enabled(void) {
                         TRACE_CONFIG_ENABLED_KEY, false);
}

static bool get_pts_avrcp_test(void) {
  return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_AVRCP_TEST,
                         false);
}

static bool get_pts_secure_only_mode(void) {
  return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_SECURE_ONLY_MODE,
                         false);
@@ -104,12 +110,10 @@ static int get_pts_smp_failure_case(void) {

static config_t* get_all(void) { return config.get(); }

const stack_config_t interface = {get_trace_config_enabled,
                                  get_pts_secure_only_mode,
                                  get_pts_conn_updates_disabled,
                                  get_pts_crosskey_sdp_disable,
                                  get_pts_smp_options,
                                  get_pts_smp_failure_case,
                                  get_all};
const stack_config_t interface = {
    get_trace_config_enabled,     get_pts_avrcp_test,
    get_pts_secure_only_mode,     get_pts_conn_updates_disabled,
    get_pts_crosskey_sdp_disable, get_pts_smp_options,
    get_pts_smp_failure_case,     get_all};

const stack_config_t* stack_config_get_interface(void) { return &interface; }
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ cc_library_static {
    host_supported: true,
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/btcore/include",
        "packages/modules/Bluetooth/system/internal_include",
        "packages/modules/Bluetooth/system/stack/include",
    ],
@@ -25,6 +26,7 @@ cc_test {
    host_supported: true,
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/btcore/include",
        "packages/modules/Bluetooth/system/internal_include",
        "packages/modules/Bluetooth/system/stack/include",
    ],
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include "connection_handler.h"
#include "device.h"
#include "stack_config.h"

#include "packet/avrcp/avrcp_reject_packet.h"
#include "packet/avrcp/general_reject_packet.h"
@@ -369,6 +370,10 @@ void Device::TrackChangedNotificationResponse(uint8_t label, bool interim,
  if (curr_song_id == "") {
    DEVICE_LOG(WARNING) << "Empty media ID";
    uid = 0;
    if (stack_config_get_interface()->get_pts_avrcp_test()) {
      DEVICE_LOG(WARNING) << __func__ << ": pts test mode";
      uid = 0xffffffffffffffff;
    }
  }

  auto response = RegisterNotificationResponseBuilder::MakeTrackChangedBuilder(
Loading