Loading android/app/src/com/android/bluetooth/hfp/BluetoothHeadsetProxy.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,8 +16,12 @@ package com.android.bluetooth.hfp; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHeadset; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.content.Context; import java.util.List; Loading @@ -36,6 +40,14 @@ public class BluetoothHeadsetProxy { mBluetoothHeadset = headset; } public void closeBluetoothHeadsetProxy(Context context) { final BluetoothManager btManager = context.getSystemService(BluetoothManager.class); if (btManager != null) { btManager.getAdapter().closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset); } } public void clccResponse(int index, int direction, int status, int mode, boolean mpty, String number, int type) { Loading android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +16 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ public class BluetoothInCallService extends InCallService { Log.d(TAG, "Bluetooth Adapter state: " + state); if (state == BluetoothAdapter.STATE_ON) { queryPhoneState(); } else if (state == BluetoothAdapter.STATE_TURNING_OFF) { clear(); } } } Loading Loading @@ -620,6 +622,12 @@ public class BluetoothInCallService extends InCallService { @Override public void onDestroy() { Log.d(TAG, "onDestroy"); clear(); super.onDestroy(); } private void clear() { Log.d(TAG, "clear"); if (mBluetoothOnModeChangedListener != null) { mAudioManager.removeOnModeChangedListener(mBluetoothOnModeChangedListener); mBluetoothOnModeChangedListener = null; Loading @@ -628,8 +636,15 @@ public class BluetoothInCallService extends InCallService { unregisterReceiver(mBluetoothAdapterReceiver); mBluetoothAdapterReceiver = null; } if (mBluetoothHeadset != null) { mBluetoothHeadset.closeBluetoothHeadsetProxy(this); mBluetoothHeadset = null; } mProfileListener = null; sInstance = null; super.onDestroy(); mCallbacks.clear(); mBluetoothCallHashMap.clear(); mClccIndexMap.clear(); } private void sendListOfCalls(boolean shouldLog) { Loading Loading
android/app/src/com/android/bluetooth/hfp/BluetoothHeadsetProxy.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,8 +16,12 @@ package com.android.bluetooth.hfp; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHeadset; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.content.Context; import java.util.List; Loading @@ -36,6 +40,14 @@ public class BluetoothHeadsetProxy { mBluetoothHeadset = headset; } public void closeBluetoothHeadsetProxy(Context context) { final BluetoothManager btManager = context.getSystemService(BluetoothManager.class); if (btManager != null) { btManager.getAdapter().closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset); } } public void clccResponse(int index, int direction, int status, int mode, boolean mpty, String number, int type) { Loading
android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +16 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ public class BluetoothInCallService extends InCallService { Log.d(TAG, "Bluetooth Adapter state: " + state); if (state == BluetoothAdapter.STATE_ON) { queryPhoneState(); } else if (state == BluetoothAdapter.STATE_TURNING_OFF) { clear(); } } } Loading Loading @@ -620,6 +622,12 @@ public class BluetoothInCallService extends InCallService { @Override public void onDestroy() { Log.d(TAG, "onDestroy"); clear(); super.onDestroy(); } private void clear() { Log.d(TAG, "clear"); if (mBluetoothOnModeChangedListener != null) { mAudioManager.removeOnModeChangedListener(mBluetoothOnModeChangedListener); mBluetoothOnModeChangedListener = null; Loading @@ -628,8 +636,15 @@ public class BluetoothInCallService extends InCallService { unregisterReceiver(mBluetoothAdapterReceiver); mBluetoothAdapterReceiver = null; } if (mBluetoothHeadset != null) { mBluetoothHeadset.closeBluetoothHeadsetProxy(this); mBluetoothHeadset = null; } mProfileListener = null; sInstance = null; super.onDestroy(); mCallbacks.clear(); mBluetoothCallHashMap.clear(); mClccIndexMap.clear(); } private void sendListOfCalls(boolean shouldLog) { Loading