diff options
Diffstat (limited to 'java/com/android')
-rw-r--r-- | java/com/android/dialer/app/res/values-v27/styles.xml | 23 | ||||
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 47 |
2 files changed, 52 insertions, 18 deletions
diff --git a/java/com/android/dialer/app/res/values-v27/styles.xml b/java/com/android/dialer/app/res/values-v27/styles.xml new file mode 100644 index 000000000..5a946b6a0 --- /dev/null +++ b/java/com/android/dialer/app/res/values-v27/styles.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2017 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 + --> +<resources> + <style name="DialtactsTheme" parent="DialtactsThemeBase"> + <item name="android:windowLightNavigationBar">true</item> + <item name="android:navigationBarColor">?android:windowBackground</item> + <item name="android:navigationBarDividerColor">#E0E0E0</item> + </style> +</resources> diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 5d71d0aac..dd7535e20 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1635,13 +1635,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } } - private static class VideoTechManager { + /** Coordinates the available VideoTech implementations for a call. */ + @VisibleForTesting + public static class VideoTechManager { private final Context context; private final EmptyVideoTech emptyVideoTech = new EmptyVideoTech(); + private final VideoTech rcsVideoShare; private final List<VideoTech> videoTechs; private VideoTech savedTech; - VideoTechManager(DialerCall call) { + @VisibleForTesting + public VideoTechManager(DialerCall call) { this.context = call.context; String phoneNumber = call.getNumber(); @@ -1653,40 +1657,47 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa videoTechs.add(new ImsVideoTech(Logger.get(call.context), call, call.telecomCall)); - VideoTech rcsVideoTech = + rcsVideoShare = EnrichedCallComponent.get(call.context) .getRcsVideoShareFactory() .newRcsVideoShare( EnrichedCallComponent.get(call.context).getEnrichedCallManager(), call, phoneNumber); - if (rcsVideoTech != null) { - videoTechs.add(rcsVideoTech); + if (rcsVideoShare != null) { + videoTechs.add(rcsVideoShare); } videoTechs.add( new DuoVideoTech( DuoComponent.get(call.context).getDuo(), call, call.telecomCall, phoneNumber)); - } - VideoTech getVideoTech() { - if (savedTech != null) { - return savedTech; - } + savedTech = emptyVideoTech; + } - for (VideoTech tech : videoTechs) { - if (tech.isAvailable(context)) { - // Remember the first VideoTech that becomes available and always use it - savedTech = tech; - savedTech.becomePrimary(); - return savedTech; + @VisibleForTesting + public VideoTech getVideoTech() { + if (savedTech == emptyVideoTech) { + for (VideoTech tech : videoTechs) { + if (tech.isAvailable(context)) { + savedTech = tech; + savedTech.becomePrimary(); + break; + } } + } else if (savedTech instanceof DuoVideoTech && rcsVideoShare.isAvailable(context)) { + // RCS Video Share will become available after the capability exchange which is slower than + // Duo reading local contacts for reachability. If Video Share becomes available and we are + // not in the middle of any session changes, let it take over. + savedTech = rcsVideoShare; + rcsVideoShare.becomePrimary(); } - return emptyVideoTech; + return savedTech; } - void dispatchCallStateChanged(int newState) { + @VisibleForTesting + public void dispatchCallStateChanged(int newState) { for (VideoTech videoTech : videoTechs) { videoTech.onCallStateChanged(context, newState); } |