diff options
Diffstat (limited to 'java/com/android/incallui/speakerbuttonlogic')
-rw-r--r-- | java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java | 13 | ||||
-rw-r--r-- | java/com/android/incallui/speakerbuttonlogic/res/drawable/volume_bluetooth.xml | 24 |
2 files changed, 32 insertions, 5 deletions
diff --git a/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java b/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java index 58fd40fb4..0c873b2af 100644 --- a/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java +++ b/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java @@ -39,34 +39,37 @@ public class SpeakerButtonInfo { @DrawableRes public final int icon; @StringRes public final int contentDescription; @StringRes public final int label; - public final boolean checkable; + public final boolean nonBluetoothMode; public final boolean isChecked; public SpeakerButtonInfo(CallAudioState audioState) { if ((audioState.getSupportedRouteMask() & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) { - checkable = false; - isChecked = false; + nonBluetoothMode = false; label = R.string.incall_label_audio; if ((audioState.getRoute() & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) { - icon = R.drawable.quantum_ic_bluetooth_audio_vd_theme_24; + icon = R.drawable.volume_bluetooth; contentDescription = R.string.incall_content_description_bluetooth; + isChecked = true; } else if ((audioState.getRoute() & CallAudioState.ROUTE_SPEAKER) == CallAudioState.ROUTE_SPEAKER) { icon = R.drawable.quantum_ic_volume_up_vd_theme_24; contentDescription = R.string.incall_content_description_speaker; + isChecked = true; } else if ((audioState.getRoute() & CallAudioState.ROUTE_WIRED_HEADSET) == CallAudioState.ROUTE_WIRED_HEADSET) { icon = R.drawable.quantum_ic_headset_vd_theme_24; contentDescription = R.string.incall_content_description_headset; + isChecked = true; } else { icon = R.drawable.quantum_ic_phone_in_talk_vd_theme_24; contentDescription = R.string.incall_content_description_earpiece; + isChecked = false; } } else { - checkable = true; + nonBluetoothMode = true; isChecked = audioState.getRoute() == CallAudioState.ROUTE_SPEAKER; label = R.string.incall_label_speaker; icon = R.drawable.quantum_ic_volume_up_vd_theme_24; diff --git a/java/com/android/incallui/speakerbuttonlogic/res/drawable/volume_bluetooth.xml b/java/com/android/incallui/speakerbuttonlogic/res/drawable/volume_bluetooth.xml new file mode 100644 index 000000000..59dfdf3bf --- /dev/null +++ b/java/com/android/incallui/speakerbuttonlogic/res/drawable/volume_bluetooth.xml @@ -0,0 +1,24 @@ +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:viewportWidth="24" + android:viewportHeight="24" + android:width="24dp" + android:height="24dp"> + <path + android:fillColor="@android:color/white" + android:pathData="M3 9l0 6 4 0 5 5 0 -16 -5 5 -4 0zm11.71 6.5l2.29 -2.29 0 3.79 0.5 0 2.85 -2.85L18.12 12 20.36 9.85 17.5 7l-0.5 0 0 3.79L14.71 8.5 14 9.21 16.79 12 14 14.79 14.71 15.5ZM18 8.91l0.94 0.94 -0.94 0.94 0 -1.88zm0 4.3l0.94 0.94 -0.94 0.94 0 -1.88z"/> +</vector>
\ No newline at end of file |