Merge "Add more capabilities to TestVideoProvider" into m-wireless-dev
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index d20fdf5..e4476bb 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -416,18 +416,48 @@
component = mConnectionService.getComponentName().flattenToShortString();
}
- return String.format(Locale.US, "[%s, %s, %s, %s, %d, childs(%d), has_parent(%b), [%s], %d]",
+
+
+ return String.format(Locale.US, "[%s, %s, %s, %s, %s, childs(%d), has_parent(%b), [%s], %d]",
System.identityHashCode(this),
CallState.toString(mState),
component,
Log.piiHandle(mHandle),
- getVideoState(),
+ getVideoStateDescription(getVideoState()),
getChildCalls().size(),
getParentCall() != null,
Connection.capabilitiesToString(getConnectionCapabilities()),
getCallSubstate());
}
+ /**
+ * Builds a debug-friendly description string for a video state.
+ * <p>
+ * A = audio active, T = video transmission active, R = video reception active, P = video
+ * paused.
+ *
+ * @param videoState The video state.
+ * @return A string indicating which bits are set in the video state.
+ */
+ private String getVideoStateDescription(int videoState) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("A");
+
+ if (VideoProfile.VideoState.isTransmissionEnabled(videoState)) {
+ sb.append("T");
+ }
+
+ if (VideoProfile.VideoState.isReceptionEnabled(videoState)) {
+ sb.append("R");
+ }
+
+ if (VideoProfile.VideoState.isPaused(videoState)) {
+ sb.append("P");
+ }
+
+ return sb.toString();
+ }
+
int getState() {
return mState;
}
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 5d06ddc..17e9e37 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -624,7 +624,10 @@
android.telecom.Call.Details.CAPABILITY_SHOW_CALLBACK_NUMBER,
Connection.CAPABILITY_CAN_UPGRADE_TO_VIDEO,
- android.telecom.Call.Details.CAPABILITY_CAN_UPGRADE_TO_VIDEO
+ android.telecom.Call.Details.CAPABILITY_CAN_UPGRADE_TO_VIDEO,
+
+ Connection.CAPABILITY_CAN_PAUSE_VIDEO,
+ android.telecom.Call.Details.CAPABILITY_CAN_PAUSE_VIDEO
};
private static int convertConnectionToCallCapabilities(int connectionCapabilities) {