am 7b576e49: Merge change 27058 into eclair

Merge commit '7b576e491718e9a6d3f0f66421eddbdfaa853d87' into eclair-plus-aosp

* commit '7b576e491718e9a6d3f0f66421eddbdfaa853d87':
  Fix device picker minor bug
This commit is contained in:
Lixin Yue
2009-09-28 13:19:05 -07:00
committed by Android Git Automerger

View File

@@ -71,6 +71,8 @@ public class BluetoothSettings extends PreferenceActivity
private String mLaunchPackage; private String mLaunchPackage;
private String mLaunchClass; private String mLaunchClass;
private BluetoothDevice mSelectedDevice= null;
private LocalBluetoothManager mLocalManager; private LocalBluetoothManager mLocalManager;
private BluetoothEnabler mEnabler; private BluetoothEnabler mEnabler;
@@ -95,9 +97,12 @@ public class BluetoothSettings extends PreferenceActivity
int bondState = intent int bondState = intent
.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR); .getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
if (bondState == BluetoothDevice.BOND_BONDED) { if (bondState == BluetoothDevice.BOND_BONDED) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); BluetoothDevice device = intent
sendDevicePickedIntent(device); .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
finish(); if (device.equals(mSelectedDevice)) {
sendDevicePickedIntent(device);
finish();
}
} }
} }
} }
@@ -249,9 +254,10 @@ public class BluetoothSettings extends PreferenceActivity
} else if (mScreenType == SCREEN_TYPE_DEVICEPICKER) { } else if (mScreenType == SCREEN_TYPE_DEVICEPICKER) {
CachedBluetoothDevice device = btPreference.getCachedDevice(); CachedBluetoothDevice device = btPreference.getCachedDevice();
if ((device.getBondState() == BluetoothDevice.BOND_BONDED) || (mNeedAuth == false)) { mSelectedDevice = device.getDevice();
BluetoothDevice btAddress = btPreference.getCachedDevice().getDevice(); if ((device.getBondState() == BluetoothDevice.BOND_BONDED) ||
sendDevicePickedIntent(btAddress); (mNeedAuth == false)) {
sendDevicePickedIntent(mSelectedDevice);
finish(); finish();
} else { } else {
btPreference.getCachedDevice().onClicked(); btPreference.getCachedDevice().onClicked();