Merge "Fix for correctly enabling PAN profile in Settings Update the connected profile list in CachedBluetoothDevice correctly if a PANU-NAP connection is already existing but the onUuidChanged() callback doesnt contain the PANU UUID in SDP inquiry. Now, the DeviceProfileSettings screens displays valid 'Internet connection sharing' option when connected as a NAP to remote PANU." into jb-mr1-dev

This commit is contained in:
Matthew Xie
2012-08-06 22:48:41 -07:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 4 deletions

View File

@@ -463,7 +463,7 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
ParcelUuid[] localUuids = mLocalAdapter.getUuids(); ParcelUuid[] localUuids = mLocalAdapter.getUuids();
if (localUuids == null) return false; if (localUuids == null) return false;
mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles); mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles, mLocalNapRoleConnected);
if (DEBUG) { if (DEBUG) {
Log.e(TAG, "updating profiles for " + mDevice.getAliasName()); Log.e(TAG, "updating profiles for " + mDevice.getAliasName());

View File

@@ -425,7 +425,8 @@ final class LocalBluetoothProfileManager {
*/ */
synchronized void updateProfiles(ParcelUuid[] uuids, ParcelUuid[] localUuids, synchronized void updateProfiles(ParcelUuid[] uuids, ParcelUuid[] localUuids,
Collection<LocalBluetoothProfile> profiles, Collection<LocalBluetoothProfile> profiles,
Collection<LocalBluetoothProfile> removedProfiles) { Collection<LocalBluetoothProfile> removedProfiles,
boolean isPanNapConnected) {
// Copy previous profile list into removedProfiles // Copy previous profile list into removedProfiles
removedProfiles.clear(); removedProfiles.clear();
removedProfiles.addAll(profiles); removedProfiles.addAll(profiles);
@@ -463,8 +464,10 @@ final class LocalBluetoothProfileManager {
removedProfiles.remove(mHidProfile); removedProfiles.remove(mHidProfile);
} }
if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.NAP) && if(isPanNapConnected)
mPanProfile != null) { Log.d(TAG, "Valid PAN-NAP connection exists.");
if ((BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.NAP) &&
mPanProfile != null) || isPanNapConnected) {
profiles.add(mPanProfile); profiles.add(mPanProfile);
removedProfiles.remove(mPanProfile); removedProfiles.remove(mPanProfile);
} }