mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 17:57:34 +00:00
Refactor webrtc audio management
Attempts to: 1) Successfully play ringtone through speaker instead of earpiece when possible. 2) Manage bluetooth headset connectivity as well as possible 3) Eliminate notification sounds while in-call when possible 4) Make sure audio is correctly setup when receiving calls Fixes #6271 Fixes #6248 Fixes #6238 Fixes #6184 Fixes #6169 // FREEBIE
This commit is contained in:
BIN
res/drawable-hdpi/ic_bluetooth_white_24dp.png
Normal file
BIN
res/drawable-hdpi/ic_bluetooth_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 307 B |
BIN
res/drawable-mdpi/ic_bluetooth_white_24dp.png
Normal file
BIN
res/drawable-mdpi/ic_bluetooth_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 213 B |
BIN
res/drawable-xhdpi/ic_bluetooth_white_24dp.png
Normal file
BIN
res/drawable-xhdpi/ic_bluetooth_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 344 B |
BIN
res/drawable-xxhdpi/ic_bluetooth_white_24dp.png
Normal file
BIN
res/drawable-xxhdpi/ic_bluetooth_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 502 B |
BIN
res/drawable-xxxhdpi/ic_bluetooth_white_24dp.png
Normal file
BIN
res/drawable-xxxhdpi/ic_bluetooth_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 595 B |
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/compoundBackgroundItem" android:drawable="@drawable/webrtc_control_background"/>
|
||||
|
||||
<item android:id="@+id/moreIndicatorItem"
|
||||
android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp">
|
||||
<bitmap android:src="@drawable/redphone_ic_more_indicator_holo_dark"
|
||||
android:gravity="bottom|right" />
|
||||
</item>
|
||||
|
||||
<item android:id="@+id/bluetoothItem"
|
||||
android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp">
|
||||
<bitmap android:src="@drawable/ic_phone_bluetooth_speaker_white_24dp"
|
||||
android:gravity="center" />
|
||||
</item>
|
||||
|
||||
<!-- Handset earpiece is active -->
|
||||
<item android:id="@+id/handsetItem" android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp">
|
||||
<bitmap android:src="@drawable/ic_phone_in_talk_white_24dp"
|
||||
android:gravity="center" />
|
||||
</item>
|
||||
|
||||
<!-- Speakerphone icon showing 'speaker on' state -->
|
||||
<item android:id="@+id/speakerphoneOnItem" android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp">
|
||||
<bitmap android:src="@drawable/ic_volume_up_white_24dp"
|
||||
android:gravity="center" />
|
||||
</item>
|
||||
|
||||
<!--<!– Speakerphone icon showing 'speaker off' state –>-->
|
||||
<!--<item android:id="@+id/speakerphoneOffItem">-->
|
||||
<!--<bitmap android:src="@drawable/ic_volume_mute_white_24dp"-->
|
||||
<!--android:gravity="center" />-->
|
||||
<!--</item>-->
|
||||
|
||||
</layer-list>
|
9
res/drawable/webrtc_bluetooth_button.xml
Normal file
9
res/drawable/webrtc_bluetooth_button.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/webrtc_control_background"/>
|
||||
<item android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp"
|
||||
android:drawable="@drawable/ic_bluetooth_white_24dp"/>
|
||||
</layer-list>
|
9
res/drawable/webrtc_speaker_button.xml
Normal file
9
res/drawable/webrtc_speaker_button.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/webrtc_control_background"/>
|
||||
<item android:top="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp"
|
||||
android:drawable="@drawable/ic_volume_up_white_24dp"/>
|
||||
</layer-list>
|
@@ -7,12 +7,18 @@
|
||||
android:orientation="horizontal"
|
||||
tools:background="@color/textsecure_primary">
|
||||
|
||||
<ToggleButton android:id="@+id/audioButton"
|
||||
<ToggleButton android:id="@+id/speakerButton"
|
||||
style="@style/WebRtcCallCompoundButton"
|
||||
android:background="@drawable/webrtc_audio_button"
|
||||
android:background="@drawable/webrtc_speaker_button"
|
||||
tools:checked="true"
|
||||
android:layout_marginRight="15dp"/>
|
||||
|
||||
<ToggleButton android:id="@+id/bluetoothButton"
|
||||
style="@style/WebRtcCallCompoundButton"
|
||||
android:background="@drawable/webrtc_bluetooth_button"
|
||||
tools:checked="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ToggleButton android:id="@+id/muteButton"
|
||||
style="@style/WebRtcCallCompoundButton"
|
||||
|
@@ -176,7 +176,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/textsecure_primary"
|
||||
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
Reference in New Issue
Block a user