Loading core/java/android/server/BluetoothService.java +24 −26 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); } Loading Loading
core/java/android/server/BluetoothService.java +24 −26 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); } Loading