Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb0773fa authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Fix crash in dump function.

Change-Id: I5a4cd7cf3fd325ced5d05f036c191f759dee16e0
parent b0a1d01b
Loading
Loading
Loading
Loading
+24 −26
Original line number Diff line number Diff line
@@ -2511,13 +2511,11 @@ public class BluetoothService extends IBluetooth.Stub {
            List<BluetoothDevice> deviceList = mBluetoothHeadset.getConnectedDevices();
            if (deviceList.size() == 0) {
                pw.println("\n--No headsets connected--");
           }
            } else {
                BluetoothDevice device = deviceList.get(0);
                pw.println("\ngetConnectedDevices[0] = " + device);

                switch (mBluetoothHeadset.getConnectionState(device)) {
                case BluetoothHeadset.STATE_DISCONNECTED:
                    pw.println("getConnectionState() = STATE_DISCONNECTED");
                    break;
                    case BluetoothHeadset.STATE_CONNECTING:
                        pw.println("getConnectionState() = STATE_CONNECTING");
                        break;
@@ -2531,21 +2529,21 @@ public class BluetoothService extends IBluetooth.Stub {
                        pw.println("getConnectionState() = STATE_AUDIO_CONNECTED");
                        break;
                }
                pw.println("getBatteryUsageHint() = " +
                             mBluetoothHeadset.getBatteryUsageHint(device));
            }

            deviceList.clear();
            deviceList = mBluetoothHeadset.getDevicesMatchingConnectionStates(new int[] {
                     BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED});
            pw.println("\n--Connected and Disconnected Headsets");
            for (BluetoothDevice dev: deviceList) {
            for (BluetoothDevice device: deviceList) {
                pw.println(device);
                if (mBluetoothHeadset.isAudioConnected(device)) {
                    pw.println("SCO audio connected to device:" + device);
                }
            }

            pw.println("\ngetCurrentHeadset() = " + device);
            pw.println("getBatteryUsageHint() = " +
                       mBluetoothHeadset.getBatteryUsageHint(device));
            mAdapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset);
        }