mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Show popup on switching to/from speakerphone.
This commit is contained in:
committed by
Greyson Parrelli
parent
8ca49c1e18
commit
7ff4a82755
@@ -114,6 +114,8 @@ class CallStateUpdatePopupWindow(private val parent: ViewGroup) : PopupWindow(
|
||||
RINGING_OFF(R.drawable.symbol_bell_slash_compact_16, R.string.CallStateUpdatePopupWindow__ringing_off),
|
||||
RINGING_DISABLED(null, R.string.CallStateUpdatePopupWindow__group_is_too_large),
|
||||
MIC_ON(R.drawable.symbol_mic_compact_16, R.string.CallStateUpdatePopupWindow__mic_on),
|
||||
MIC_OFF(R.drawable.symbol_mic_slash_compact_16, R.string.CallStateUpdatePopupWindow__mic_off)
|
||||
MIC_OFF(R.drawable.symbol_mic_slash_compact_16, R.string.CallStateUpdatePopupWindow__mic_off),
|
||||
SPEAKER_ON(R.drawable.symbol_speaker_24, R.string.CallStateUpdatePopupWindow__speaker_on),
|
||||
SPEAKER_OFF(R.drawable.symbol_speaker_slash_24, R.string.CallStateUpdatePopupWindow__speaker_off)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,9 +248,8 @@ public class WebRtcCallView extends ConstraintLayout {
|
||||
runIfNonNull(controlsListener, listener ->
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
final Integer deviceId = webRtcAudioDevice.getDeviceId();
|
||||
if (deviceId != null) {
|
||||
listener.onAudioOutputChanged31(deviceId);
|
||||
if (webRtcAudioDevice.getDeviceId() != null) {
|
||||
listener.onAudioOutputChanged31(webRtcAudioDevice);
|
||||
} else {
|
||||
Log.e(TAG, "Attempted to change audio output to null device ID.");
|
||||
}
|
||||
@@ -1102,7 +1101,7 @@ public class WebRtcCallView extends ConstraintLayout {
|
||||
void hideSystemUI();
|
||||
void onAudioOutputChanged(@NonNull WebRtcAudioOutput audioOutput);
|
||||
@RequiresApi(31)
|
||||
void onAudioOutputChanged31(@NonNull Integer audioOutputAddress);
|
||||
void onAudioOutputChanged31(@NonNull WebRtcAudioDevice audioOutput);
|
||||
void onVideoChanged(boolean isVideoEnabled);
|
||||
void onMicChanged(boolean isMicEnabled);
|
||||
void onCameraDirectionChanged();
|
||||
|
||||
@@ -163,6 +163,10 @@ public class WebRtcCallViewModel extends ViewModel {
|
||||
return shouldShowSpeakerHint;
|
||||
}
|
||||
|
||||
public WebRtcAudioOutput getCurrentAudioOutput() {
|
||||
return getWebRtcControls().getValue().getAudioOutput();
|
||||
}
|
||||
|
||||
public LiveData<WebRtcEphemeralState> getEphemeralState() {
|
||||
return ephemeralState;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user