diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-09-19 21:55:42 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-09-19 21:55:42 +0000 |
commit | 15c5ccfc3a76c89b047722b398e63889d900ec5e (patch) | |
tree | ccc4ba1be4af03ced6f837b0dc86bb9800ce9370 /java/com/android/incallui | |
parent | 06d4df10f100b9bbfcf119aef376770eeb6eb82c (diff) | |
parent | 791f820f5108b3ea914690145ef261d6c01bf41a (diff) |
Merge changes I3f26d915,I59500877,Ia08ce56f
* changes:
Perform remote reachability query if caller is not in contacts
Only enable voicemail transcription on android O and later
Removed zero suggest from dialpad search in new search fragment.
Diffstat (limited to 'java/com/android/incallui')
-rw-r--r-- | java/com/android/incallui/videotech/lightbringer/LightbringerTech.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java index a807759db..4b6f5ec5a 100644 --- a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java +++ b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java @@ -31,6 +31,8 @@ import com.android.incallui.video.protocol.VideoCallScreen; import com.android.incallui.video.protocol.VideoCallScreenDelegate; import com.android.incallui.videotech.VideoTech; import com.android.incallui.videotech.utils.SessionModificationState; +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableList; public class LightbringerTech implements VideoTech, LightbringerListener { private final Lightbringer lightbringer; @@ -38,6 +40,7 @@ public class LightbringerTech implements VideoTech, LightbringerListener { private final Call call; private final String callingNumber; private int callState = Call.STATE_NEW; + private boolean isRemoteUpgradeAvailabilityQueried; public LightbringerTech( @NonNull Lightbringer lightbringer, @@ -69,13 +72,20 @@ public class LightbringerTech implements VideoTech, LightbringerListener { LogUtil.v("LightbringerTech.isAvailable", "upgrade unavailable, call must be active"); return false; } + Optional<Boolean> localResult = lightbringer.supportsUpgrade(context, callingNumber); + if (localResult.isPresent()) { + LogUtil.v( + "LightbringerTech.isAvailable", "upgrade supported in local cache: " + localResult.get()); + return localResult.get(); + } - if (!lightbringer.supportsUpgrade(context, callingNumber)) { - LogUtil.v("LightbringerTech.isAvailable", "upgrade unavailable, number does not support it"); - return false; + if (!isRemoteUpgradeAvailabilityQueried) { + LogUtil.v("LightbringerTech.isAvailable", "reachability unknown, starting remote query"); + isRemoteUpgradeAvailabilityQueried = true; + lightbringer.updateReachability(context, ImmutableList.of(callingNumber)); } - return true; + return false; } @Override |