From bea76bf6e5de3c99990490d9b66023b99a926111 Mon Sep 17 00:00:00 2001 From: yueg Date: Tue, 10 Apr 2018 16:41:49 -0700 Subject: Change speaker button for in call UI and bubble. Bug: 74238896 Test: ButtonControllerTest PiperOrigin-RevId: 192370117 Change-Id: I265cc9541957c2dd376176ed7a703b4938fe4563 --- .../incallui/speakerbuttonlogic/SpeakerButtonInfo.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java') 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; -- cgit v1.2.3