Commit cac7f08e authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

bluetooth: Make BluetoothSystem ChromeOS specific

BluetoothSystem will only be implemented on Chrome OS.

Bug: 870192
Change-Id: I0a16a15ee6f15653d19d30d76a7d109235f34e86
Reviewed-on: https://chromium-review.googlesource.com/1233313Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592586}
parent c74f09ab
...@@ -27,7 +27,6 @@ source_set("lib") { ...@@ -27,7 +27,6 @@ source_set("lib") {
deps = [ deps = [
"//base", "//base",
"//services/device/bluetooth",
"//services/device/fingerprint", "//services/device/fingerprint",
"//services/device/generic_sensor", "//services/device/generic_sensor",
"//services/device/geolocation", "//services/device/geolocation",
...@@ -52,7 +51,10 @@ source_set("lib") { ...@@ -52,7 +51,10 @@ source_set("lib") {
} }
if (is_chromeos && use_dbus) { if (is_chromeos && use_dbus) {
deps += [ "//services/device/media_transfer_protocol" ] deps += [
"//services/device/bluetooth:bluetooth_system",
"//services/device/media_transfer_protocol",
]
} }
if (is_serial_enabled_platform) { if (is_serial_enabled_platform) {
...@@ -110,7 +112,6 @@ source_set("tests") { ...@@ -110,7 +112,6 @@ source_set("tests") {
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//net", "//net",
"//net:test_support", "//net:test_support",
"//services/device/bluetooth:tests",
"//services/device/generic_sensor", "//services/device/generic_sensor",
"//services/device/geolocation", "//services/device/geolocation",
"//services/device/geolocation:test_support", "//services/device/geolocation:test_support",
...@@ -142,6 +143,7 @@ source_set("tests") { ...@@ -142,6 +143,7 @@ source_set("tests") {
deps += [ deps += [
"//chromeos", "//chromeos",
"//dbus", "//dbus",
"//services/device/bluetooth:bluetooth_system_tests",
"//services/device/fingerprint", "//services/device/fingerprint",
"//third_party/protobuf:protobuf_lite", "//third_party/protobuf:protobuf_lite",
] ]
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
import("//build/config/features.gni") import("//build/config/features.gni")
source_set("bluetooth") { source_set("bluetooth_system") {
visibility = [ visibility = [
"//services/device:lib", "//services/device:lib",
"//services/device/bluetooth:tests", "//services/device/bluetooth:bluetooth_system_tests",
] ]
sources = [ sources = [
...@@ -26,7 +26,7 @@ source_set("bluetooth") { ...@@ -26,7 +26,7 @@ source_set("bluetooth") {
] ]
} }
source_set("tests") { source_set("bluetooth_system_tests") {
testonly = true testonly = true
sources = [ sources = [
...@@ -34,7 +34,7 @@ source_set("tests") { ...@@ -34,7 +34,7 @@ source_set("tests") {
] ]
deps = [ deps = [
":bluetooth", ":bluetooth_system",
"//net", "//net",
"//services/device:test_support", "//services/device:test_support",
"//testing/gtest", "//testing/gtest",
......
...@@ -114,9 +114,6 @@ DeviceService::~DeviceService() { ...@@ -114,9 +114,6 @@ DeviceService::~DeviceService() {
} }
void DeviceService::OnStart() { void DeviceService::OnStart() {
registry_.AddInterface<mojom::BluetoothSystemFactory>(
base::BindRepeating(&DeviceService::BindBluetoothSystemFactoryRequest,
base::Unretained(this)));
registry_.AddInterface<mojom::Fingerprint>(base::Bind( registry_.AddInterface<mojom::Fingerprint>(base::Bind(
&DeviceService::BindFingerprintRequest, base::Unretained(this))); &DeviceService::BindFingerprintRequest, base::Unretained(this)));
registry_.AddInterface<mojom::GeolocationConfig>(base::BindRepeating( registry_.AddInterface<mojom::GeolocationConfig>(base::BindRepeating(
...@@ -165,6 +162,9 @@ void DeviceService::OnStart() { ...@@ -165,6 +162,9 @@ void DeviceService::OnStart() {
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
registry_.AddInterface<mojom::BluetoothSystemFactory>(
base::BindRepeating(&DeviceService::BindBluetoothSystemFactoryRequest,
base::Unretained(this)));
registry_.AddInterface<mojom::MtpManager>(base::BindRepeating( registry_.AddInterface<mojom::MtpManager>(base::BindRepeating(
&DeviceService::BindMtpManagerRequest, base::Unretained(this))); &DeviceService::BindMtpManagerRequest, base::Unretained(this)));
#endif #endif
...@@ -182,11 +182,6 @@ void DeviceService::OnBindInterface( ...@@ -182,11 +182,6 @@ void DeviceService::OnBindInterface(
registry_.BindInterface(interface_name, std::move(interface_pipe)); registry_.BindInterface(interface_name, std::move(interface_pipe));
} }
void DeviceService::BindBluetoothSystemFactoryRequest(
mojom::BluetoothSystemFactoryRequest request) {
BluetoothSystemFactory::CreateFactory(std::move(request));
}
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
void DeviceService::BindBatteryMonitorRequest( void DeviceService::BindBatteryMonitorRequest(
mojom::BatteryMonitorRequest request) { mojom::BatteryMonitorRequest request) {
...@@ -211,6 +206,11 @@ void DeviceService::BindVibrationManagerRequest( ...@@ -211,6 +206,11 @@ void DeviceService::BindVibrationManagerRequest(
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void DeviceService::BindBluetoothSystemFactoryRequest(
mojom::BluetoothSystemFactoryRequest request) {
BluetoothSystemFactory::CreateFactory(std::move(request));
}
void DeviceService::BindMtpManagerRequest(mojom::MtpManagerRequest request) { void DeviceService::BindMtpManagerRequest(mojom::MtpManagerRequest request) {
if (!mtp_device_manager_) if (!mtp_device_manager_)
mtp_device_manager_ = MtpDeviceManager::Initialize(); mtp_device_manager_ = MtpDeviceManager::Initialize();
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "services/device/geolocation/geolocation_provider_impl.h" #include "services/device/geolocation/geolocation_provider_impl.h"
#include "services/device/geolocation/public_ip_address_geolocation_provider.h" #include "services/device/geolocation/public_ip_address_geolocation_provider.h"
#include "services/device/public/mojom/battery_monitor.mojom.h" #include "services/device/public/mojom/battery_monitor.mojom.h"
#include "services/device/public/mojom/bluetooth_system.mojom.h"
#include "services/device/public/mojom/fingerprint.mojom.h" #include "services/device/public/mojom/fingerprint.mojom.h"
#include "services/device/public/mojom/geolocation.mojom.h" #include "services/device/public/mojom/geolocation.mojom.h"
#include "services/device/public/mojom/geolocation_config.mojom.h" #include "services/device/public/mojom/geolocation_config.mojom.h"
...@@ -42,6 +41,7 @@ ...@@ -42,6 +41,7 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "services/device/media_transfer_protocol/mtp_device_manager.h" #include "services/device/media_transfer_protocol/mtp_device_manager.h"
#include "services/device/public/mojom/bluetooth_system.mojom.h"
#endif #endif
#if defined(OS_LINUX) && defined(USE_UDEV) #if defined(OS_LINUX) && defined(USE_UDEV)
...@@ -114,8 +114,6 @@ class DeviceService : public service_manager::Service { ...@@ -114,8 +114,6 @@ class DeviceService : public service_manager::Service {
const std::string& interface_name, const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override; mojo::ScopedMessagePipeHandle interface_pipe) override;
void BindBluetoothSystemFactoryRequest(
mojom::BluetoothSystemFactoryRequest request);
void BindFingerprintRequest(mojom::FingerprintRequest request); void BindFingerprintRequest(mojom::FingerprintRequest request);
void BindGeolocationConfigRequest(mojom::GeolocationConfigRequest request); void BindGeolocationConfigRequest(mojom::GeolocationConfigRequest request);
void BindGeolocationContextRequest(mojom::GeolocationContextRequest request); void BindGeolocationContextRequest(mojom::GeolocationContextRequest request);
...@@ -133,6 +131,8 @@ class DeviceService : public service_manager::Service { ...@@ -133,6 +131,8 @@ class DeviceService : public service_manager::Service {
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void BindBluetoothSystemFactoryRequest(
mojom::BluetoothSystemFactoryRequest request);
void BindMtpManagerRequest(mojom::MtpManagerRequest request); void BindMtpManagerRequest(mojom::MtpManagerRequest request);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment