OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h" | 5 #include "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/sys_info.h" | |
12 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" |
13 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.h" | 13 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.h" |
14 #include "dbus/exported_object.h" | 14 #include "dbus/exported_object.h" |
15 #include "dbus/message.h" | 15 #include "dbus/message.h" |
16 #include "third_party/cros_system_api/dbus/service_constants.h" | 16 #include "third_party/cros_system_api/dbus/service_constants.h" |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 namespace { | 19 namespace { |
20 const char kErrorInvalidArgs[] = | 20 const char kErrorInvalidArgs[] = |
21 "org.freedesktop.DBus.Error.InvalidArgs"; | 21 "org.freedesktop.DBus.Error.InvalidArgs"; |
22 const char kErrorPropertyReadOnly[] = | 22 const char kErrorPropertyReadOnly[] = |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 // static | 457 // static |
458 BluetoothGattCharacteristicServiceProvider* | 458 BluetoothGattCharacteristicServiceProvider* |
459 BluetoothGattCharacteristicServiceProvider::Create( | 459 BluetoothGattCharacteristicServiceProvider::Create( |
460 dbus::Bus* bus, | 460 dbus::Bus* bus, |
461 const dbus::ObjectPath& object_path, | 461 const dbus::ObjectPath& object_path, |
462 Delegate* delegate, | 462 Delegate* delegate, |
463 const std::string& uuid, | 463 const std::string& uuid, |
464 const std::vector<std::string>& flags, | 464 const std::vector<std::string>& flags, |
465 const std::vector<std::string>& permissions, | 465 const std::vector<std::string>& permissions, |
466 const dbus::ObjectPath& service_path) { | 466 const dbus::ObjectPath& service_path) { |
467 if (base::SysInfo::IsRunningOnChromeOS()) { | 467 if (!DBusThreadManager::IsUsingStub(DBusClientBundle::BLUETOOTH)) { |
468 return new BluetoothGattCharacteristicServiceProviderImpl( | 468 return new BluetoothGattCharacteristicServiceProviderImpl( |
469 bus, object_path, delegate, uuid, flags, permissions, service_path); | 469 bus, object_path, delegate, uuid, flags, permissions, service_path); |
470 } | 470 } |
471 return new FakeBluetoothGattCharacteristicServiceProvider( | 471 return new FakeBluetoothGattCharacteristicServiceProvider( |
472 object_path, delegate, uuid, flags, permissions, service_path); | 472 object_path, delegate, uuid, flags, permissions, service_path); |
473 } | 473 } |
474 | 474 |
475 } // namespace chromeos | 475 } // namespace chromeos |
OLD | NEW |