Loading src/com/android/settings/bluetooth/CachedBluetoothDevice.java +3 −8 Original line number Diff line number Diff line Loading @@ -133,7 +133,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } mProfileConnectionState.put(profile, newProfileState); if (newProfileState == BluetoothProfile.STATE_CONNECTED) { if (!mProfiles.contains(profile)) { if (profile instanceof MapProfile) { profile.setPreferred(mDevice, true); } else if (!mProfiles.contains(profile)) { mRemovedProfiles.remove(profile); mProfiles.add(profile); if (profile instanceof PanProfile && Loading @@ -142,15 +144,8 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { mLocalNapRoleConnected = true; } } if (profile instanceof MapProfile) { profile.setPreferred(mDevice, true); } } else if (profile instanceof MapProfile && newProfileState == BluetoothProfile.STATE_DISCONNECTED) { if (mProfiles.contains(profile)) { mRemovedProfiles.add(profile); mProfiles.remove(profile); } profile.setPreferred(mDevice, false); } else if (mLocalNapRoleConnected && profile instanceof PanProfile && ((PanProfile) profile).isLocalRoleNap(mDevice) && Loading src/com/android/settings/bluetooth/DeviceProfilesSettings.java +22 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment mProfileContainer.addPreference(pbapPref); } final MapProfile mapProfile = mManager.getProfileManager().getMapProfile(); final int mapPermission = mCachedDevice.getMessagePermissionChoice(); if (mapPermission != CachedBluetoothDevice.ACCESS_UNKNOWN) { CheckBoxPreference mapPreference = createProfilePreference(mapProfile); mProfileContainer.addPreference(mapPreference); } showOrHideProfileGroup(); } Loading Loading @@ -225,9 +232,13 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment boolean isConnected = status == BluetoothProfile.STATE_CONNECTED; if (isConnected) { if (profilePref.isChecked()) { askDisconnect(mManager.getForegroundActivity(), profile); } else { if (profile instanceof MapProfile) { mCachedDevice.setMessagePermissionChoice(BluetoothDevice.ACCESS_ALLOWED); refreshProfilePreference(profilePref, profile); } if (profile.isPreferred(device)) { // profile is preferred but not connected: disable auto-connect profile.setPreferred(device, false); Loading Loading @@ -259,6 +270,11 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment public void onClick(DialogInterface dialog, int which) { device.disconnect(profile); profile.setPreferred(device.getDevice(), false); if (profile instanceof MapProfile) { device.setMessagePermissionChoice(BluetoothDevice.ACCESS_REJECTED); refreshProfilePreference( (CheckBoxPreference)findPreference(profile.toString()), profile); } } }; Loading Loading @@ -297,6 +313,7 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment mProfileContainer.removePreference(profilePref); } } showOrHideProfileGroup(); } Loading @@ -307,7 +324,10 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment // Gray out checkbox while connecting and disconnecting. profilePref.setEnabled(!mCachedDevice.isBusy()); if (profile instanceof PbapServerProfile) { if (profile instanceof MapProfile) { profilePref.setChecked(mCachedDevice.getMessagePermissionChoice() == CachedBluetoothDevice.ACCESS_ALLOWED); } else if (profile instanceof PbapServerProfile) { // Handle PBAP specially. profilePref.setChecked(mCachedDevice.getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_ALLOWED); Loading src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,10 @@ final class LocalBluetoothProfileManager { return mPbapProfile; } MapProfile getMapProfile(){ return mMapProfile; } /** * Fill in a list of LocalBluetoothProfile objects that are supported by * the local device and the remote device. Loading src/com/android/settings/bluetooth/MapProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ final class MapProfile implements LocalBluetoothProfile { public boolean connect(BluetoothDevice device) { if(V)Log.d(TAG,"connect() - should not get called"); return true; // MAP never connects out return false; // MAP never connects out } public boolean disconnect(BluetoothDevice device) { Loading Loading
src/com/android/settings/bluetooth/CachedBluetoothDevice.java +3 −8 Original line number Diff line number Diff line Loading @@ -133,7 +133,9 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } mProfileConnectionState.put(profile, newProfileState); if (newProfileState == BluetoothProfile.STATE_CONNECTED) { if (!mProfiles.contains(profile)) { if (profile instanceof MapProfile) { profile.setPreferred(mDevice, true); } else if (!mProfiles.contains(profile)) { mRemovedProfiles.remove(profile); mProfiles.add(profile); if (profile instanceof PanProfile && Loading @@ -142,15 +144,8 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { mLocalNapRoleConnected = true; } } if (profile instanceof MapProfile) { profile.setPreferred(mDevice, true); } } else if (profile instanceof MapProfile && newProfileState == BluetoothProfile.STATE_DISCONNECTED) { if (mProfiles.contains(profile)) { mRemovedProfiles.add(profile); mProfiles.remove(profile); } profile.setPreferred(mDevice, false); } else if (mLocalNapRoleConnected && profile instanceof PanProfile && ((PanProfile) profile).isLocalRoleNap(mDevice) && Loading
src/com/android/settings/bluetooth/DeviceProfilesSettings.java +22 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment mProfileContainer.addPreference(pbapPref); } final MapProfile mapProfile = mManager.getProfileManager().getMapProfile(); final int mapPermission = mCachedDevice.getMessagePermissionChoice(); if (mapPermission != CachedBluetoothDevice.ACCESS_UNKNOWN) { CheckBoxPreference mapPreference = createProfilePreference(mapProfile); mProfileContainer.addPreference(mapPreference); } showOrHideProfileGroup(); } Loading Loading @@ -225,9 +232,13 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment boolean isConnected = status == BluetoothProfile.STATE_CONNECTED; if (isConnected) { if (profilePref.isChecked()) { askDisconnect(mManager.getForegroundActivity(), profile); } else { if (profile instanceof MapProfile) { mCachedDevice.setMessagePermissionChoice(BluetoothDevice.ACCESS_ALLOWED); refreshProfilePreference(profilePref, profile); } if (profile.isPreferred(device)) { // profile is preferred but not connected: disable auto-connect profile.setPreferred(device, false); Loading Loading @@ -259,6 +270,11 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment public void onClick(DialogInterface dialog, int which) { device.disconnect(profile); profile.setPreferred(device.getDevice(), false); if (profile instanceof MapProfile) { device.setMessagePermissionChoice(BluetoothDevice.ACCESS_REJECTED); refreshProfilePreference( (CheckBoxPreference)findPreference(profile.toString()), profile); } } }; Loading Loading @@ -297,6 +313,7 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment mProfileContainer.removePreference(profilePref); } } showOrHideProfileGroup(); } Loading @@ -307,7 +324,10 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment // Gray out checkbox while connecting and disconnecting. profilePref.setEnabled(!mCachedDevice.isBusy()); if (profile instanceof PbapServerProfile) { if (profile instanceof MapProfile) { profilePref.setChecked(mCachedDevice.getMessagePermissionChoice() == CachedBluetoothDevice.ACCESS_ALLOWED); } else if (profile instanceof PbapServerProfile) { // Handle PBAP specially. profilePref.setChecked(mCachedDevice.getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_ALLOWED); Loading
src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,10 @@ final class LocalBluetoothProfileManager { return mPbapProfile; } MapProfile getMapProfile(){ return mMapProfile; } /** * Fill in a list of LocalBluetoothProfile objects that are supported by * the local device and the remote device. Loading
src/com/android/settings/bluetooth/MapProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ final class MapProfile implements LocalBluetoothProfile { public boolean connect(BluetoothDevice device) { if(V)Log.d(TAG,"connect() - should not get called"); return true; // MAP never connects out return false; // MAP never connects out } public boolean disconnect(BluetoothDevice device) { Loading