Remove connection substate

Bug:20300433
Change-Id: Iec4a56229ee30f3183c9f4cf37bed3f028eed155
diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml
index cfe3d41..b8a84c7 100644
--- a/InCallUI/res/values/strings.xml
+++ b/InCallUI/res/values/strings.xml
@@ -447,17 +447,6 @@
     <!-- This can be used in any application wanting to disable the text "Emergency number" -->
     <string name="emergency_call_dialog_number_for_display">Emergency number</string>
 
-    <!-- STOPSHIP These strings are for debugging only -->
-    <!-- Call substate label -->
-    <string name="call_substate_label" translatable="false">Call substate - \u000a</string>
-    <!-- Call substate label for call resumed -->
-    <string name="call_substate_call_resumed" translatable="false">Resumed \u000a</string>
-    <!-- Call substate label for call connected suspended (audio) -->
-    <string name="call_substate_connected_suspended_audio" translatable="false">Connected Suspended (Audio) \u000a</string>
-    <!-- Call substate label for call connected suspended (video) -->
-    <string name="call_substate_connected_suspended_video" translatable="false">Connected Suspended (Video) \u000a</string>
-    <!-- Call substate label for avp retry -->
-    <string name="call_substate_avp_retry" translatable="false">Avp Retry \u000a</string>
     <!-- Video quality changed message -->
     <string name="video_quality_changed" translatable="false">Video quality changed to \u0020</string>
     <!-- Video quality High -->
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index d637c8a..e26c047 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -466,10 +466,6 @@
         return mTelecommCall.getDetails().getVideoState();
     }
 
-    public int getCallSubstate() {
-        return mTelecommCall.getDetails().getCallSubstate();
-    }
-
     public boolean isVideoCall(Context context) {
         return CallUtil.isVideoEnabled(context) &&
                 VideoProfile.VideoState.isVideo(getVideoState());
@@ -553,7 +549,7 @@
         }
 
         return String.format(Locale.US, "[%s, %s, %s, children:%s, parent:%s, conferenceable:%s, " +
-                "videoState:%d, callSubState:%d, mSessionModificationState:%d, VideoSettings:%s]",
+                "videoState:%d, mSessionModificationState:%d, VideoSettings:%s]",
                 mId,
                 State.toString(getState()),
                 android.telecom.Call.Details
@@ -562,7 +558,6 @@
                 getParentId(),
                 this.mTelecommCall.getConferenceableCalls(),
                 mTelecommCall.getDetails().getVideoState(),
-                mTelecommCall.getDetails().getCallSubstate(),
                 mSessionModificationState,
                 getVideoSettings());
     }
diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java
index fb29c9c..6077017 100644
--- a/InCallUI/src/com/android/incallui/VideoCallFragment.java
+++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java
@@ -595,58 +595,6 @@
     }
 
     /**
-     * Displays a message on the UI that the call substate has changed.
-     *
-     */
-    @Override
-    public void showCallSubstateChanged(int callSubstate) {
-        Log.d(this, "showCallSubstateChanged - call substate changed to "  + callSubstate);
-
-        final Context context = getActivity();
-        if (context == null) {
-            Log.e(this, "showCallSubstateChanged - Activity is null. Return");
-            return;
-        }
-
-        final Resources resources = context.getResources();
-
-        String callSubstateChangedText = "";
-
-        if (isEnabled(Connection.SUBSTATE_AUDIO_CONNECTED_SUSPENDED, callSubstate)) {
-            callSubstateChangedText +=
-                resources.getString(R.string.call_substate_connected_suspended_audio);
-        }
-
-        if (isEnabled(Connection.SUBSTATE_VIDEO_CONNECTED_SUSPENDED, callSubstate)) {
-            callSubstateChangedText +=
-                resources.getString(R.string.call_substate_connected_suspended_video);
-        }
-
-        if (isEnabled(Connection.SUBSTATE_AVP_RETRY, callSubstate)) {
-            callSubstateChangedText +=
-                resources.getString(R.string.call_substate_avp_retry);
-        }
-
-        if (isNotEnabled(Connection.SUBSTATE_ALL, callSubstate)) {
-            callSubstateChangedText = resources.getString(R.string.call_substate_call_resumed);
-        }
-
-        if (!callSubstateChangedText.isEmpty()) {
-            String callSubstateLabelText = resources.getString(R.string.call_substate_label);
-            Toast.makeText(context, callSubstateLabelText + callSubstateChangedText,
-                Toast.LENGTH_SHORT).show();
-        }
-    }
-
-    boolean isEnabled(int mask, int callSubstate) {
-        return (mask & callSubstate) == mask;
-    }
-
-    boolean isNotEnabled(int mask, int callSubstate) {
-        return (mask & callSubstate) == 0;
-    }
-
-    /**
      * Cleans up the video telephony surfaces.  Used when the presenter indicates a change to an
      * audio-only state.  Since the surfaces are static, it is important to ensure they are cleaned
      * up promptly.
diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
index b9aeacf..f11f328 100644
--- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
@@ -158,11 +158,6 @@
 
     private static boolean mIsVideoMode = false;
 
-    /**
-     * Stores the current call substate.
-     */
-    private int mCurrentCallSubstate;
-
     /** Handler which resets request state to NO_REQUEST after an interval. */
     private Handler mSessionModificationResetHandler;
     private static final long SESSION_MODIFICATION_RESET_DELAY_MS = 3000;
@@ -449,19 +444,6 @@
         showVideoUi(call.getVideoState(), call.getState());
     }
 
-    private void checkForCallSubstateChange(Call call) {
-        if (mCurrentCallSubstate != call.getCallSubstate()) {
-            VideoCallUi ui = getUi();
-            if (ui == null) {
-                Log.e(this, "Error VideoCallUi is null. Return.");
-                return;
-            }
-            mCurrentCallSubstate = call.getCallSubstate();
-            // Display a call substate changed message on UI.
-            ui.showCallSubstateChanged(mCurrentCallSubstate);
-        }
-    }
-
     private void cleanupSurfaces() {
         final VideoCallUi ui = getUi();
         if (ui == null) {
@@ -498,13 +480,11 @@
     private void updateCallCache(Call call) {
         if (call == null) {
             mCurrentVideoState = VideoProfile.VideoState.AUDIO_ONLY;
-            mCurrentCallSubstate = Connection.SUBSTATE_NONE;
             mCurrentCallState = Call.State.INVALID;
             mVideoCall = null;
             mPrimaryCall = null;
         } else {
             mCurrentVideoState = call.getVideoState();
-            mCurrentCallSubstate = call.getCallSubstate();
             mVideoCall = call.getVideoCall();
             mCurrentCallState = call.getState();
             mPrimaryCall = call;
@@ -529,7 +509,6 @@
         }
 
         updateVideoCall(call);
-        checkForCallSubstateChange(call);
 
         updateCallCache(call);
     }
@@ -1141,6 +1120,5 @@
         Point getScreenSize();
         Point getPreviewSize();
         void cleanupSurfaces();
-        void showCallSubstateChanged(int callSubstate);
     }
 }