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

Commit a6f8e3f6 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge "flags: Remove android_bluetooth_flags.h wrapper" into main

parents f996d0a5 92784d9c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ java_aconfig_library {
cc_aconfig_library {
    name: "bluetooth_flags_c_lib",
    aconfig_declarations: "bluetooth_aconfig_flags",
    export_include_dirs: ["exported_include"],
    host_supported: true,
    visibility: [
        "//packages/modules/Bluetooth/system:__subpackages__",
+0 −22
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <com_android_bluetooth_flags.h>

#define IS_FLAG_ENABLED(flag_name) com::android::bluetooth::flags::flag_name()
#define IS_FLAG_ENABLED_P(provider, flag_name) provider.flag_name()
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@
#include "a2dp_provider_info.h"

#include <android/binder_manager.h>
#include <android_bluetooth_flags.h>
#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>

#include <optional>
#include <vector>
@@ -52,7 +52,7 @@ using ::aidl::android::hardware::bluetooth::audio::SessionType;
 ***/
std::unique_ptr<ProviderInfo> ProviderInfo::GetProviderInfo(
    bool supports_a2dp_hw_offload_v2) {
  if (!IS_FLAG_ENABLED(a2dp_offload_codec_extensibility)) {
  if (!com::android::bluetooth::flags::a2dp_offload_codec_extensibility()) {
    log::info(
        "a2dp offload codec extensibility is disabled,"
        " not going to load the ProviderInfo");
+3 −3
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@
#include "client_interface_aidl.h"

#include <android/binder_manager.h>
#include <android_bluetooth_flags.h>
#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>

#include <thread>
#include <vector>
@@ -101,7 +101,7 @@ BluetoothAudioClientInterface::GetProviderInfo(
    SessionType session_type,
    std::shared_ptr<IBluetoothAudioProviderFactory> provider_factory) {
  if (!is_aidl_available() ||
      !IS_FLAG_ENABLED(a2dp_offload_codec_extensibility)) {
      !com::android::bluetooth::flags::a2dp_offload_codec_extensibility()) {
    return std::nullopt;
  }

@@ -135,7 +135,7 @@ BluetoothAudioClientInterface::GetA2dpConfiguration(
    std::vector<A2dpRemoteCapabilities> const& remote_capabilities,
    A2dpConfigurationHint const& hint) const {
  if (!is_aidl_available() ||
      !IS_FLAG_ENABLED(a2dp_offload_codec_extensibility)) {
      !com::android::bluetooth::flags::a2dp_offload_codec_extensibility()) {
    return std::nullopt;
  }

+7 −6
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

#include "le_audio_software_aidl.h"

#include <android_bluetooth_flags.h>
#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>

#include <atomic>
#include <bitset>
@@ -199,7 +199,7 @@ void LeAudioTransport::SetLatencyMode(LatencyMode latency_mode) {
      return;
  }

  if (IS_FLAG_ENABLED(leaudio_dynamic_spatial_audio)) {
  if (com::android::bluetooth::flags::leaudio_dynamic_spatial_audio()) {
    if (dsa_mode_ != prev_dsa_mode &&
        cached_source_metadata_.tracks != nullptr &&
        cached_source_metadata_.tracks != 0) {
@@ -234,7 +234,7 @@ void LeAudioTransport::SourceMetadataChanged(
    return;
  }

  if (IS_FLAG_ENABLED(leaudio_dynamic_spatial_audio)) {
  if (com::android::bluetooth::flags::leaudio_dynamic_spatial_audio()) {
    if (cached_source_metadata_.tracks != nullptr) {
      free(cached_source_metadata_.tracks);
      cached_source_metadata_.tracks = nullptr;
@@ -342,7 +342,8 @@ bool LeAudioTransport::IsRequestCompletedAfterUpdate(
}

StartRequestState LeAudioTransport::GetStartRequestState(void) {
  if (IS_FLAG_ENABLED(leaudio_start_request_state_mutex_check)) {
  if (com::android::bluetooth::flags::
          leaudio_start_request_state_mutex_check()) {
    std::lock_guard<std::mutex> guard(start_request_state_mutex_);
  }
  return start_request_state_;
@@ -389,7 +390,7 @@ LeAudioSinkTransport::LeAudioSinkTransport(SessionType session_type,
LeAudioSinkTransport::~LeAudioSinkTransport() { delete transport_; }

BluetoothAudioCtrlAck LeAudioSinkTransport::StartRequest(bool is_low_latency) {
  if (IS_FLAG_ENABLED(leaudio_start_stream_race_fix)) {
  if (com::android::bluetooth::flags::leaudio_start_stream_race_fix()) {
    return transport_->StartRequestV2(is_low_latency);
  }
  return transport_->StartRequest(is_low_latency);
@@ -488,7 +489,7 @@ LeAudioSourceTransport::~LeAudioSourceTransport() { delete transport_; }

BluetoothAudioCtrlAck LeAudioSourceTransport::StartRequest(
    bool is_low_latency) {
  if (IS_FLAG_ENABLED(leaudio_start_stream_race_fix)) {
  if (com::android::bluetooth::flags::leaudio_start_stream_race_fix()) {
    return transport_->StartRequestV2(is_low_latency);
  }
  return transport_->StartRequest(is_low_latency);
Loading