Pass PhoneAccountHandle into VideoTech isAvailable

Bug: 71840382
Test: DuoImplTest, existing tests
PiperOrigin-RevId: 182424150
Change-Id: I25607d43e1915d57134feac99b2c2240ae9559f9
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index d57271a..2724322 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -525,7 +525,7 @@
     Trace.beginSection("DialerCall.updateFromTelecomCall");
     LogUtil.v("DialerCall.updateFromTelecomCall", telecomCall.toString());
 
-    videoTechManager.dispatchCallStateChanged(telecomCall.getState());
+    videoTechManager.dispatchCallStateChanged(telecomCall.getState(), getAccountHandle());
 
     final int translatedState = translateState(telecomCall.getState());
     if (state != State.BLOCKED) {
@@ -1258,7 +1258,7 @@
 
   public VideoTech getVideoTech() {
     if (videoTech == null) {
-      videoTech = videoTechManager.getVideoTech();
+      videoTech = videoTechManager.getVideoTech(getAccountHandle());
 
       // Only store the first video tech type found to be available during the life of the call.
       if (selectedAvailableVideoTechType == com.android.dialer.logging.VideoTech.Type.NONE) {
@@ -1674,16 +1674,17 @@
     }
 
     @VisibleForTesting
-    public VideoTech getVideoTech() {
+    public VideoTech getVideoTech(PhoneAccountHandle phoneAccountHandle) {
       if (savedTech == emptyVideoTech) {
         for (VideoTech tech : videoTechs) {
-          if (tech.isAvailable(context)) {
+          if (tech.isAvailable(context, phoneAccountHandle)) {
             savedTech = tech;
             savedTech.becomePrimary();
             break;
           }
         }
-      } else if (savedTech instanceof DuoVideoTech && rcsVideoShare.isAvailable(context)) {
+      } else if (savedTech instanceof DuoVideoTech
+          && rcsVideoShare.isAvailable(context, phoneAccountHandle)) {
         // 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.
@@ -1695,9 +1696,9 @@
     }
 
     @VisibleForTesting
-    public void dispatchCallStateChanged(int newState) {
+    public void dispatchCallStateChanged(int newState, PhoneAccountHandle phoneAccountHandle) {
       for (VideoTech videoTech : videoTechs) {
-        videoTech.onCallStateChanged(context, newState);
+        videoTech.onCallStateChanged(context, newState, phoneAccountHandle);
       }
     }