From 8e5448639a84efbd39c7bd20738d41edb86b0e83 Mon Sep 17 00:00:00 2001 From: yueg Date: Fri, 6 Apr 2018 14:34:59 -0700 Subject: Use sensible audio route for bubble mode. Bug: 74022483 Test: InCallPresenterTest PiperOrigin-RevId: 191941513 Change-Id: If2090c6dae63981a46586d785e2836edbdf8a729 --- java/com/android/incallui/InCallPresenter.java | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index b5e76ee76..7ea2fadf3 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -271,6 +271,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud private SpeakEasyCallManager speakEasyCallManager; private boolean shouldStartInBubbleMode; + private boolean audioRouteSetForBubbleMode; /** Inaccessible constructor. Must use getRunningInstance() to get this singleton. */ @VisibleForTesting @@ -1498,6 +1499,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud showInCall(false /* showDialpad */, !showAccountPicker /* newOutgoingCall */); } else if (newState == InCallState.NO_CALLS) { // The new state is the no calls state. Tear everything down. + inCallState = newState; attemptFinishActivity(); attemptCleanup(); } @@ -1554,6 +1556,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud isChangingConfigurations = false; shouldStartInBubbleMode = false; + audioRouteSetForBubbleMode = false; // blow away stale contact info so that we get fresh data on // the next set of calls @@ -1834,11 +1837,41 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud @Override public void onAudioStateChanged(CallAudioState audioState) { + // Set sensible audio route for bubble mode when we get real audio state for the first time + // During the first time this function is called, supportedRouteMask is set to + // SUPPORTED_AUDIO_ROUTE_ALL, but it's OK since shouldStartInBubbleMode is not set at that time. + if (!audioRouteSetForBubbleMode && shouldStartInBubbleMode) { + setAudioRouteForBubbleMode(audioState); + audioRouteSetForBubbleMode = true; + } + if (statusBarNotifier != null) { statusBarNotifier.updateNotification(); } } + /** + * Set audio route to make audio sensible. According to availability, set audio route to Bluetooth + * or wired headset or speaker. + */ + private void setAudioRouteForBubbleMode(CallAudioState audioState) { + if ((audioState.getSupportedRouteMask() & CallAudioState.ROUTE_BLUETOOTH) + == CallAudioState.ROUTE_BLUETOOTH) { + // Use Bluetooth if available + TelecomAdapter.getInstance().setAudioRoute(CallAudioState.ROUTE_BLUETOOTH); + LogUtil.i("InCallPrenter.setAudioRouteForBubbleMode", "bluetooth"); + } else if ((audioState.getSupportedRouteMask() & CallAudioState.ROUTE_WIRED_HEADSET) + == CallAudioState.ROUTE_WIRED_HEADSET) { + // Use wired headset if available + TelecomAdapter.getInstance().setAudioRoute(CallAudioState.ROUTE_WIRED_HEADSET); + LogUtil.i("InCallPrenter.setAudioRouteForBubbleMode", "wired headset"); + } else { + // Use speaker + TelecomAdapter.getInstance().setAudioRoute(CallAudioState.ROUTE_SPEAKER); + LogUtil.i("InCallPrenter.setAudioRouteForBubbleMode", "speaker"); + } + } + /** All the main states of InCallActivity. */ public enum InCallState { // InCall Screen is off and there are no calls -- cgit v1.2.3 From 57356b9960278cb033b47161d52bf0d367fa09e5 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Fri, 6 Apr 2018 15:18:04 -0700 Subject: Change voicemail empty state icon to voicemail icon. Bug: 75962146 Test: screenshot PiperOrigin-RevId: 191948101 Change-Id: Icba3cb63cbfe42ce0f193e731dbe2240b3dfc27d --- .../android/dialer/app/calllog/VisualVoicemailCallLogFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java index 458c0526f..dba43a2f7 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java @@ -42,6 +42,7 @@ import com.android.dialer.util.PermissionsUtil; import com.android.dialer.voicemail.listui.error.VoicemailErrorMessageCreator; import com.android.dialer.voicemail.listui.error.VoicemailStatus; import com.android.dialer.voicemail.listui.error.VoicemailStatusWorker; +import com.android.dialer.widget.EmptyContentView; import java.util.List; public class VisualVoicemailCallLogFragment extends CallLogFragment { @@ -110,6 +111,9 @@ public class VisualVoicemailCallLogFragment extends CallLogFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) { View view = inflater.inflate(R.layout.call_log_fragment, container, false); setupView(view); + EmptyContentView emptyContentView = view.findViewById(R.id.empty_list_view); + emptyContentView.setImage(R.drawable.quantum_ic_voicemail_vd_theme_24); + emptyContentView.setImageTint(R.color.empty_voicemail_icon_tint_color, null); return view; } -- cgit v1.2.3 From cb39795cb8b91df33f304d8155f277f968036b5a Mon Sep 17 00:00:00 2001 From: linyuh Date: Fri, 6 Apr 2018 16:33:57 -0700 Subject: Resolve resource conflicts. Bug: 77710848 Test: None PiperOrigin-RevId: 191957734 Change-Id: I0b2674298722a405f4f2e970e877671cff37e60f --- .../widget/res/drawable/edittext_custom_cursor.xml | 21 +++++++++++++++++++ .../drawable/item_background_material_light.xml | 24 ---------------------- .../widget/res/drawable/ripple_material_light.xml | 23 +++++++++++++++++++++ .../res/drawable/searchedittext_custom_cursor.xml | 21 ------------------- .../dialer/widget/res/layout/fragment_message.xml | 2 +- .../widget/res/layout/selectable_text_view.xml | 2 +- 6 files changed, 46 insertions(+), 47 deletions(-) create mode 100644 java/com/android/dialer/widget/res/drawable/edittext_custom_cursor.xml delete mode 100644 java/com/android/dialer/widget/res/drawable/item_background_material_light.xml create mode 100644 java/com/android/dialer/widget/res/drawable/ripple_material_light.xml delete mode 100644 java/com/android/dialer/widget/res/drawable/searchedittext_custom_cursor.xml diff --git a/java/com/android/dialer/widget/res/drawable/edittext_custom_cursor.xml b/java/com/android/dialer/widget/res/drawable/edittext_custom_cursor.xml new file mode 100644 index 000000000..2f01628aa --- /dev/null +++ b/java/com/android/dialer/widget/res/drawable/edittext_custom_cursor.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/java/com/android/dialer/widget/res/drawable/item_background_material_light.xml b/java/com/android/dialer/widget/res/drawable/item_background_material_light.xml deleted file mode 100644 index 6e524ac81..000000000 --- a/java/com/android/dialer/widget/res/drawable/item_background_material_light.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml b/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml new file mode 100644 index 000000000..175624c8b --- /dev/null +++ b/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/java/com/android/dialer/widget/res/drawable/searchedittext_custom_cursor.xml b/java/com/android/dialer/widget/res/drawable/searchedittext_custom_cursor.xml deleted file mode 100644 index 2f01628aa..000000000 --- a/java/com/android/dialer/widget/res/drawable/searchedittext_custom_cursor.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/widget/res/layout/fragment_message.xml b/java/com/android/dialer/widget/res/layout/fragment_message.xml index bdb85fa81..ac62dd91b 100644 --- a/java/com/android/dialer/widget/res/layout/fragment_message.xml +++ b/java/com/android/dialer/widget/res/layout/fragment_message.xml @@ -55,7 +55,7 @@ android:textColor="@color/dialer_primary_text_color" android:textColorHint="@color/dialer_edit_text_hint_color" android:background="@color/background_dialer_white" - android:textCursorDrawable="@drawable/searchedittext_custom_cursor" + android:textCursorDrawable="@drawable/edittext_custom_cursor" android:layout_toStartOf="@+id/count_and_send_container" android:inputType="textShortMessage|textCapSentences" android:imeOptions="flagNoExtractUi|actionSend"/> diff --git a/java/com/android/dialer/widget/res/layout/selectable_text_view.xml b/java/com/android/dialer/widget/res/layout/selectable_text_view.xml index 3d120d13d..9cdb162b6 100644 --- a/java/com/android/dialer/widget/res/layout/selectable_text_view.xml +++ b/java/com/android/dialer/widget/res/layout/selectable_text_view.xml @@ -22,4 +22,4 @@ android:textSize="16sp" android:textColor="@color/dialer_primary_text_color" android:padding="16dp" - android:background="@drawable/item_background_material_light"/> \ No newline at end of file + android:background="@drawable/ripple_material_light"/> \ No newline at end of file -- cgit v1.2.3