OSDN Git Service

Fix videoStateToString for audio/paused state.
authorTyler Gunn <tgunn@google.com>
Tue, 21 Feb 2017 23:19:43 +0000 (15:19 -0800)
committerTyler Gunn <tgunn@google.com>
Wed, 22 Feb 2017 03:22:21 +0000 (19:22 -0800)
The videoStateToString method erroneously assumed that if the videostate
was Audio - Paused, that it was audio-only.  Simple logic error to fix.

Test: Added new unit tests.
Bug: 35645334
Change-Id: Ia5ae4d05284b70ad4ba86b8e5d2c53ee8e68a1fa

telecomm/java/android/telecom/VideoProfile.java

index 216603c..e0e3a08 100644 (file)
@@ -235,7 +235,7 @@ public class VideoProfile implements Parcelable {
         StringBuilder sb = new StringBuilder();
         sb.append("Audio");
 
-        if (isAudioOnly(videoState)) {
+        if (videoState == STATE_AUDIO_ONLY) {
             sb.append(" Only");
         } else {
             if (isTransmissionEnabled(videoState)) {
@@ -256,6 +256,9 @@ public class VideoProfile implements Parcelable {
 
     /**
      * Indicates whether the video state is audio only.
+     * <p>
+     * Note: Considers only whether either both the {@link #STATE_RX_ENABLED} or
+     * {@link #STATE_TX_ENABLED} bits are off, but not {@link #STATE_PAUSED}.
      *
      * @param videoState The video state.
      * @return {@code True} if the video state is audio only, {@code false} otherwise.