need persist adding bluetooth MAP profile to profile list in case the settings process being killed
bug:11303213 Change-Id: I1f227839931872ba6fdca0b5932a24e0b002ec44
This commit is contained in:
@@ -149,7 +149,6 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
|
|||||||
}
|
}
|
||||||
if (profile instanceof MapProfile) {
|
if (profile instanceof MapProfile) {
|
||||||
profile.setPreferred(mDevice, true);
|
profile.setPreferred(mDevice, true);
|
||||||
refresh();
|
|
||||||
}
|
}
|
||||||
} else if (profile instanceof MapProfile &&
|
} else if (profile instanceof MapProfile &&
|
||||||
newProfileState == BluetoothProfile.STATE_DISCONNECTED) {
|
newProfileState == BluetoothProfile.STATE_DISCONNECTED) {
|
||||||
@@ -158,7 +157,6 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
|
|||||||
mProfiles.remove(profile);
|
mProfiles.remove(profile);
|
||||||
}
|
}
|
||||||
profile.setPreferred(mDevice, false);
|
profile.setPreferred(mDevice, false);
|
||||||
refresh();
|
|
||||||
} else if (mLocalNapRoleConnected && profile instanceof PanProfile &&
|
} else if (mLocalNapRoleConnected && profile instanceof PanProfile &&
|
||||||
((PanProfile) profile).isLocalRoleNap(mDevice) &&
|
((PanProfile) profile).isLocalRoleNap(mDevice) &&
|
||||||
newProfileState == BluetoothProfile.STATE_DISCONNECTED) {
|
newProfileState == BluetoothProfile.STATE_DISCONNECTED) {
|
||||||
@@ -489,7 +487,8 @@ 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, mLocalNapRoleConnected);
|
mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles,
|
||||||
|
mLocalNapRoleConnected, mDevice);
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.e(TAG, "updating profiles for " + mDevice.getAliasName());
|
Log.e(TAG, "updating profiles for " + mDevice.getAliasName());
|
||||||
|
@@ -321,7 +321,7 @@ 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) {
|
boolean isPanNapConnected, BluetoothDevice device) {
|
||||||
// Copy previous profile list into removedProfiles
|
// Copy previous profile list into removedProfiles
|
||||||
removedProfiles.clear();
|
removedProfiles.clear();
|
||||||
removedProfiles.addAll(profiles);
|
removedProfiles.addAll(profiles);
|
||||||
@@ -367,6 +367,13 @@ final class LocalBluetoothProfileManager {
|
|||||||
profiles.add(mPanProfile);
|
profiles.add(mPanProfile);
|
||||||
removedProfiles.remove(mPanProfile);
|
removedProfiles.remove(mPanProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mMapProfile != null) &&
|
||||||
|
(mMapProfile.getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED)) {
|
||||||
|
profiles.add(mMapProfile);
|
||||||
|
removedProfiles.remove(mMapProfile);
|
||||||
|
mMapProfile.setPreferred(device, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user