Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: chromeos/dbus/fake_bluetooth_profile_manager_client.cc

Issue 935383003: Fix BluetoothAdapterProfileChromeOS lifecycle management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments, fix simultaneous useprofile Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/fake_bluetooth_profile_manager_client.cc
diff --git a/chromeos/dbus/fake_bluetooth_profile_manager_client.cc b/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
index 2839ddd8cbbc27725dd517b920e900a649d5f816..8d702214d765a06a55f2820b24abbb53cf738d41 100644
--- a/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
+++ b/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
@@ -23,6 +23,8 @@ const char FakeBluetoothProfileManagerClient::kL2capUuid[] =
"4d995052-33cc-4fdf-b446-75f32942a076";
const char FakeBluetoothProfileManagerClient::kRfcommUuid[] =
"3f6d6dbf-a6ad-45fc-9653-47dc912ef70e";
+const char FakeBluetoothProfileManagerClient::kUnregisterableUuid[] =
+ "00000000-0000-0000-0000-000000000000";
FakeBluetoothProfileManagerClient::FakeBluetoothProfileManagerClient() {
}
@@ -41,6 +43,14 @@ void FakeBluetoothProfileManagerClient::RegisterProfile(
const ErrorCallback& error_callback) {
VLOG(1) << "RegisterProfile: " << profile_path.value() << ": " << uuid;
+ if (uuid == kUnregisterableUuid) {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(error_callback,
+ bluetooth_profile_manager::kErrorInvalidArguments,
+ "Can't register this UUID"));
+ return;
+ }
+
// check options for channel & psm
ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path);

Powered by Google App Engine
This is Rietveld 408576698