Fix device picker minor bug
When in device picker screen, if other device triggers pairing process with own device, after paired succssfully, it should not send intent to OppReceiver to start file sending. We need check if the paired device is the one user selected. Original Author: Lixin Yue Modified by: Jaikumar Ganesh (jaikumar@google.com) Change-Id: I32df995ba94417470cccaead492844a9c61c0846
This commit is contained in:
committed by
Jaikumar Ganesh
parent
4b6b2aa123
commit
cd47ae6af2
@@ -71,6 +71,8 @@ public class BluetoothSettings extends PreferenceActivity
|
||||
private String mLaunchPackage;
|
||||
private String mLaunchClass;
|
||||
|
||||
private BluetoothDevice mSelectedDevice= null;
|
||||
|
||||
private LocalBluetoothManager mLocalManager;
|
||||
|
||||
private BluetoothEnabler mEnabler;
|
||||
@@ -95,9 +97,12 @@ public class BluetoothSettings extends PreferenceActivity
|
||||
int bondState = intent
|
||||
.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
|
||||
if (bondState == BluetoothDevice.BOND_BONDED) {
|
||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
sendDevicePickedIntent(device);
|
||||
finish();
|
||||
BluetoothDevice device = intent
|
||||
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
if (device.equals(mSelectedDevice)) {
|
||||
sendDevicePickedIntent(device);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,9 +254,10 @@ public class BluetoothSettings extends PreferenceActivity
|
||||
} else if (mScreenType == SCREEN_TYPE_DEVICEPICKER) {
|
||||
CachedBluetoothDevice device = btPreference.getCachedDevice();
|
||||
|
||||
if ((device.getBondState() == BluetoothDevice.BOND_BONDED) || (mNeedAuth == false)) {
|
||||
BluetoothDevice btAddress = btPreference.getCachedDevice().getDevice();
|
||||
sendDevicePickedIntent(btAddress);
|
||||
mSelectedDevice = device.getDevice();
|
||||
if ((device.getBondState() == BluetoothDevice.BOND_BONDED) ||
|
||||
(mNeedAuth == false)) {
|
||||
sendDevicePickedIntent(mSelectedDevice);
|
||||
finish();
|
||||
} else {
|
||||
btPreference.getCachedDevice().onClicked();
|
||||
|
Reference in New Issue
Block a user