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:
@@ -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,12 +97,15 @@ 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
|
||||||
|
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||||
|
if (device.equals(mSelectedDevice)) {
|
||||||
sendDevicePickedIntent(device);
|
sendDevicePickedIntent(device);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -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();
|
||||||
|
Reference in New Issue
Block a user