diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioOutputAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioOutputAdapter.java index e95b96f3e7..bb569cdd67 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioOutputAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioOutputAdapter.java @@ -64,7 +64,6 @@ final class AudioOutputAdapter extends RecyclerView.Adapter onPressed; @@ -72,16 +71,14 @@ final class AudioOutputAdapter extends RecyclerView.Adapter onPressed) { super(itemView); - this.textView = itemView.findViewById(R.id.text); this.radioButton = itemView.findViewById(R.id.radio); this.onPressed = onPressed; } @CallSuper void bind(@NonNull WebRtcAudioOutput audioOutput, @Nullable WebRtcAudioOutput selected) { - textView.setText(audioOutput.getLabelRes()); - textView.setCompoundDrawablesRelativeWithIntrinsicBounds(audioOutput.getIconRes(), 0, 0, 0); - + radioButton.setText(audioOutput.getLabelRes()); + radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(audioOutput.getIconRes(), 0, 0, 0); radioButton.setOnCheckedChangeListener(null); radioButton.setChecked(audioOutput == selected); radioButton.setOnCheckedChangeListener(this); diff --git a/app/src/main/java/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java b/app/src/main/java/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java index a33f693164..2794e0783d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java +++ b/app/src/main/java/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java @@ -1,7 +1,6 @@ package org.thoughtcrime.securesms.webrtc.audio; import android.bluetooth.BluetoothAdapter; -import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHeadset; import android.bluetooth.BluetoothProfile; @@ -10,11 +9,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; -import android.os.Build; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import org.signal.core.util.logging.Log; import org.thoughtcrime.securesms.util.ServiceUtil; @@ -147,7 +144,6 @@ public class BluetoothStateManager { private void requestHeadsetProxyProfile() { this.bluetoothAdapter.getProfileProxy(context, new BluetoothProfile.ServiceListener() { - @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB) @Override public void onServiceConnected(int profile, BluetoothProfile proxy) { if (destroyed.get()) { @@ -210,8 +206,9 @@ public class BluetoothStateManager { } } } - } + } else if (status == AudioManager.SCO_AUDIO_STATE_DISCONNECTED) { + setWantsConnection(false); } } } diff --git a/app/src/main/res/layout/audio_output_adapter_radio_item.xml b/app/src/main/res/layout/audio_output_adapter_radio_item.xml index 98cd37a87d..54e3b5ede3 100644 --- a/app/src/main/res/layout/audio_output_adapter_radio_item.xml +++ b/app/src/main/res/layout/audio_output_adapter_radio_item.xml @@ -1,17 +1,16 @@ - - - + - - -