Add videoStateToString on videoProvider Class.
- Got tired of looking at numerical integer videoStates, so added a new "videoStateToString" static method, similar to how we have a Connection#capabilitiesToString method. Bug: 20257400 Change-Id: I39fcf413938c90e5993985f0976ad4fcce11505d
This commit is contained in:
@@ -28903,6 +28903,7 @@ package android.telecom {
|
||||
method public static boolean isPaused(int);
|
||||
method public static boolean isReceptionEnabled(int);
|
||||
method public static boolean isTransmissionEnabled(int);
|
||||
method public static java.lang.String videoStateToString(int);
|
||||
field public static final int AUDIO_ONLY = 0; // 0x0
|
||||
field public static final int BIDIRECTIONAL = 3; // 0x3
|
||||
field public static final int PAUSED = 4; // 0x4
|
||||
|
||||
@@ -30766,6 +30766,7 @@ package android.telecom {
|
||||
method public static boolean isPaused(int);
|
||||
method public static boolean isReceptionEnabled(int);
|
||||
method public static boolean isTransmissionEnabled(int);
|
||||
method public static java.lang.String videoStateToString(int);
|
||||
field public static final int AUDIO_ONLY = 0; // 0x0
|
||||
field public static final int BIDIRECTIONAL = 3; // 0x3
|
||||
field public static final int PAUSED = 4; // 0x4
|
||||
|
||||
@@ -144,6 +144,17 @@ public class VideoProfile implements Parcelable {
|
||||
dest.writeInt(mQuality);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[VideoProfile videoState = ");
|
||||
sb.append(VideoState.videoStateToString(mVideoState));
|
||||
sb.append(" videoQuality = ");
|
||||
sb.append(mQuality);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* The video state of the call, stored as a bit-field describing whether video transmission and
|
||||
* receipt it enabled, as well as whether the video is currently muted.
|
||||
@@ -241,5 +252,30 @@ public class VideoProfile implements Parcelable {
|
||||
private static boolean hasState(int videoState, int state) {
|
||||
return (videoState & state) == state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of a {@link VideoState}.
|
||||
*
|
||||
* @param videoState The video state.
|
||||
* @return String representation of the {@link VideoState}.
|
||||
*/
|
||||
public static String videoStateToString(int videoState) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Audio");
|
||||
|
||||
if (VideoProfile.VideoState.isTransmissionEnabled(videoState)) {
|
||||
sb.append(" Tx");
|
||||
}
|
||||
|
||||
if (VideoProfile.VideoState.isReceptionEnabled(videoState)) {
|
||||
sb.append(" Rx");
|
||||
}
|
||||
|
||||
if (VideoProfile.VideoState.isPaused(videoState)) {
|
||||
sb.append(" Pause");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user