From 512fb0ca900128cb682491a7f85e20c17edd8481 Mon Sep 17 00:00:00 2001 From: Pavlin Radoslavov Date: Wed, 17 Jun 2015 17:01:23 -0700 Subject: [PATCH] Sync the Bluetooth name and address from the Bluetooth Adapter It looks like the synchronization of the Bluetooth name and address from the Bluetooth Adapter has been removed by the following commit without an explanation: Bluetooth LE background operation mode (2/2) As a result, the BluetoothManagerService.mAddress was always null. Bug: 20545952 Change-Id: I595f370e06e17b2c67ce511f793efdee7674598c --- services/core/java/com/android/server/BluetoothManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java index fbb6dc9bb969..f9f67144d89e 100644 --- a/services/core/java/com/android/server/BluetoothManagerService.java +++ b/services/core/java/com/android/server/BluetoothManagerService.java @@ -237,6 +237,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub { sendEnableMsg(mQuietEnableExternal); } } + + if (!isNameAndAddressSet()) { + // Sync the Bluetooth name and address from the Bluetooth Adapter + if (DBG) Log.d(TAG,"Retrieving Bluetooth Adapter name and address..."); + getNameAndAddress(); + } } } }; -- 2.11.0