Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +3 −6 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ public class A2dpProfile implements LocalBluetoothProfile { private BluetoothA2dp mService; private boolean mIsProfileReady; private final LocalBluetoothAdapter mLocalAdapter; private final CachedBluetoothDeviceManager mDeviceManager; static final ParcelUuid[] SINK_UUIDS = { Loading Loading @@ -71,7 +70,7 @@ public class A2dpProfile implements LocalBluetoothProfile { // we may add a new device here, but generally this should not happen if (device == null) { Log.w(TAG, "A2dpProfile found new device: " + nextDevice); device = mDeviceManager.addDevice(mLocalAdapter, nextDevice); device = mDeviceManager.addDevice(nextDevice); } device.onProfileStateChanged(A2dpProfile.this, BluetoothProfile.STATE_CONNECTED); device.refresh(); Loading @@ -94,14 +93,12 @@ public class A2dpProfile implements LocalBluetoothProfile { return BluetoothProfile.A2DP; } A2dpProfile(Context context, LocalBluetoothAdapter adapter, CachedBluetoothDeviceManager deviceManager, A2dpProfile(Context context, CachedBluetoothDeviceManager deviceManager, LocalBluetoothProfileManager profileManager) { mContext = context; mLocalAdapter = adapter; mDeviceManager = deviceManager; mProfileManager = profileManager; mLocalAdapter.getProfileProxy(context, new A2dpServiceListener(), BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpServiceListener(), BluetoothProfile.A2DP); } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java +3 −6 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { private BluetoothA2dpSink mService; private boolean mIsProfileReady; private final LocalBluetoothAdapter mLocalAdapter; private final CachedBluetoothDeviceManager mDeviceManager; static final ParcelUuid[] SRC_UUIDS = { Loading Loading @@ -67,7 +66,7 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { // we may add a new device here, but generally this should not happen if (device == null) { Log.w(TAG, "A2dpSinkProfile found new device: " + nextDevice); device = mDeviceManager.addDevice(mLocalAdapter, nextDevice); device = mDeviceManager.addDevice(nextDevice); } device.onProfileStateChanged(A2dpSinkProfile.this, BluetoothProfile.STATE_CONNECTED); device.refresh(); Loading @@ -90,13 +89,11 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return BluetoothProfile.A2DP_SINK; } A2dpSinkProfile(Context context, LocalBluetoothAdapter adapter, CachedBluetoothDeviceManager deviceManager, A2dpSinkProfile(Context context, CachedBluetoothDeviceManager deviceManager, LocalBluetoothProfileManager profileManager) { mLocalAdapter = adapter; mDeviceManager = deviceManager; mProfileManager = profileManager; mLocalAdapter.getProfileProxy(context, new A2dpSinkServiceListener(), BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpSinkServiceListener(), BluetoothProfile.A2DP_SINK); } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +3 −4 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class BluetoothEventManager { for (BluetoothDevice device : bondedDevices) { CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); if (cachedDevice == null) { cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); dispatchDeviceAdded(cachedDevice); deviceAdded = true; } Loading Loading @@ -282,7 +282,7 @@ public class BluetoothEventManager { // Skip for now, there's a bluez problem and we are not getting uuids even for 2.1. CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); if (cachedDevice == null) { cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); Log.d(TAG, "DeviceFoundHandler created new CachedBluetoothDevice: " + cachedDevice); } Loading Loading @@ -348,8 +348,7 @@ public class BluetoothEventManager { if (cachedDevice == null) { Log.w(TAG, "Got bonding state changed for " + device + ", but we have no record of that device."); cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); dispatchDeviceAdded(cachedDevice); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +3 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> private static final String TAG = "CachedBluetoothDevice"; private final Context mContext; private final LocalBluetoothAdapter mLocalAdapter; private final BluetoothAdapter mLocalAdapter; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothDevice mDevice; //TODO: consider remove, BluetoothDevice.getName() is already cached Loading Loading @@ -143,7 +143,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> Log.d(TAG, "onProfileStateChanged: profile " + profile + " newProfileState " + newProfileState); } if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_TURNING_OFF) if (mLocalAdapter.getState() == BluetoothAdapter.STATE_TURNING_OFF) { if (BluetoothUtils.D) { Log.d(TAG, " BT Turninig Off...Profile conn state change ignored..."); Loading Loading @@ -179,11 +179,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } CachedBluetoothDevice(Context context, LocalBluetoothAdapter adapter, LocalBluetoothProfileManager profileManager, BluetoothDevice device) { mContext = context; mLocalAdapter = adapter; mLocalAdapter = BluetoothAdapter.getDefaultAdapter(); mProfileManager = profileManager; mDevice = device; mProfileConnectionState = new HashMap<LocalBluetoothProfile, Integer>(); Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -107,10 +107,10 @@ public class CachedBluetoothDeviceManager { * @param device the address of the new Bluetooth device * @return the newly created CachedBluetoothDevice object */ public CachedBluetoothDevice addDevice(LocalBluetoothAdapter adapter, BluetoothDevice device) { public CachedBluetoothDevice addDevice(BluetoothDevice device) { LocalBluetoothProfileManager profileManager = mBtManager.getProfileManager(); CachedBluetoothDevice newDevice = new CachedBluetoothDevice(mContext, adapter, profileManager, device); CachedBluetoothDevice newDevice = new CachedBluetoothDevice(mContext, profileManager, device); if (profileManager.getHearingAidProfile() != null && profileManager.getHearingAidProfile().getHiSyncId(newDevice.getDevice()) != BluetoothHearingAid.HI_SYNC_ID_INVALID) { Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +3 −6 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ public class A2dpProfile implements LocalBluetoothProfile { private BluetoothA2dp mService; private boolean mIsProfileReady; private final LocalBluetoothAdapter mLocalAdapter; private final CachedBluetoothDeviceManager mDeviceManager; static final ParcelUuid[] SINK_UUIDS = { Loading Loading @@ -71,7 +70,7 @@ public class A2dpProfile implements LocalBluetoothProfile { // we may add a new device here, but generally this should not happen if (device == null) { Log.w(TAG, "A2dpProfile found new device: " + nextDevice); device = mDeviceManager.addDevice(mLocalAdapter, nextDevice); device = mDeviceManager.addDevice(nextDevice); } device.onProfileStateChanged(A2dpProfile.this, BluetoothProfile.STATE_CONNECTED); device.refresh(); Loading @@ -94,14 +93,12 @@ public class A2dpProfile implements LocalBluetoothProfile { return BluetoothProfile.A2DP; } A2dpProfile(Context context, LocalBluetoothAdapter adapter, CachedBluetoothDeviceManager deviceManager, A2dpProfile(Context context, CachedBluetoothDeviceManager deviceManager, LocalBluetoothProfileManager profileManager) { mContext = context; mLocalAdapter = adapter; mDeviceManager = deviceManager; mProfileManager = profileManager; mLocalAdapter.getProfileProxy(context, new A2dpServiceListener(), BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpServiceListener(), BluetoothProfile.A2DP); } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java +3 −6 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { private BluetoothA2dpSink mService; private boolean mIsProfileReady; private final LocalBluetoothAdapter mLocalAdapter; private final CachedBluetoothDeviceManager mDeviceManager; static final ParcelUuid[] SRC_UUIDS = { Loading Loading @@ -67,7 +66,7 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { // we may add a new device here, but generally this should not happen if (device == null) { Log.w(TAG, "A2dpSinkProfile found new device: " + nextDevice); device = mDeviceManager.addDevice(mLocalAdapter, nextDevice); device = mDeviceManager.addDevice(nextDevice); } device.onProfileStateChanged(A2dpSinkProfile.this, BluetoothProfile.STATE_CONNECTED); device.refresh(); Loading @@ -90,13 +89,11 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return BluetoothProfile.A2DP_SINK; } A2dpSinkProfile(Context context, LocalBluetoothAdapter adapter, CachedBluetoothDeviceManager deviceManager, A2dpSinkProfile(Context context, CachedBluetoothDeviceManager deviceManager, LocalBluetoothProfileManager profileManager) { mLocalAdapter = adapter; mDeviceManager = deviceManager; mProfileManager = profileManager; mLocalAdapter.getProfileProxy(context, new A2dpSinkServiceListener(), BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpSinkServiceListener(), BluetoothProfile.A2DP_SINK); } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +3 −4 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class BluetoothEventManager { for (BluetoothDevice device : bondedDevices) { CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); if (cachedDevice == null) { cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); dispatchDeviceAdded(cachedDevice); deviceAdded = true; } Loading Loading @@ -282,7 +282,7 @@ public class BluetoothEventManager { // Skip for now, there's a bluez problem and we are not getting uuids even for 2.1. CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); if (cachedDevice == null) { cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); Log.d(TAG, "DeviceFoundHandler created new CachedBluetoothDevice: " + cachedDevice); } Loading Loading @@ -348,8 +348,7 @@ public class BluetoothEventManager { if (cachedDevice == null) { Log.w(TAG, "Got bonding state changed for " + device + ", but we have no record of that device."); cachedDevice = mDeviceManager.addDevice(mLocalAdapter, device); cachedDevice = mDeviceManager.addDevice(device); dispatchDeviceAdded(cachedDevice); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +3 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> private static final String TAG = "CachedBluetoothDevice"; private final Context mContext; private final LocalBluetoothAdapter mLocalAdapter; private final BluetoothAdapter mLocalAdapter; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothDevice mDevice; //TODO: consider remove, BluetoothDevice.getName() is already cached Loading Loading @@ -143,7 +143,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> Log.d(TAG, "onProfileStateChanged: profile " + profile + " newProfileState " + newProfileState); } if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_TURNING_OFF) if (mLocalAdapter.getState() == BluetoothAdapter.STATE_TURNING_OFF) { if (BluetoothUtils.D) { Log.d(TAG, " BT Turninig Off...Profile conn state change ignored..."); Loading Loading @@ -179,11 +179,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } CachedBluetoothDevice(Context context, LocalBluetoothAdapter adapter, LocalBluetoothProfileManager profileManager, BluetoothDevice device) { mContext = context; mLocalAdapter = adapter; mLocalAdapter = BluetoothAdapter.getDefaultAdapter(); mProfileManager = profileManager; mDevice = device; mProfileConnectionState = new HashMap<LocalBluetoothProfile, Integer>(); Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -107,10 +107,10 @@ public class CachedBluetoothDeviceManager { * @param device the address of the new Bluetooth device * @return the newly created CachedBluetoothDevice object */ public CachedBluetoothDevice addDevice(LocalBluetoothAdapter adapter, BluetoothDevice device) { public CachedBluetoothDevice addDevice(BluetoothDevice device) { LocalBluetoothProfileManager profileManager = mBtManager.getProfileManager(); CachedBluetoothDevice newDevice = new CachedBluetoothDevice(mContext, adapter, profileManager, device); CachedBluetoothDevice newDevice = new CachedBluetoothDevice(mContext, profileManager, device); if (profileManager.getHearingAidProfile() != null && profileManager.getHearingAidProfile().getHiSyncId(newDevice.getDevice()) != BluetoothHearingAid.HI_SYNC_ID_INVALID) { Loading