Remove "Couldn't pair" prompt on ACTION_PAIRING_CANCEL am: 61ad5ae921 am: c0d1f46845

am: 5b0976d633

Change-Id: I966d5999a5800d1de6d0015ee4729407d1e37926
This commit is contained in:
Andre Eisenbach
2017-08-03 19:22:59 +00:00
committed by android-build-merger

View File

@@ -97,7 +97,6 @@ public class BluetoothEventManager {
// Pairing broadcasts
addHandler(BluetoothDevice.ACTION_BOND_STATE_CHANGED, new BondStateChangedHandler());
addHandler(BluetoothDevice.ACTION_PAIRING_CANCEL, new PairingCancelHandler());
// Fine-grained state broadcasts
addHandler(BluetoothDevice.ACTION_CLASS_CHANGED, new ClassChangedHandler());
@@ -344,24 +343,6 @@ public class BluetoothEventManager {
}
}
private class PairingCancelHandler implements Handler {
public void onReceive(Context context, Intent intent, BluetoothDevice device) {
if (device == null) {
Log.e(TAG, "ACTION_PAIRING_CANCEL with no EXTRA_DEVICE");
return;
}
CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
if (cachedDevice == null) {
Log.e(TAG, "ACTION_PAIRING_CANCEL with no cached device");
return;
}
int errorMsg = R.string.bluetooth_pairing_error_message;
if (context != null && cachedDevice != null) {
Utils.showError(context, cachedDevice.getName(), errorMsg);
}
}
}
private class DockEventHandler implements Handler {
public void onReceive(Context context, Intent intent, BluetoothDevice device) {
// Remove if unpair device upon undocking