Merge "Un-hide Connection-side RTT APIs for Dialer"

This commit is contained in:
Treehugger Robot
2018-02-15 23:56:55 +00:00
committed by Gerrit Code Review
4 changed files with 18 additions and 53 deletions

View File

@@ -23,7 +23,6 @@ import com.android.internal.telecom.IVideoProvider;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.Notification;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
@@ -400,9 +399,7 @@ public abstract class Connection extends Conferenceable {
/**
* Set by the framework to indicate that a connection has an active RTT session associated with
* it.
* @hide
*/
@TestApi
public static final int PROPERTY_IS_RTT = 1 << 8;
/**
@@ -847,9 +844,7 @@ public abstract class Connection extends Conferenceable {
/**
* Provides methods to read and write RTT data to/from the in-call app.
* @hide
*/
@TestApi
public static final class RttTextStream {
private static final int READ_BUFFER_SIZE = 1000;
private final InputStreamReader mPipeFromInCall;
@@ -2622,10 +2617,8 @@ public abstract class Connection extends Conferenceable {
/**
* Informs listeners that a previously requested RTT session via
* {@link ConnectionRequest#isRequestingRtt()} or
* {@link #onStartRtt(ParcelFileDescriptor, ParcelFileDescriptor)} has succeeded.
* @hide
* {@link #onStartRtt(RttTextStream)} has succeeded.
*/
@TestApi
public final void sendRttInitiationSuccess() {
setRttProperty();
mListeners.forEach((l) -> l.onRttInitiationSuccess(Connection.this));
@@ -2633,14 +2626,11 @@ public abstract class Connection extends Conferenceable {
/**
* Informs listeners that a previously requested RTT session via
* {@link ConnectionRequest#isRequestingRtt()} or
* {@link #onStartRtt(ParcelFileDescriptor, ParcelFileDescriptor)}
* {@link ConnectionRequest#isRequestingRtt()} or {@link #onStartRtt(RttTextStream)}
* has failed.
* @param reason One of the reason codes defined in {@link RttModifyStatus}, with the
* exception of {@link RttModifyStatus#SESSION_MODIFY_REQUEST_SUCCESS}.
* @hide
*/
@TestApi
public final void sendRttInitiationFailure(int reason) {
unsetRttProperty();
mListeners.forEach((l) -> l.onRttInitiationFailure(Connection.this, reason));
@@ -2649,9 +2639,7 @@ public abstract class Connection extends Conferenceable {
/**
* Informs listeners that a currently active RTT session has been terminated by the remote
* side of the coll.
* @hide
*/
@TestApi
public final void sendRttSessionRemotelyTerminated() {
unsetRttProperty();
mListeners.forEach((l) -> l.onRttSessionRemotelyTerminated(Connection.this));
@@ -2660,9 +2648,7 @@ public abstract class Connection extends Conferenceable {
/**
* Informs listeners that the remote side of the call has requested an upgrade to include an
* RTT session in the call.
* @hide
*/
@TestApi
public final void sendRemoteRttRequest() {
mListeners.forEach((l) -> l.onRemoteRttRequest(Connection.this));
}
@@ -2936,17 +2922,13 @@ public abstract class Connection extends Conferenceable {
* request, respectively.
* @param rttTextStream The object that should be used to send text to or receive text from
* the in-call app.
* @hide
*/
@TestApi
public void onStartRtt(@NonNull RttTextStream rttTextStream) {}
/**
* Notifies this {@link Connection} that it should terminate any existing RTT communication
* channel. No response to Telecom is needed for this method.
* @hide
*/
@TestApi
public void onStopRtt() {}
/**
@@ -2954,11 +2936,9 @@ public abstract class Connection extends Conferenceable {
* request sent via {@link #sendRemoteRttRequest}. Acceptance of the request is
* indicated by the supplied {@link RttTextStream} being non-null, and rejection is
* indicated by {@code rttTextStream} being {@code null}
* @hide
* @param rttTextStream The object that should be used to send text to or receive text from
* the in-call app.
*/
@TestApi
public void handleRttUpgradeResponse(@Nullable RttTextStream rttTextStream) {}
/**