Hiding videoState values in telecomm APIs. (1/3)
Hiding in Connection, ConnectionRequest, and ConnectionService. Also @hiding PhoneAccount and PhoneCapabilities attributes related to VT. Bug: 17243002 Change-Id: I685305cddb99e1d2eb767982106253894a8d282f
This commit is contained in:
@@ -28275,17 +28275,6 @@ package android.telecomm {
|
||||
field public final int supportedRouteMask;
|
||||
}
|
||||
|
||||
public final class CameraCapabilities implements android.os.Parcelable {
|
||||
ctor public CameraCapabilities(boolean, float, int, int);
|
||||
method public int describeContents();
|
||||
method public int getHeight();
|
||||
method public float getMaxZoom();
|
||||
method public int getWidth();
|
||||
method public boolean isZoomSupported();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator CREATOR;
|
||||
}
|
||||
|
||||
public abstract class Conference {
|
||||
ctor public Conference(android.telecomm.PhoneAccountHandle);
|
||||
method public boolean addConnection(android.telecomm.Connection);
|
||||
@@ -28325,7 +28314,7 @@ package android.telecomm {
|
||||
method public final android.telecomm.StatusHints getStatusHints();
|
||||
method public final boolean isRequestingRingback();
|
||||
method public void onAbort();
|
||||
method public void onAnswer(int);
|
||||
method public void onAnswer();
|
||||
method public void onConferenceWith(android.telecomm.Connection);
|
||||
method public void onDisconnect();
|
||||
method public void onHold();
|
||||
@@ -28366,7 +28355,7 @@ package android.telecomm {
|
||||
}
|
||||
|
||||
public final class ConnectionRequest implements android.os.Parcelable {
|
||||
ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, int, android.os.Bundle, int);
|
||||
ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, int, android.os.Bundle);
|
||||
method public int describeContents();
|
||||
method public android.telecomm.PhoneAccountHandle getAccountHandle();
|
||||
method public android.os.Bundle getExtras();
|
||||
@@ -28417,7 +28406,6 @@ package android.telecomm {
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1
|
||||
field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
|
||||
field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8
|
||||
field public static final android.os.Parcelable.Creator CREATOR;
|
||||
}
|
||||
|
||||
@@ -28444,18 +28432,14 @@ package android.telecomm {
|
||||
public final class PhoneCapabilities {
|
||||
method public static java.lang.String toString(int);
|
||||
field public static final int ADD_CALL = 16; // 0x10
|
||||
field public static final int ALL = 3327; // 0xcff
|
||||
field public static final int ALL = 255; // 0xff
|
||||
field public static final int GENERIC_CONFERENCE = 128; // 0x80
|
||||
field public static final int HOLD = 1; // 0x1
|
||||
field public static final int MERGE_CALLS = 4; // 0x4
|
||||
field public static final int MUTE = 64; // 0x40
|
||||
field public static final int RESPOND_VIA_TEXT = 32; // 0x20
|
||||
field public static final int SUPPORTS_VT_LOCAL = 256; // 0x100
|
||||
field public static final int SUPPORTS_VT_REMOTE = 512; // 0x200
|
||||
field public static final int SUPPORT_HOLD = 2; // 0x2
|
||||
field public static final int SWAP_CALLS = 8; // 0x8
|
||||
field public static final int VoLTE = 1024; // 0x400
|
||||
field public static final int VoWIFI = 2048; // 0x800
|
||||
}
|
||||
|
||||
public class PropertyPresentation {
|
||||
@@ -28493,7 +28477,7 @@ package android.telecomm {
|
||||
public final class RemoteConnection {
|
||||
method public void abort();
|
||||
method public void addListener(android.telecomm.RemoteConnection.Listener);
|
||||
method public void answer(int);
|
||||
method public void answer();
|
||||
method public void disconnect();
|
||||
method public boolean getAudioModeIsVoip();
|
||||
method public int getCallCapabilities();
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* Represents the camera capabilities important to a Video Telephony provider.
|
||||
* @hide
|
||||
*/
|
||||
public final class CameraCapabilities implements Parcelable {
|
||||
|
||||
|
||||
@@ -1012,9 +1012,18 @@ public abstract class Connection {
|
||||
* a request to accept.
|
||||
*
|
||||
* @param videoState The video state in which to answer the call.
|
||||
* @hide
|
||||
*/
|
||||
public void onAnswer(int videoState) {}
|
||||
|
||||
/**
|
||||
* Notifies this Connection, which is in {@link #STATE_RINGING}, of
|
||||
* a request to accept.
|
||||
*/
|
||||
public void onAnswer() {
|
||||
onAnswer(VideoProfile.VideoState.AUDIO_ONLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies this Connection, which is in {@link #STATE_RINGING}, of
|
||||
* a request to reject.
|
||||
|
||||
@@ -34,6 +34,21 @@ public final class ConnectionRequest implements Parcelable {
|
||||
private final Bundle mExtras;
|
||||
private final int mVideoState;
|
||||
|
||||
/**
|
||||
* @param accountHandle The accountHandle which should be used to place the call.
|
||||
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
|
||||
* @param handlePresentation The {@link PropertyPresentation} which controls how the handle
|
||||
* is shown.
|
||||
* @param extras Application-specific extra data.
|
||||
*/
|
||||
public ConnectionRequest(
|
||||
PhoneAccountHandle accountHandle,
|
||||
Uri handle,
|
||||
int handlePresentation,
|
||||
Bundle extras) {
|
||||
this(accountHandle, handle, handlePresentation, extras, VideoProfile.VideoState.AUDIO_ONLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param accountHandle The accountHandle which should be used to place the call.
|
||||
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
|
||||
@@ -41,6 +56,7 @@ public final class ConnectionRequest implements Parcelable {
|
||||
* is shown.
|
||||
* @param extras Application-specific extra data.
|
||||
* @param videoState Determines the video state for the connection.
|
||||
* @hide
|
||||
*/
|
||||
public ConnectionRequest(
|
||||
PhoneAccountHandle accountHandle,
|
||||
|
||||
@@ -71,6 +71,7 @@ public abstract class ConnectionService extends Service {
|
||||
private static final int MSG_ON_POST_DIAL_CONTINUE = 14;
|
||||
private static final int MSG_ON_PHONE_ACCOUNT_CLICKED = 15;
|
||||
private static final int MSG_REMOVE_CONNECTION_SERVICE_ADAPTER = 16;
|
||||
private static final int MSG_ANSWER_VIDEO = 17;
|
||||
|
||||
private static Connection sNullConnection;
|
||||
|
||||
@@ -116,11 +117,17 @@ public abstract class ConnectionService extends Service {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void answer(String callId, int videoState) {
|
||||
/** @hide */
|
||||
public void answerVideo(String callId, int videoState) {
|
||||
SomeArgs args = SomeArgs.obtain();
|
||||
args.arg1 = callId;
|
||||
args.argi1 = videoState;
|
||||
mHandler.obtainMessage(MSG_ANSWER, args).sendToTarget();
|
||||
mHandler.obtainMessage(MSG_ANSWER_VIDEO, args).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void answer(String callId) {
|
||||
mHandler.obtainMessage(MSG_ANSWER, callId).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -234,12 +241,15 @@ public abstract class ConnectionService extends Service {
|
||||
case MSG_ABORT:
|
||||
abort((String) msg.obj);
|
||||
break;
|
||||
case MSG_ANSWER: {
|
||||
case MSG_ANSWER:
|
||||
answer((String) msg.obj);
|
||||
break;
|
||||
case MSG_ANSWER_VIDEO: {
|
||||
SomeArgs args = (SomeArgs) msg.obj;
|
||||
try {
|
||||
String callId = (String) args.arg1;
|
||||
int videoState = args.argi1;
|
||||
answer(callId, videoState);
|
||||
answerVideo(callId, videoState);
|
||||
} finally {
|
||||
args.recycle();
|
||||
}
|
||||
@@ -545,11 +555,16 @@ public abstract class ConnectionService extends Service {
|
||||
findConnectionForAction(callId, "abort").onAbort();
|
||||
}
|
||||
|
||||
private void answer(String callId, int videoState) {
|
||||
Log.d(this, "answer %s", callId);
|
||||
private void answerVideo(String callId, int videoState) {
|
||||
Log.d(this, "answerVideo %s", callId);
|
||||
findConnectionForAction(callId, "answer").onAnswer(videoState);
|
||||
}
|
||||
|
||||
private void answer(String callId) {
|
||||
Log.d(this, "answer %s", callId);
|
||||
findConnectionForAction(callId, "answer").onAnswer();
|
||||
}
|
||||
|
||||
private void reject(String callId) {
|
||||
Log.d(this, "reject %s", callId);
|
||||
findConnectionForAction(callId, "reject").onReject();
|
||||
|
||||
@@ -73,6 +73,7 @@ public class PhoneAccount implements Parcelable {
|
||||
* Flag indicating that this {@code PhoneAccount} is capable of placing video calls.
|
||||
* <p>
|
||||
* See {@link #getCapabilities}
|
||||
* @hide
|
||||
*/
|
||||
public static final int CAPABILITY_VIDEO_CALLING = 0x8;
|
||||
|
||||
|
||||
@@ -45,18 +45,32 @@ public final class PhoneCapabilities {
|
||||
/** Call supports generic conference mode. */
|
||||
public static final int GENERIC_CONFERENCE = 0x00000080;
|
||||
|
||||
/** Local device supports video telephony. */
|
||||
/**
|
||||
* Local device supports video telephony.
|
||||
* @hide
|
||||
*/
|
||||
public static final int SUPPORTS_VT_LOCAL = 0x00000100;
|
||||
|
||||
/** Remote device supports video telephony. */
|
||||
/**
|
||||
* Remote device supports video telephony.
|
||||
* @hide
|
||||
*/
|
||||
public static final int SUPPORTS_VT_REMOTE = 0x00000200;
|
||||
|
||||
/**
|
||||
* Call is using voice over LTE.
|
||||
* @hide
|
||||
*/
|
||||
public static final int VoLTE = 0x00000400;
|
||||
|
||||
/**
|
||||
* Call is using voice over WIFI.
|
||||
* @hide
|
||||
*/
|
||||
public static final int VoWIFI = 0x00000800;
|
||||
|
||||
public static final int ALL = HOLD | SUPPORT_HOLD | MERGE_CALLS | SWAP_CALLS | ADD_CALL
|
||||
| RESPOND_VIA_TEXT | MUTE | GENERIC_CONFERENCE | VoLTE | VoWIFI;
|
||||
| RESPOND_VIA_TEXT | MUTE | GENERIC_CONFERENCE;
|
||||
|
||||
public static String toString(int capabilities) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
@@ -424,14 +424,27 @@ public final class RemoteConnection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs this {@link Connection#STATE_RINGING} {@code RemoteConnection} to answer.
|
||||
*/
|
||||
public void answer() {
|
||||
try {
|
||||
if (mConnected) {
|
||||
mConnectionService.answer(mConnectionId);
|
||||
}
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs this {@link Connection#STATE_RINGING} {@code RemoteConnection} to answer.
|
||||
* @param videoState The video state in which to answer the call.
|
||||
* @hide
|
||||
*/
|
||||
public void answer(int videoState) {
|
||||
try {
|
||||
if (mConnected) {
|
||||
mConnectionService.answer(mConnectionId, videoState);
|
||||
mConnectionService.answerVideo(mConnectionId, videoState);
|
||||
}
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
|
||||
@@ -43,7 +43,9 @@ oneway interface IConnectionService {
|
||||
|
||||
void abort(String callId);
|
||||
|
||||
void answer(String callId, int videoState);
|
||||
void answerVideo(String callId, int videoState);
|
||||
|
||||
void answer(String callId);
|
||||
|
||||
void reject(String callId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user