Fix multiple BT settings bugs.

- Change Bluetooth profiles screen to match ICS wireframes
- Remove BluetoothProfilePreference.java (no longer used)
- Remove "Pair with this device" summary below every unpaired device
- Remove "Paired but not connected" summary below unconnected paired devices
- Fix auto connection after pairing (reuse existing CachedBluetoothDevice)
- Add "Connected (no phone/media)" summaries based on ICS wireframes
- Fix visibility timeout strings.
- Fix crash when starting Bluetooth from Settings shortcut widget.

Bug: 5064139
Bug: 5064324
Bug: 5080404
Bug: 5093513
Bug: 5104485
Change-Id: Ie87103e183ce414c86cb1831a38ef0178b1b1292
This commit is contained in:
Jake Hamby
2011-08-01 16:36:35 -07:00
parent 0c8ff2b3ce
commit 79be0b3e6b
18 changed files with 157 additions and 314 deletions

View File

@@ -26,7 +26,6 @@ import java.util.List;
* CachedBluetoothDeviceManager manages the set of remote Bluetooth devices.
*/
final class CachedBluetoothDeviceManager {
// private static final String TAG = "CachedBluetoothDeviceManager";
private final List<CachedBluetoothDevice> mCachedDevices =
new ArrayList<CachedBluetoothDevice>();
@@ -35,20 +34,9 @@ final class CachedBluetoothDeviceManager {
return new ArrayList<CachedBluetoothDevice>(mCachedDevices);
}
public boolean onDeviceDisappeared(CachedBluetoothDevice cachedDevice) {
public static boolean onDeviceDisappeared(CachedBluetoothDevice cachedDevice) {
cachedDevice.setVisible(false);
return checkForDeviceRemoval(cachedDevice);
}
private boolean checkForDeviceRemoval(
CachedBluetoothDevice cachedDevice) {
if (cachedDevice.getBondState() == BluetoothDevice.BOND_NONE &&
!cachedDevice.isVisible()) {
// If device isn't paired, remove it altogether
mCachedDevices.remove(cachedDevice);
return true; // dispatch device deleted
}
return false;
return cachedDevice.getBondState() == BluetoothDevice.BOND_NONE;
}
public void onDeviceNameUpdated(BluetoothDevice device) {
@@ -120,7 +108,6 @@ final class CachedBluetoothDeviceManager {
for (int i = mCachedDevices.size() - 1; i >= 0; i--) {
CachedBluetoothDevice cachedDevice = mCachedDevices.get(i);
cachedDevice.setVisible(false);
checkForDeviceRemoval(cachedDevice);
}
}