diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java index a91c45dd59af9..a842229090725 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java @@ -57,9 +57,7 @@ public interface BluetoothCallback { default void onDeviceAdded(CachedBluetoothDevice cachedDevice) {} /** - * It will be called when a remote device that was - * found in the last discovery and is not found in the current discovery. - * It is listening {@link android.bluetooth.BluetoothDevice#ACTION_DISAPPEARED} + * It will be called when requiring to remove a remote device from CachedBluetoothDevice list * * @param cachedDevice the Bluetooth device. */ diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java index ac08f6aed0297..25e683100ee89 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java @@ -81,7 +81,6 @@ public class BluetoothEventManager { addHandler(BluetoothAdapter.ACTION_DISCOVERY_STARTED, new ScanningStateChangedHandler(true)); addHandler(BluetoothAdapter.ACTION_DISCOVERY_FINISHED, new ScanningStateChangedHandler(false)); addHandler(BluetoothDevice.ACTION_FOUND, new DeviceFoundHandler()); - addHandler(BluetoothDevice.ACTION_DISAPPEARED, new DeviceDisappearedHandler()); addHandler(BluetoothDevice.ACTION_NAME_CHANGED, new NameChangedHandler()); addHandler(BluetoothDevice.ACTION_ALIAS_CHANGED, new NameChangedHandler()); @@ -299,24 +298,6 @@ public class BluetoothEventManager { } } - private class DeviceDisappearedHandler implements Handler { - public void onReceive(Context context, Intent intent, - BluetoothDevice device) { - CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); - if (cachedDevice == null) { - Log.w(TAG, "received ACTION_DISAPPEARED for an unknown device: " + device); - return; - } - if (CachedBluetoothDeviceManager.onDeviceDisappeared(cachedDevice)) { - synchronized (mCallbacks) { - for (BluetoothCallback callback : mCallbacks) { - callback.onDeviceDeleted(cachedDevice); - } - } - } - } - } - private class NameChangedHandler implements Handler { public void onReceive(Context context, Intent intent, BluetoothDevice device) {