Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +0 −2 Original line number Diff line number Diff line Loading @@ -274,7 +274,6 @@ public class BluetoothEventManager { public void onReceive(Context context, Intent intent, BluetoothDevice device) { short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE); BluetoothClass btClass = intent.getParcelableExtra(BluetoothDevice.EXTRA_CLASS); String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); // TODO Pick up UUID. They should be available for 2.1 devices. // Skip for now, there's a bluez problem and we are not getting uuids even for 2.1. Loading @@ -285,7 +284,6 @@ public class BluetoothEventManager { + cachedDevice); } cachedDevice.setRssi(rssi); cachedDevice.setBtClass(btClass); cachedDevice.setJustDiscovered(true); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +2 −28 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> private long mHiSyncId; // Need this since there is no method for getting RSSI private short mRssi; //TODO: consider remove, BluetoothDevice.getBluetoothClass() is already cached private BluetoothClass mBtClass; private HashMap<LocalBluetoothProfile, Integer> mProfileConnectionState; private final List<LocalBluetoothProfile> mProfiles = Loading Loading @@ -374,7 +372,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> // TODO: do any of these need to run async on a background thread? private void fillData() { fetchBtClass(); updateProfiles(); fetchActiveDevices(); migratePhonebookPermissionChoice(); Loading Loading @@ -587,13 +584,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> return getBondState() == BluetoothDevice.BOND_BONDING; } /** * Fetches a new value for the cached BT class. */ private void fetchBtClass() { mBtClass = mDevice.getBluetoothClass(); } private boolean updateProfiles() { ParcelUuid[] uuids = mDevice.getUuids(); if (uuids == null) return false; Loading Loading @@ -637,15 +627,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } /** * Refreshes the UI for the BT class, including fetching the latest value * for the class. */ void refreshBtClass() { fetchBtClass(); dispatchAttributesChanged(); } /** * Refreshes the UI when framework alerts us of a UUID change. */ Loading Loading @@ -696,15 +677,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } void setBtClass(BluetoothClass btClass) { if (btClass != null && mBtClass != btClass) { mBtClass = btClass; dispatchAttributesChanged(); } } public BluetoothClass getBtClass() { return mBtClass; return mDevice.getBluetoothClass(); } public List<LocalBluetoothProfile> getProfiles() { Loading Loading @@ -738,7 +712,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } private void dispatchAttributesChanged() { void dispatchAttributesChanged() { synchronized (mCallbacks) { for (Callback callback : mCallbacks) { callback.onDeviceAttributesChanged(); Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ public class CachedBluetoothDeviceManager { public synchronized void onBtClassChanged(BluetoothDevice device) { CachedBluetoothDevice cachedDevice = findDevice(device); if (cachedDevice != null) { cachedDevice.refreshBtClass(); cachedDevice.dispatchAttributesChanged(); } } Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +0 −2 Original line number Diff line number Diff line Loading @@ -274,7 +274,6 @@ public class BluetoothEventManager { public void onReceive(Context context, Intent intent, BluetoothDevice device) { short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE); BluetoothClass btClass = intent.getParcelableExtra(BluetoothDevice.EXTRA_CLASS); String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); // TODO Pick up UUID. They should be available for 2.1 devices. // Skip for now, there's a bluez problem and we are not getting uuids even for 2.1. Loading @@ -285,7 +284,6 @@ public class BluetoothEventManager { + cachedDevice); } cachedDevice.setRssi(rssi); cachedDevice.setBtClass(btClass); cachedDevice.setJustDiscovered(true); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +2 −28 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> private long mHiSyncId; // Need this since there is no method for getting RSSI private short mRssi; //TODO: consider remove, BluetoothDevice.getBluetoothClass() is already cached private BluetoothClass mBtClass; private HashMap<LocalBluetoothProfile, Integer> mProfileConnectionState; private final List<LocalBluetoothProfile> mProfiles = Loading Loading @@ -374,7 +372,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> // TODO: do any of these need to run async on a background thread? private void fillData() { fetchBtClass(); updateProfiles(); fetchActiveDevices(); migratePhonebookPermissionChoice(); Loading Loading @@ -587,13 +584,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> return getBondState() == BluetoothDevice.BOND_BONDING; } /** * Fetches a new value for the cached BT class. */ private void fetchBtClass() { mBtClass = mDevice.getBluetoothClass(); } private boolean updateProfiles() { ParcelUuid[] uuids = mDevice.getUuids(); if (uuids == null) return false; Loading Loading @@ -637,15 +627,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } /** * Refreshes the UI for the BT class, including fetching the latest value * for the class. */ void refreshBtClass() { fetchBtClass(); dispatchAttributesChanged(); } /** * Refreshes the UI when framework alerts us of a UUID change. */ Loading Loading @@ -696,15 +677,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } void setBtClass(BluetoothClass btClass) { if (btClass != null && mBtClass != btClass) { mBtClass = btClass; dispatchAttributesChanged(); } } public BluetoothClass getBtClass() { return mBtClass; return mDevice.getBluetoothClass(); } public List<LocalBluetoothProfile> getProfiles() { Loading Loading @@ -738,7 +712,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } } private void dispatchAttributesChanged() { void dispatchAttributesChanged() { synchronized (mCallbacks) { for (Callback callback : mCallbacks) { callback.onDeviceAttributesChanged(); Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ public class CachedBluetoothDeviceManager { public synchronized void onBtClassChanged(BluetoothDevice device) { CachedBluetoothDevice cachedDevice = findDevice(device); if (cachedDevice != null) { cachedDevice.refreshBtClass(); cachedDevice.dispatchAttributesChanged(); } } Loading