mPaired.RemoveDevice(btDevice);
if (mPaired.Count == 0)
{
- this.Remove(mPaired);
+ try
+ {
+ this.Remove(mPaired);
+ }
+ catch (Exception e)
+ {
+ Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message);
+ }
}
Log.Info(SettingBluetooth.LogTag, "device(" + btDevice.Address + ") removed in paired list");
}
}
break;
case BtDeviceState.Unpaired:
- if (mDeviceSource.FindInSearched(ev.BtDevice) == null)
- {
- // TODO: need to add in front of the list
- try
- {
- mDeviceSource.AddToSearched(ev.BtDevice);
- }
- catch (Exception e)
- {
- Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message);
- }
-
- }
if (mDeviceSource.FindInPaired(ev.BtDevice) != null)
{
mDeviceSource.RemoveFromPaired(ev.BtDevice);
+ AdapterController.AutoStart();
}
break;
case BtDeviceState.Connecting: