Check all sub call state to disable VT setting

If user makes a call with a non primary call sub, VT setting is not
disabled. Because these settings checks only call state of primary call
sub. All call sub should be checked and disable VT setting.

Test: manual - Verified that VT setting is disabled during non default
call sub calling.
Bug: 69722270

Change-Id: I6a00bc63f3fcd426ceb01777633ad246d363878f
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 5a228a8..233530e 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -194,7 +194,12 @@
         public void onCallStateChanged(int state, String incomingNumber) {
             if (DBG) log("PhoneStateListener onCallStateChanged: state is " + state);
             if (mEnableVideoCalling != null) {
-                mEnableVideoCalling.setEnabled(state == TelephonyManager.CALL_STATE_IDLE);
+                // Use TelephonyManager#getCallStete instead of 'state' parameter because it needs
+                // to check the current state of all phone calls.
+                TelephonyManager telephonyManager =
+                        (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+                mEnableVideoCalling.setEnabled(
+                        telephonyManager.getCallState() == TelephonyManager.CALL_STATE_IDLE);
             }
         }
     };
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 96309ad..0accb56 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -266,8 +266,10 @@
 
         private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
             /*
-             * Enable/disable the 'Enhanced 4G LTE Mode' when in/out of a call
-             * and depending on TTY mode and TTY support over VoLTE.
+             * Enable/disable the 'Enhanced 4G LTE Mode' and 'Carrier video calling'
+             * when in/out of a call. 'Enhanced 4G LTE Mode' depends on TTY mode
+             * and TTY support over VoLTE.
+             *
              * @see android.telephony.PhoneStateListener#onCallStateChanged(int,
              * java.lang.String)
              */
@@ -283,6 +285,7 @@
                 Preference pref = getPreferenceScreen().findPreference(BUTTON_4G_LTE_KEY);
                 if (pref != null) pref.setEnabled(enabled && hasActiveSubscriptions());
 
+                updateVideoCallState();
             }
         };
 
@@ -1708,7 +1711,8 @@
                     mVideoCallingPref.setEnabled(false);
                     mVideoCallingPref.setChecked(false);
                 } else {
-                    mVideoCallingPref.setEnabled(true);
+                    mVideoCallingPref.setEnabled(
+                            mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_IDLE);
                     mVideoCallingPref.setChecked(mImsMgr.isVtEnabledByUser());
                     mVideoCallingPref.setOnPreferenceChangeListener(this);
                 }