Loading src/com/android/settings/bluetooth/CachedBluetoothDevice.java +5 −7 Original line number Diff line number Diff line Loading @@ -63,8 +63,8 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { private boolean mLocalNapRoleConnected; private boolean mVisible; private boolean mDeviceRemove; // Whether device is unpaired and out of range private boolean mRemovable; private int mPhonebookPermissionChoice; private int mMessagePermissionChoice; Loading Loading @@ -403,10 +403,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } boolean isRemovable () { return mDeviceRemove; return mRemovable; } void setVisible(boolean visible) { if (mVisible != visible) { mVisible = visible; Loading @@ -415,10 +414,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } void setRemovable(boolean removable) { mDeviceRemove = removable; mRemovable = removable; } int getBondState() { return mDevice.getBondState(); } Loading src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +4 −5 Original line number Diff line number Diff line Loading @@ -140,7 +140,6 @@ final class CachedBluetoothDeviceManager { } public synchronized void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { Log.d(TAG,"onDeviceDeleted"); if (cachedDevice != null && cachedDevice.getBondState() == BluetoothDevice.BOND_NONE && cachedDevice.isRemovable()) { Loading src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java +15 −15 Original line number Diff line number Diff line Loading @@ -128,13 +128,13 @@ public abstract class DeviceListPreferenceFragment extends } } void removeOorDevices() { void removeOutOfRangeDevices() { Collection<CachedBluetoothDevice> cachedDevices = mLocalManager.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice cachedDevice : cachedDevices) { if (cachedDevice.getBondState() == BluetoothDevice.BOND_NONE && !cachedDevice.isVisible()) { Log.d(TAG, "Device Removed " + cachedDevice); Log.d(TAG, "Device " + cachedDevice + " went out of range"); BluetoothDevicePreference preference = mDevicePreferenceMap.get(cachedDevice); if (preference != null) { mDeviceListGroup.removePreference(preference); Loading Loading @@ -206,8 +206,8 @@ public abstract class DeviceListPreferenceFragment extends } public void onScanningStateChanged(boolean started) { if (started == false) { removeOorDevices(); if (!started) { removeOutOfRangeDevices(); } updateProgressUi(started); } Loading Loading
src/com/android/settings/bluetooth/CachedBluetoothDevice.java +5 −7 Original line number Diff line number Diff line Loading @@ -63,8 +63,8 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { private boolean mLocalNapRoleConnected; private boolean mVisible; private boolean mDeviceRemove; // Whether device is unpaired and out of range private boolean mRemovable; private int mPhonebookPermissionChoice; private int mMessagePermissionChoice; Loading Loading @@ -403,10 +403,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } boolean isRemovable () { return mDeviceRemove; return mRemovable; } void setVisible(boolean visible) { if (mVisible != visible) { mVisible = visible; Loading @@ -415,10 +414,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } void setRemovable(boolean removable) { mDeviceRemove = removable; mRemovable = removable; } int getBondState() { return mDevice.getBondState(); } Loading
src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +4 −5 Original line number Diff line number Diff line Loading @@ -140,7 +140,6 @@ final class CachedBluetoothDeviceManager { } public synchronized void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { Log.d(TAG,"onDeviceDeleted"); if (cachedDevice != null && cachedDevice.getBondState() == BluetoothDevice.BOND_NONE && cachedDevice.isRemovable()) { Loading
src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java +15 −15 Original line number Diff line number Diff line Loading @@ -128,13 +128,13 @@ public abstract class DeviceListPreferenceFragment extends } } void removeOorDevices() { void removeOutOfRangeDevices() { Collection<CachedBluetoothDevice> cachedDevices = mLocalManager.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice cachedDevice : cachedDevices) { if (cachedDevice.getBondState() == BluetoothDevice.BOND_NONE && !cachedDevice.isVisible()) { Log.d(TAG, "Device Removed " + cachedDevice); Log.d(TAG, "Device " + cachedDevice + " went out of range"); BluetoothDevicePreference preference = mDevicePreferenceMap.get(cachedDevice); if (preference != null) { mDeviceListGroup.removePreference(preference); Loading Loading @@ -206,8 +206,8 @@ public abstract class DeviceListPreferenceFragment extends } public void onScanningStateChanged(boolean started) { if (started == false) { removeOorDevices(); if (!started) { removeOutOfRangeDevices(); } updateProgressUi(started); } Loading