diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-09-29 10:31:02 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-09-29 10:31:02 -0700 |
commit | 2dfe1011497b743d4d1fa7786610bc9271ae6d0e (patch) | |
tree | 5ae3c6e4cbb22426dc94b0bedabb0ceef4ba9625 /core/java | |
parent | 4fc3d2f0b3237390c37ccc4701bc68e4aa5f9b7a (diff) | |
download | frameworks_base-2dfe1011497b743d4d1fa7786610bc9271ae6d0e.zip frameworks_base-2dfe1011497b743d4d1fa7786610bc9271ae6d0e.tar.gz frameworks_base-2dfe1011497b743d4d1fa7786610bc9271ae6d0e.tar.bz2 |
Update local cache before sending intent.
Change-Id: I0e016cae3070b1811dd68958afb8a8501081097d
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/server/BluetoothEventLoop.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index e05fe7b..bcb151a 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -225,10 +225,10 @@ class BluetoothEventLoop { } String name = propValues[0]; if (name.equals("Name")) { + mBluetoothService.setProperty(name, propValues[1]); Intent intent = new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED); intent.putExtra(BluetoothAdapter.EXTRA_LOCAL_NAME, propValues[1]); mContext.sendBroadcast(intent, BLUETOOTH_PERM); - mBluetoothService.setProperty(name, propValues[1]); } else if (name.equals("Pairable") || name.equals("Discoverable")) { String pairable = name.equals("Pairable") ? propValues[1] : mBluetoothService.getPropertyInternal("Pairable"); @@ -239,6 +239,7 @@ class BluetoothEventLoop { if (pairable == null || discoverable == null) return; + mBluetoothService.setProperty(name, propValues[1]); int mode = BluetoothService.bluezStringToScanMode( pairable.equals("true"), discoverable.equals("true")); @@ -248,9 +249,9 @@ class BluetoothEventLoop { intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); mContext.sendBroadcast(intent, BLUETOOTH_PERM); } - mBluetoothService.setProperty(name, propValues[1]); } else if (name.equals("Discovering")) { Intent intent; + mBluetoothService.setProperty(name, propValues[1]); if (propValues[1].equals("true")) { mBluetoothService.setIsDiscovering(true); intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_STARTED); @@ -261,7 +262,6 @@ class BluetoothEventLoop { intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); } mContext.sendBroadcast(intent, BLUETOOTH_PERM); - mBluetoothService.setProperty(name, propValues[1]); } else if (name.equals("Devices")) { String value = null; int len = Integer.valueOf(propValues[1]); @@ -294,19 +294,20 @@ class BluetoothEventLoop { } BluetoothDevice device = mAdapter.getRemoteDevice(address); if (name.equals("Name")) { + mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); Intent intent = new Intent(BluetoothDevice.ACTION_NAME_CHANGED); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.putExtra(BluetoothDevice.EXTRA_NAME, propValues[1]); mContext.sendBroadcast(intent, BLUETOOTH_PERM); - mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); } else if (name.equals("Class")) { + mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); Intent intent = new Intent(BluetoothDevice.ACTION_CLASS_CHANGED); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.putExtra(BluetoothDevice.EXTRA_CLASS, new BluetoothClass(Integer.valueOf(propValues[1]))); mContext.sendBroadcast(intent, BLUETOOTH_PERM); - mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); } else if (name.equals("Connected")) { + mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); Intent intent = null; if (propValues[1].equals("true")) { intent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); @@ -320,7 +321,6 @@ class BluetoothEventLoop { } intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); mContext.sendBroadcast(intent, BLUETOOTH_PERM); - mBluetoothService.setRemoteDeviceProperty(address, name, propValues[1]); } else if (name.equals("UUIDs")) { String uuid = null; int len = Integer.valueOf(propValues[1]); |