summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib
diff options
context:
space:
mode:
authorGaurav Asati <gasati@codeaurora.org>2015-08-14 10:05:52 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:27:27 -0600
commit72e450e147b21bf8ac921706935e7ee245f7a44c (patch)
treeb34e3752aa2d3f9f3e45c1a302d939815692c0af /packages/SettingsLib
parenta525a4cecac1bca39a27ed0ddfca5cacf1000194 (diff)
downloadframeworks_base-72e450e147b21bf8ac921706935e7ee245f7a44c.zip
frameworks_base-72e450e147b21bf8ac921706935e7ee245f7a44c.tar.gz
frameworks_base-72e450e147b21bf8ac921706935e7ee245f7a44c.tar.bz2
Bluetooth: Don't Initiate Connection if UUID not updated
- if UUIDs are not updated don't initiate profile connection - add new profiles to already existing list - don't delete profiles from the existing list CRs-Fixed: 717840 Change-Id: I7dc4fc693993d96821acb69d5ecaa44857853273
Diffstat (limited to 'packages/SettingsLib')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index ac5a4ab..f6d787c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -521,7 +521,29 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe
* Refreshes the UI when framework alerts us of a UUID change.
*/
void onUuidChanged() {
+ Log.d(TAG, " onUuidChanged, mProfile Size " + mProfiles.size());
+ List<LocalBluetoothProfile> mPrevProfiles =
+ new ArrayList<LocalBluetoothProfile>();
+ mPrevProfiles.clear();
+ mPrevProfiles.addAll(mProfiles);
updateProfiles();
+ /*
+ * Check if new profiles are added
+ */
+ if ((mPrevProfiles.containsAll(mProfiles)) && (!mPrevProfiles.isEmpty())) {
+ Log.d(TAG,"UUID not udpated, returning");
+ mProfiles.clear();
+ mProfiles.addAll(mPrevProfiles);
+ return;
+ }
+ for (int i = 0; i<mProfiles.size(); ++i) {
+ if (!mPrevProfiles.contains(mProfiles.get(i))) {
+ mPrevProfiles.add(mProfiles.get(i));
+ }
+ }
+ mProfiles.clear();
+ mProfiles.addAll(mPrevProfiles);
+
ParcelUuid[] uuids = mDevice.getUuids();
long timeout = MAX_UUID_DELAY_FOR_AUTO_CONNECT;