summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroldenburg <roldenburg@google.com>2018-01-16 12:07:04 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-16 16:17:43 -0800
commit3eca69f8ceb91537f72ca6df797bf4cfd93bc41b (patch)
treecf647ced3f6249819604519ebdf4f45558ddd8dc
parent0123d0030fd6dcbb33020240217a40e641d60c5e (diff)
Use EmptyVideoTech instead of null RcsVideoShare VideoTech impl when unavailable
Bug: 67005309,71880949 Test: VideoTechManagerTest PiperOrigin-RevId: 182091664 Change-Id: I0be4d4f9740e2bb678e772ec8526ccf176c334eb
-rw-r--r--java/com/android/dialer/enrichedcall/RcsVideoShareFactory.java1
-rw-r--r--java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java3
-rw-r--r--java/com/android/incallui/call/DialerCall.java4
3 files changed, 4 insertions, 4 deletions
diff --git a/java/com/android/dialer/enrichedcall/RcsVideoShareFactory.java b/java/com/android/dialer/enrichedcall/RcsVideoShareFactory.java
index 38f91da7d..faea3bc5a 100644
--- a/java/com/android/dialer/enrichedcall/RcsVideoShareFactory.java
+++ b/java/com/android/dialer/enrichedcall/RcsVideoShareFactory.java
@@ -23,6 +23,7 @@ import com.android.incallui.videotech.VideoTech.VideoTechListener;
/** Interface for creating new RCS video tech instances. */
public interface RcsVideoShareFactory {
+ @NonNull
VideoTech newRcsVideoShare(
@NonNull EnrichedCallManager enrichedCallManager,
@NonNull VideoTechListener videoTechListener,
diff --git a/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java b/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java
index 6ee1a86a9..93e15790a 100644
--- a/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java
+++ b/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java
@@ -18,6 +18,7 @@ package com.android.dialer.enrichedcall.stub;
import com.android.dialer.enrichedcall.EnrichedCallManager;
import com.android.dialer.enrichedcall.RcsVideoShareFactory;
+import com.android.incallui.videotech.empty.EmptyVideoTech;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
@@ -35,7 +36,7 @@ public class StubEnrichedCallModule {
@Provides
@Singleton
static RcsVideoShareFactory providesRcsVideoShareFactory() {
- return (enrichedCallManager, videoTechListener, number) -> null;
+ return (enrichedCallManager, videoTechListener, number) -> new EmptyVideoTech();
}
private StubEnrichedCallModule() {}
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index dd7535e20..d57271ae9 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -1664,9 +1664,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
EnrichedCallComponent.get(call.context).getEnrichedCallManager(),
call,
phoneNumber);
- if (rcsVideoShare != null) {
- videoTechs.add(rcsVideoShare);
- }
+ videoTechs.add(rcsVideoShare);
videoTechs.add(
new DuoVideoTech(