From: PF4Public@users.noreply.github.com License: BSD Subject: Fix building with use_bluez=false This is a quick and dirty fix for building chromium with use_bluez=false It prevents initialization and usage of Bluetooth by the browser It is not supposed to be applied for use_bluez=true WebAuthn is prevented from using Bluetooth, but it might still work with USB see also https://github.com/PF4Public/gentoo-overlay/issues/254 --- --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc @@ -68,8 +68,8 @@ void ChromeBrowserMainPartsLinux::PostCr #if !BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(USE_DBUS) - bluez::BluezDBusManager::Initialize( - dbus_thread_linux::GetSharedSystemBus().get()); + //bluez::BluezDBusManager::Initialize( + // dbus_thread_linux::GetSharedSystemBus().get()); #endif // BUILDFLAG(USE_DBUS) // Set up crypt config. This needs to be done before anything starts the @@ -137,7 +137,7 @@ void ChromeBrowserMainPartsLinux::PostDe #if BUILDFLAG(IS_CHROMEOS) // No-op; per PostBrowserStart() comment, this is done elsewhere. #else - bluez::BluezDBusManager::Shutdown(); + //bluez::BluezDBusManager::Shutdown(); #endif // BUILDFLAG(IS_CHROMEOS) ChromeBrowserMainPartsPosix::PostDestroyThreads(); --- a/chrome/browser/metrics/bluetooth_metrics_provider.cc +++ b/chrome/browser/metrics/bluetooth_metrics_provider.cc @@ -16,9 +16,7 @@ BluetoothMetricsProvider::~BluetoothMetr bool BluetoothMetricsProvider::ProvideHistograms() { base::UmaHistogramEnumeration("Bluetooth.StackName", - floss::features::IsFlossEnabled() - ? BluetoothStackName::kFloss - : BluetoothStackName::kBlueZ); + BluetoothStackName::kBlueZ); return true; } --- a/device/bluetooth/bluetooth_adapter_factory.cc +++ b/device/bluetooth/bluetooth_adapter_factory.cc @@ -48,6 +48,7 @@ static constexpr bool kBluetoothSupporte bool BluetoothAdapterFactory::IsBluetoothSupported() { // SetAdapterForTesting() may be used to provide a test or mock adapter // instance even on platforms that would otherwise not support it. + return false; if (Get()->adapter_) { return true; } @@ -55,6 +56,7 @@ bool BluetoothAdapterFactory::IsBluetoot } bool BluetoothAdapterFactory::IsLowEnergySupported() { + return false; if (override_values_) { return override_values_->GetLESupported(); }