summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuzhou <jiayuzhou@google.com>2018-06-14 18:40:02 -0700
committerYuzhou <jiayuzhou@google.com>2018-06-14 18:42:18 -0700
commit47414b4f26a7c25ea8413d7df9194fd4a9c82699 (patch)
treeee9e11b23ccc14799bb69ee46edf58c994598cab
parent75b66ecd889ad0c1fa04b0453b7470480e70c2e9 (diff)
downloadDialer-pie-qpr1-release.tar.gz
supported. Test: build and load the app. Bug: 109894902 Change-Id: I67ab9ef3bb8d9f67183c6d01e2448bec1d06e8a2
-rw-r--r--src/com/android/car/dialer/telecom/UiCallManager.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/com/android/car/dialer/telecom/UiCallManager.java b/src/com/android/car/dialer/telecom/UiCallManager.java
index 0e9c2a1a..be424872 100644
--- a/src/com/android/car/dialer/telecom/UiCallManager.java
+++ b/src/com/android/car/dialer/telecom/UiCallManager.java
@@ -134,18 +134,20 @@ public class UiCallManager {
context.bindService(intent, mInCallServiceConnection, Context.BIND_AUTO_CREATE);
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
- adapter.getProfileProxy(mContext, new BluetoothProfile.ServiceListener() {
- @Override
- public void onServiceConnected(int profile, BluetoothProfile proxy) {
- if (profile == BluetoothProfile.HEADSET_CLIENT) {
- mBluetoothHeadsetClient = (BluetoothHeadsetClient) proxy;
+ if (adapter != null) {
+ adapter.getProfileProxy(mContext, new BluetoothProfile.ServiceListener() {
+ @Override
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ if (profile == BluetoothProfile.HEADSET_CLIENT) {
+ mBluetoothHeadsetClient = (BluetoothHeadsetClient) proxy;
+ }
}
- }
- @Override
- public void onServiceDisconnected(int profile) {
- }
- }, BluetoothProfile.HEADSET_CLIENT);
+ @Override
+ public void onServiceDisconnected(int profile) {
+ }
+ }, BluetoothProfile.HEADSET_CLIENT);
+ }
}
private final ServiceConnection mInCallServiceConnection = new ServiceConnection() {