OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "device/bluetooth/bluez/bluetooth_device_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_device_bluez.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 void BluetoothDeviceBlueZ::OnSetTrusted(bool success) { | 944 void BluetoothDeviceBlueZ::OnSetTrusted(bool success) { |
945 device_event_log::LogLevel log_level = | 945 device_event_log::LogLevel log_level = |
946 success ? device_event_log::LOG_LEVEL_DEBUG | 946 success ? device_event_log::LOG_LEVEL_DEBUG |
947 : device_event_log::LOG_LEVEL_ERROR; | 947 : device_event_log::LOG_LEVEL_ERROR; |
948 DEVICE_LOG(device_event_log::LOG_TYPE_BLUETOOTH, log_level) | 948 DEVICE_LOG(device_event_log::LOG_TYPE_BLUETOOTH, log_level) |
949 << object_path_.value() << ": OnSetTrusted: " << success; | 949 << object_path_.value() << ": OnSetTrusted: " << success; |
950 } | 950 } |
951 | 951 |
952 void BluetoothDeviceBlueZ::OnDisconnect(const base::Closure& callback) { | 952 void BluetoothDeviceBlueZ::OnDisconnect(const base::Closure& callback) { |
953 BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Disconnected"; | 953 BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Disconnected"; |
954 // Do not notify about changed device since this is already done by | |
955 // the dbus::PropertySet and the property change callback for BlueZ. | |
956 DidDisconnectGatt(false /* notifyDeviceChanged */); | |
957 callback.Run(); | 954 callback.Run(); |
958 } | 955 } |
959 | 956 |
960 void BluetoothDeviceBlueZ::OnDisconnectError( | 957 void BluetoothDeviceBlueZ::OnDisconnectError( |
961 const ErrorCallback& error_callback, | 958 const ErrorCallback& error_callback, |
962 const std::string& error_name, | 959 const std::string& error_name, |
963 const std::string& error_message) { | 960 const std::string& error_message) { |
964 BLUETOOTH_LOG(ERROR) << object_path_.value() | 961 BLUETOOTH_LOG(ERROR) << object_path_.value() |
965 << ": Failed to disconnect device: " << error_name | 962 << ": Failed to disconnect device: " << error_name |
966 << ": " << error_message; | 963 << ": " << error_message; |
967 error_callback.Run(); | 964 error_callback.Run(); |
968 } | 965 } |
969 | 966 |
970 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, | 967 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, |
971 const std::string& error_name, | 968 const std::string& error_name, |
972 const std::string& error_message) { | 969 const std::string& error_message) { |
973 BLUETOOTH_LOG(ERROR) << object_path_.value() | 970 BLUETOOTH_LOG(ERROR) << object_path_.value() |
974 << ": Failed to remove device: " << error_name << ": " | 971 << ": Failed to remove device: " << error_name << ": " |
975 << error_message; | 972 << error_message; |
976 error_callback.Run(); | 973 error_callback.Run(); |
977 } | 974 } |
978 | 975 |
979 } // namespace bluez | 976 } // namespace bluez |
OLD | NEW |