Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7305b87b authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Adding "start call with video" extra for ACTION_CALL intent."

parents b28cce7c 12013ad1
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -27676,13 +27676,14 @@ package android.telecomm {
  }
  public final class ConnectionRequest implements android.os.Parcelable {
    ctor public ConnectionRequest(java.lang.String, android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(android.telecomm.PhoneAccount, java.lang.String, android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(java.lang.String, android.net.Uri, android.os.Bundle, int);
    ctor public ConnectionRequest(android.telecomm.PhoneAccount, java.lang.String, android.net.Uri, android.os.Bundle, int);
    method public int describeContents();
    method public android.telecomm.PhoneAccount getAccount();
    method public java.lang.String getCallId();
    method public android.os.Bundle getExtras();
    method public android.net.Uri getHandle();
    method public int getVideoState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
@@ -27855,7 +27856,7 @@ package android.telecomm {
    field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE";
    field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS";
    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";
    field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO = "android.intent.extra.START_CALL_WITH_VIDEO";
    field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.intent.extra.START_CALL_WITH_VIDEO_STATE";
  }
  public class VideoCallProfile implements android.os.Parcelable {
+24 −5
Original line number Diff line number Diff line
@@ -34,16 +34,19 @@ public final class ConnectionRequest implements Parcelable {
    private final Uri mHandle;
    private final Bundle mExtras;
    private final PhoneAccount mAccount;
    private final int mVideoState;

    public ConnectionRequest(String callId, Uri handle, Bundle extras) {
        this(null, callId, handle, extras);
    public ConnectionRequest(String callId, Uri handle, Bundle extras, int videoState) {
        this(null, callId, handle, extras, videoState);
    }

    public ConnectionRequest(PhoneAccount account, String callId, Uri handle, Bundle extras) {
    public ConnectionRequest(PhoneAccount account, String callId, Uri handle, Bundle extras,
            int videoState) {
        mCallId = callId;
        mHandle = handle;
        mExtras = extras;
        mAccount = account;
        mVideoState = videoState;
    }

    /**
@@ -68,6 +71,19 @@ public final class ConnectionRequest implements Parcelable {
     */
    public Bundle getExtras() { return mExtras; }

    /**
     * Determines the video state for the connection.
     * Valid values: {@link VideoCallProfile#VIDEO_STATE_AUDIO_ONLY},
     * {@link VideoCallProfile#VIDEO_STATE_BIDIRECTIONAL},
     * {@link VideoCallProfile#VIDEO_STATE_TX_ENABLED},
     * {@link VideoCallProfile#VIDEO_STATE_RX_ENABLED}.
     *
     * @return The video state for the connection.
     */
    public int getVideoState() {
        return mVideoState;
    }

    public String toString() {
        return String.format("PhoneConnectionRequest %s %s",
                mHandle == null
@@ -83,7 +99,8 @@ public final class ConnectionRequest implements Parcelable {
                    String callId = source.readString();
                    Uri handle = (Uri) source.readParcelable(getClass().getClassLoader());
                    Bundle extras = (Bundle) source.readParcelable(getClass().getClassLoader());
                    return new ConnectionRequest(callId, handle, extras);
                    int videoState = source.readInt();
                    return new ConnectionRequest(callId, handle, extras, videoState);
                }

                @Override
@@ -105,4 +122,6 @@ public final class ConnectionRequest implements Parcelable {
        destination.writeString(mCallId);
        destination.writeParcelable(mHandle, 0);
        destination.writeParcelable(mExtras, 0);
    }}
        destination.writeInt(mVideoState);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ final class RemoteConnectionService implements DeathRecipient {
        if (mConnectionId == null) {
            String id = UUID.randomUUID().toString();
            ConnectionRequest newRequest = new ConnectionRequest(request.getAccount(), id,
                    request.getHandle(), request.getExtras());
                    request.getHandle(), request.getExtras(), request.getVideoState());
            try {
                mConnectionService.call(newRequest);
                mConnectionId = id;
+8 −4
Original line number Diff line number Diff line
@@ -58,11 +58,15 @@ public final class TelecommConstants {
            "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";

    /**
     * Optional extra for {@link Intent#ACTION_CALL} containing a boolean that determines whether
     * the call should be started with video, if possible.
     * Optional extra for {@link Intent#ACTION_CALL} containing an integer that determines the
     * desired video state for an outgoing call.
     * Valid options: {@link VideoCallProfile#VIDEO_STATE_AUDIO_ONLY},
     * {@link VideoCallProfile#VIDEO_STATE_BIDIRECTIONAL},
     * {@link VideoCallProfile#VIDEO_STATE_RX_ENABLED},
     * {@link VideoCallProfile#VIDEO_STATE_TX_ENABLED}.
     */
    public static final String EXTRA_START_CALL_WITH_VIDEO =
            "android.intent.extra.START_CALL_WITH_VIDEO";
    public static final String EXTRA_START_CALL_WITH_VIDEO_STATE =
            "android.intent.extra.START_CALL_WITH_VIDEO_STATE";

    /**
     * Extra for {@link #ACTION_INCOMING_CALL} containing the {@link CallServiceDescriptor} that