Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_AUDIO; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class A2dpProfile implements LocalBluetoothProfile { private boolean mIsProfileReady; private final CachedBluetoothDeviceManager mDeviceManager; private final BluetoothAdapter mBluetoothAdapter; static final ParcelUuid[] SINK_UUIDS = { BluetoothUuid.A2DP_SINK, Loading Loading @@ -99,7 +101,8 @@ public class A2dpProfile implements LocalBluetoothProfile { mContext = context; mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpServiceListener(), mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new A2dpServiceListener(), BluetoothProfile.A2DP); } Loading Loading @@ -158,8 +161,10 @@ public class A2dpProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) return false; return mService.setActiveDevice(device); if (mBluetoothAdapter == null) { return false; } return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_AUDIO); } public BluetoothDevice getActiveDevice() { Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HeadsetProfile.java +6 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_PHONE_CALL; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class HeadsetProfile implements LocalBluetoothProfile { private final CachedBluetoothDeviceManager mDeviceManager; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothAdapter mBluetoothAdapter; static final ParcelUuid[] UUIDS = { BluetoothUuid.HSP, Loading Loading @@ -99,7 +101,8 @@ public class HeadsetProfile implements LocalBluetoothProfile { LocalBluetoothProfileManager profileManager) { mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new HeadsetServiceListener(), mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new HeadsetServiceListener(), BluetoothProfile.HEADSET); } Loading @@ -119,10 +122,10 @@ public class HeadsetProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) { if (mBluetoothAdapter == null) { return false; } return mService.setActiveDevice(device); return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_PHONE_CALL); } public BluetoothDevice getActiveDevice() { Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_ALL; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class HearingAidProfile implements LocalBluetoothProfile { static final String NAME = "HearingAid"; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothAdapter mBluetoothAdapter; // Order of this profile in device profiles list private static final int ORDINAL = 1; Loading Loading @@ -97,7 +99,8 @@ public class HearingAidProfile implements LocalBluetoothProfile { mContext = context; mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new HearingAidServiceListener(), BluetoothProfile.HEARING_AID); } Loading Loading @@ -156,8 +159,10 @@ public class HearingAidProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) return false; return mService.setActiveDevice(device); if (mBluetoothAdapter == null) { return false; } return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_ALL); } public List<BluetoothDevice> getActiveDevices() { Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_AUDIO; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class A2dpProfile implements LocalBluetoothProfile { private boolean mIsProfileReady; private final CachedBluetoothDeviceManager mDeviceManager; private final BluetoothAdapter mBluetoothAdapter; static final ParcelUuid[] SINK_UUIDS = { BluetoothUuid.A2DP_SINK, Loading Loading @@ -99,7 +101,8 @@ public class A2dpProfile implements LocalBluetoothProfile { mContext = context; mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new A2dpServiceListener(), mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new A2dpServiceListener(), BluetoothProfile.A2DP); } Loading Loading @@ -158,8 +161,10 @@ public class A2dpProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) return false; return mService.setActiveDevice(device); if (mBluetoothAdapter == null) { return false; } return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_AUDIO); } public BluetoothDevice getActiveDevice() { Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HeadsetProfile.java +6 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_PHONE_CALL; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class HeadsetProfile implements LocalBluetoothProfile { private final CachedBluetoothDeviceManager mDeviceManager; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothAdapter mBluetoothAdapter; static final ParcelUuid[] UUIDS = { BluetoothUuid.HSP, Loading Loading @@ -99,7 +101,8 @@ public class HeadsetProfile implements LocalBluetoothProfile { LocalBluetoothProfileManager profileManager) { mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, new HeadsetServiceListener(), mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new HeadsetServiceListener(), BluetoothProfile.HEADSET); } Loading @@ -119,10 +122,10 @@ public class HeadsetProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) { if (mBluetoothAdapter == null) { return false; } return mService.setActiveDevice(device); return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_PHONE_CALL); } public BluetoothDevice getActiveDevice() { Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.ACTIVE_DEVICE_ALL; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_ALLOWED; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; Loading Loading @@ -45,6 +46,7 @@ public class HearingAidProfile implements LocalBluetoothProfile { static final String NAME = "HearingAid"; private final LocalBluetoothProfileManager mProfileManager; private final BluetoothAdapter mBluetoothAdapter; // Order of this profile in device profiles list private static final int ORDINAL = 1; Loading Loading @@ -97,7 +99,8 @@ public class HearingAidProfile implements LocalBluetoothProfile { mContext = context; mDeviceManager = deviceManager; mProfileManager = profileManager; BluetoothAdapter.getDefaultAdapter().getProfileProxy(context, mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter.getProfileProxy(context, new HearingAidServiceListener(), BluetoothProfile.HEARING_AID); } Loading Loading @@ -156,8 +159,10 @@ public class HearingAidProfile implements LocalBluetoothProfile { } public boolean setActiveDevice(BluetoothDevice device) { if (mService == null) return false; return mService.setActiveDevice(device); if (mBluetoothAdapter == null) { return false; } return mBluetoothAdapter.setActiveDevice(device, ACTIVE_DEVICE_ALL); } public List<BluetoothDevice> getActiveDevices() { Loading