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

Commit 3ca2ee0f authored by Jaikumar Ganesh's avatar Jaikumar Ganesh Committed by Android (Google) Code Review
Browse files

Merge "Fix crash in dump function."

parents 7ab17a34 bb0773fa
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);
        }