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

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

Snap for 11623990 from f50a2e1c to 24Q3-release

Change-Id: I60723c0dc1320e2fa8a080491240aed26ee0a313
parents 99096a01 f50a2e1c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ class StreamRemoteSubmix : public StreamCommonImpl {
    r_submix::AudioConfig mStreamConfig;
    std::shared_ptr<r_submix::SubmixRoute> mCurrentRoute = nullptr;

    // limit for number of read error log entries to avoid spamming the logs
    static constexpr int kMaxReadErrorLogs = 5;
    // Limit for the number of error log entries to avoid spamming the logs.
    static constexpr int kMaxErrorLogs = 5;
    // The duration of kMaxReadFailureAttempts * READ_ATTEMPT_SLEEP_MS must be strictly inferior
    // to the duration of a record buffer at the current record sample rate (of the device, not of
    // the recording itself). Here we have: 3 * 5ms = 15ms < 1024 frames * 1000 / 48000 = 21.333ms
@@ -68,6 +68,7 @@ class StreamRemoteSubmix : public StreamCommonImpl {
    long mFramesSinceStart = 0;
    int mReadErrorCount = 0;
    int mReadFailureCount = 0;
    int mWriteShutdownCount = 0;
};

class StreamInRemoteSubmix final : public StreamIn, public StreamSwitcher {
+15 −7
Original line number Diff line number Diff line
@@ -134,11 +134,16 @@ void StreamRemoteSubmix::shutdown() {
    *latencyMs = getDelayInUsForFrameCount(getStreamPipeSizeInFrames()) / 1000;
    LOG(VERBOSE) << __func__ << ": Latency " << *latencyMs << "ms";
    mCurrentRoute->exitStandby(mIsInput);
    RETURN_STATUS_IF_ERROR(mIsInput ? inRead(buffer, frameCount, actualFrameCount)
                                    : outWrite(buffer, frameCount, actualFrameCount));
    ::android::status_t status = mIsInput ? inRead(buffer, frameCount, actualFrameCount)
                                          : outWrite(buffer, frameCount, actualFrameCount);
    if ((status != ::android::OK && mIsInput) ||
        ((status != ::android::OK && status != ::android::DEAD_OBJECT) && !mIsInput)) {
        return status;
    }
    mFramesSinceStart += *actualFrameCount;
    if (!mIsInput) return ::android::OK;
    // Only input streams need to block, for output this is implemented by MonoPipe.
    if (!mIsInput && status != ::android::DEAD_OBJECT) return ::android::OK;
    // Input streams always need to block, output streams need to block when there is no sink.
    // When the sink exists, more sophisticated blocking algorithm is implemented by MonoPipe.
    const long bufferDurationUs =
            (*actualFrameCount) * MICROS_PER_SECOND / mContext.getSampleRate();
    const auto totalDurationUs = (::android::uptimeNanos() - mStartTimeNs) / NANOS_PER_MICROSECOND;
@@ -188,14 +193,17 @@ size_t StreamRemoteSubmix::getStreamPipeSizeInFrames() {
    if (sink != nullptr) {
        if (sink->isShutdown()) {
            sink.clear();
            LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write";
            if (++mWriteShutdownCount < kMaxErrorLogs) {
                LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write. (limited logging)";
            }
            *actualFrameCount = frameCount;
            return ::android::OK;
            return ::android::DEAD_OBJECT;  // Induce wait in `transfer`.
        }
    } else {
        LOG(FATAL) << __func__ << ": without a pipe!";
        return ::android::UNKNOWN_ERROR;
    }
    mWriteShutdownCount = 0;

    LOG(VERBOSE) << __func__ << ": " << mDeviceAddress.toString() << ", " << frameCount
                 << " frames";
@@ -262,7 +270,7 @@ size_t StreamRemoteSubmix::getStreamPipeSizeInFrames() {
    // about to read from audio source
    sp<MonoPipeReader> source = mCurrentRoute->getSource();
    if (source == nullptr) {
        if (++mReadErrorCount < kMaxReadErrorLogs) {
        if (++mReadErrorCount < kMaxErrorLogs) {
            LOG(ERROR) << __func__
                       << ": no audio pipe yet we're trying to read! (not all errors will be "
                          "logged)";
+2 −2
Original line number Diff line number Diff line
@@ -11,12 +11,12 @@
            {
                "name": "Manufacturer of vehicle",
                "value": 286261505,
                "description": "Manufacturer of vehicle"
                "description": "Manufacturer of vehicle\nThis property must communicate the vehicle's public brand name."
            },
            {
                "name": "Model of vehicle",
                "value": 286261506,
                "description": "Model of vehicle"
                "description": "Model of vehicle\nThis property must communicate the vehicle's public model name."
            },
            {
                "name": "INFO_MODEL_YEAR",
+4 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ enum VehicleProperty {
    /**
     * Manufacturer of vehicle
     *
     * This property must communicate the vehicle's public brand name.
     *
     * @change_mode VehiclePropertyChangeMode.STATIC
     * @access VehiclePropertyAccess.READ
     * @version 2
@@ -68,6 +70,8 @@ enum VehicleProperty {
    /**
     * Model of vehicle
     *
     * This property must communicate the vehicle's public model name.
     *
     * @change_mode VehiclePropertyChangeMode.STATIC
     * @access VehiclePropertyAccess.READ
     * @version 2
+45 −0
Original line number Diff line number Diff line
@@ -118,6 +118,10 @@ static bool isTv() {
         testing::deviceSupportsFeature("android.hardware.type.television");
}

static bool isHandheld() {
  return testing::deviceSupportsFeature("android.hardware.type.handheld");
}

class ThroughputLogger {
 public:
  explicit ThroughputLogger(std::string task)
@@ -1050,6 +1054,47 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) {
  ASSERT_GE(num_resolving_list, kMinLeResolvingListForBt5);
}

/**
 * Requirements
 *
 * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
 * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
 */
TEST_P(BluetoothAidlTest, Vsr_Bluetooth4_2Requirements) {
  // test only applies to handheld devices
  if (!isHandheld()) {
    return;
  }

  std::vector<uint8_t> version_event;
  send_and_wait_for_cmd_complete(ReadLocalVersionInformationBuilder::Create(),
                                 version_event);
  auto version_view = ReadLocalVersionInformationCompleteView::Create(
      CommandCompleteView::Create(EventView::Create(PacketView<true>(
          std::make_shared<std::vector<uint8_t>>(version_event)))));
  ASSERT_TRUE(version_view.IsValid());
  ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, version_view.GetStatus());
  auto version = version_view.GetLocalVersionInformation();
  // Starting with Android 15, Fails when HCI version is lower than 4.2.
  ASSERT_GE(static_cast<int>(version.hci_version_),
    static_cast<int>(::bluetooth::hci::HciVersion::V_4_2));
  ASSERT_GE(static_cast<int>(version.lmp_version_),
    static_cast<int>(::bluetooth::hci::LmpVersion::V_4_2));

  std::vector<uint8_t> le_features_event;
  send_and_wait_for_cmd_complete(LeReadLocalSupportedFeaturesBuilder::Create(),
                                 le_features_event);
  auto le_features_view = LeReadLocalSupportedFeaturesCompleteView::Create(
      CommandCompleteView::Create(EventView::Create(PacketView<true>(
          std::make_shared<std::vector<uint8_t>>(le_features_event)))));
  ASSERT_TRUE(le_features_view.IsValid());
  ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, le_features_view.GetStatus());
  auto le_features = le_features_view.GetLeFeatures();
  ASSERT_TRUE(le_features &
              static_cast<uint64_t>(LLFeaturesBits::LE_EXTENDED_ADVERTISING));

}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothAidlTest);
INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothAidlTest,
                         testing::ValuesIn(android::getAidlHalInstanceNames(
Loading