summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-06-03 10:09:59 -0700
committerTyler Gunn <tgunn@google.com>2015-06-03 10:09:59 -0700
commit87b73f370e2b8a76b0540580f43edba6ec21c6cf (patch)
tree3990fd7eb2b25e1081388fb3c0a10e8459380728 /telecomm
parent6ef831fe1a953f6b67f3c6a43bde38e80689698b (diff)
downloadframeworks_base-87b73f370e2b8a76b0540580f43edba6ec21c6cf.zip
frameworks_base-87b73f370e2b8a76b0540580f43edba6ec21c6cf.tar.gz
frameworks_base-87b73f370e2b8a76b0540580f43edba6ec21c6cf.tar.bz2
API Cleanup: Remove VideoState class.
- Remove VideoState class. - Replace references to VideoState constants with VideoProfile equivalent. - Push VideoState static methods into VideoProfile. Bug: 21573551 Change-Id: I1bca02772b5b7d86643f612824b07faef7618725
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecom/Conference.java2
-rw-r--r--telecomm/java/android/telecom/Connection.java2
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java2
-rw-r--r--telecomm/java/android/telecom/ConnectionServiceAdapter.java8
-rw-r--r--telecomm/java/android/telecom/RemoteConnection.java2
-rw-r--r--telecomm/java/android/telecom/VideoProfile.java214
6 files changed, 97 insertions, 133 deletions
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index b18feb5..77fdb65 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -206,7 +206,7 @@ public abstract class Conference extends Conferenceable {
* Returns video state of the primary call.
*/
public int getVideoState() {
- return VideoProfile.VideoState.AUDIO_ONLY;
+ return VideoProfile.STATE_AUDIO_ONLY;
}
/**
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index e2bbc62..bb210f1 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -1608,7 +1608,7 @@ public abstract class Connection extends Conferenceable {
* a request to accept.
*/
public void onAnswer() {
- onAnswer(VideoProfile.VideoState.AUDIO_ONLY);
+ onAnswer(VideoProfile.STATE_AUDIO_ONLY);
}
/**
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index 975df5d..6863214 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -42,7 +42,7 @@ public final class ConnectionRequest implements Parcelable {
PhoneAccountHandle accountHandle,
Uri handle,
Bundle extras) {
- this(accountHandle, handle, extras, VideoProfile.VideoState.AUDIO_ONLY);
+ this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY);
}
/**
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
index 1cb042c..4ab9ee5 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -342,10 +342,10 @@ final class ConnectionServiceAdapter implements DeathRecipient {
/**
* Sets the video state associated with a call.
*
- * Valid values: {@link VideoProfile.VideoState#AUDIO_ONLY},
- * {@link VideoProfile.VideoState#BIDIRECTIONAL},
- * {@link VideoProfile.VideoState#TX_ENABLED},
- * {@link VideoProfile.VideoState#RX_ENABLED}.
+ * Valid values: {@link VideoProfile#STATE_BIDIRECTIONAL},
+ * {@link VideoProfile#STATE_AUDIO_ONLY},
+ * {@link VideoProfile#STATE_TX_ENABLED},
+ * {@link VideoProfile#STATE_RX_ENABLED}.
*
* @param callId The unique ID of the call to set the video state for.
* @param videoState The video state.
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 52c60e6..d62c08e 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -605,7 +605,7 @@ public final class RemoteConnection {
/**
* Obtains the video state of this {@code RemoteConnection}.
*
- * @return The video state of the {@code RemoteConnection}. See {@link VideoProfile.VideoState}.
+ * @return The video state of the {@code RemoteConnection}. See {@link VideoProfile}.
*/
public int getVideoState() {
return mVideoState;
diff --git a/telecomm/java/android/telecom/VideoProfile.java b/telecomm/java/android/telecom/VideoProfile.java
index 71de505..11a4976 100644
--- a/telecomm/java/android/telecom/VideoProfile.java
+++ b/telecomm/java/android/telecom/VideoProfile.java
@@ -173,7 +173,7 @@ public class VideoProfile implements Parcelable {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[VideoProfile videoState = ");
- sb.append(VideoState.videoStateToString(mVideoState));
+ sb.append(videoStateToString(mVideoState));
sb.append(" videoQuality = ");
sb.append(mQuality);
sb.append("]");
@@ -181,142 +181,106 @@ public class VideoProfile implements Parcelable {
}
/**
- * 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.
- */
- public static class VideoState {
- /**
- * Call is currently in an audio-only mode with no video transmission or receipt.
- * @deprecated Use {@link VideoProfile#STATE_AUDIO_ONLY} instead
- * @hide
- */
- public static final int AUDIO_ONLY = VideoProfile.STATE_AUDIO_ONLY;
-
- /**
- * Video transmission is enabled.
- * @deprecated Use {@link VideoProfile#STATE_TX_ENABLED} instead
- * @hide
- */
- public static final int TX_ENABLED = VideoProfile.STATE_TX_ENABLED;
-
- /**
- * Video reception is enabled.
- * @deprecated Use {@link VideoProfile#STATE_RX_ENABLED} instead
- * @hide
- */
- public static final int RX_ENABLED = VideoProfile.STATE_RX_ENABLED;
-
- /**
- * Video signal is bi-directional.
- * @deprecated Use {@link VideoProfile#STATE_BIDIRECTIONAL} instead
- * @hide
- */
- public static final int BIDIRECTIONAL = VideoProfile.STATE_BIDIRECTIONAL;
-
- /**
- * Video is paused.
- * @deprecated Use {@link VideoProfile#STATE_PAUSED} instead
- * @hide
- */
- public static final int PAUSED = VideoProfile.STATE_PAUSED;
-
- /** @hide */
- private VideoState() {}
-
- /**
- * Whether the video state is audio only.
- * @param videoState The video state.
- * @return Returns true if the video state is audio only.
- */
- public static boolean isAudioOnly(int videoState) {
- return !hasState(videoState, VideoProfile.STATE_TX_ENABLED)
- && !hasState(videoState, VideoProfile.STATE_RX_ENABLED);
- }
+ * Generates a string representation of a video state.
+ *
+ * @param videoState The video state.
+ * @return String representation of the video state.
+ */
+ public static String videoStateToString(int videoState) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Audio");
- /**
- * Whether the video state is any of the video type
- * @param videoState The video state.
- * @hide
- * @return Returns true if the video state TX or RX or Bidirectional
- */
- public static boolean isVideo(int videoState) {
- return hasState(videoState, VideoProfile.STATE_TX_ENABLED)
- || hasState(videoState, VideoProfile.STATE_RX_ENABLED)
- || hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL);
- }
+ if (isAudioOnly(videoState)) {
+ sb.append(" Only");
+ } else {
+ if (isTransmissionEnabled(videoState)) {
+ sb.append(" Tx");
+ }
- /**
- * Whether the video transmission is enabled.
- * @param videoState The video state.
- * @return Returns true if the video transmission is enabled.
- */
- public static boolean isTransmissionEnabled(int videoState) {
- return hasState(videoState, VideoProfile.STATE_TX_ENABLED);
- }
+ if (isReceptionEnabled(videoState)) {
+ sb.append(" Rx");
+ }
- /**
- * Whether the video reception is enabled.
- * @param videoState The video state.
- * @return Returns true if the video transmission is enabled.
- */
- public static boolean isReceptionEnabled(int videoState) {
- return hasState(videoState, VideoProfile.STATE_RX_ENABLED);
+ if (isPaused(videoState)) {
+ sb.append(" Pause");
+ }
}
- /**
- * Whether the video signal is bi-directional.
- * @param videoState
- * @return Returns true if the video signal is bi-directional.
- */
- public static boolean isBidirectional(int videoState) {
- return hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL);
- }
+ return sb.toString();
+ }
- /**
- * Whether the video is paused.
- * @param videoState The video state.
- * @return Returns true if the video is paused.
- */
- public static boolean isPaused(int videoState) {
- return hasState(videoState, VideoProfile.STATE_PAUSED);
- }
+ /**
+ * Indicates whether the video state is audio only.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if the video state is audio only, {@code false} otherwise.
+ */
+ public static boolean isAudioOnly(int videoState) {
+ return !hasState(videoState, VideoProfile.STATE_TX_ENABLED)
+ && !hasState(videoState, VideoProfile.STATE_RX_ENABLED);
+ }
- /**
- * Determines if a specified state is set in a videoState bit-mask.
- *
- * @param videoState The video state bit-mask.
- * @param state The state to check.
- * @return {@code True} if the state is set.
- * {@hide}
- */
- private static boolean hasState(int videoState, int state) {
- return (videoState & state) == state;
- }
+ /**
+ * Indicates whether video transmission or reception is enabled for a video state.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if video transmission or reception is enabled, {@code false} otherwise.
+ */
+ public static boolean isVideo(int videoState) {
+ return hasState(videoState, VideoProfile.STATE_TX_ENABLED)
+ || hasState(videoState, VideoProfile.STATE_RX_ENABLED)
+ || hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL);
+ }
- /**
- * 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");
+ /**
+ * Indicates whether the video state has video transmission enabled.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if video transmission is enabled, {@code false} otherwise.
+ */
+ public static boolean isTransmissionEnabled(int videoState) {
+ return hasState(videoState, VideoProfile.STATE_TX_ENABLED);
+ }
- if (VideoProfile.VideoState.isTransmissionEnabled(videoState)) {
- sb.append(" Tx");
- }
+ /**
+ * Indicates whether the video state has video reception enabled.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if video reception is enabled, {@code false} otherwise.
+ */
+ public static boolean isReceptionEnabled(int videoState) {
+ return hasState(videoState, VideoProfile.STATE_RX_ENABLED);
+ }
- if (VideoProfile.VideoState.isReceptionEnabled(videoState)) {
- sb.append(" Rx");
- }
+ /**
+ * Indicates whether the video state is bi-directional.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if the video is bi-directional, {@code false} otherwise.
+ */
+ public static boolean isBidirectional(int videoState) {
+ return hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL);
+ }
- if (VideoProfile.VideoState.isPaused(videoState)) {
- sb.append(" Pause");
- }
+ /**
+ * Indicates whether the video state is paused.
+ *
+ * @param videoState The video state.
+ * @return {@code True} if the video is paused, {@code false} otherwise.
+ */
+ public static boolean isPaused(int videoState) {
+ return hasState(videoState, VideoProfile.STATE_PAUSED);
+ }
- return sb.toString();
- }
+ /**
+ * Indicates if a specified state is set in a videoState bit-mask.
+ *
+ * @param videoState The video state bit-mask.
+ * @param state The state to check.
+ * @return {@code True} if the state is set.
+ */
+ private static boolean hasState(int videoState, int state) {
+ return (videoState & state) == state;
}
/**