Merge "Add extras for outgoing call" into lmp-dev
This commit is contained in:
@@ -18,6 +18,7 @@ package android.telecomm;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.DisconnectCause;
|
||||
|
||||
import java.lang.String;
|
||||
@@ -91,6 +92,7 @@ public final class Call {
|
||||
private final GatewayInfo mGatewayInfo;
|
||||
private final int mVideoState;
|
||||
private final StatusHints mStatusHints;
|
||||
private final Bundle mExtras;
|
||||
|
||||
/**
|
||||
* @return The handle (e.g., phone number) to which the {@code Call} is currently
|
||||
@@ -186,6 +188,13 @@ public final class Call {
|
||||
return mStatusHints;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A bundle extras to pass with the call
|
||||
*/
|
||||
public Bundle getExtras() {
|
||||
return mExtras;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Details) {
|
||||
@@ -203,7 +212,8 @@ public final class Call {
|
||||
Objects.equals(mConnectTimeMillis, d.mConnectTimeMillis) &&
|
||||
Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
|
||||
Objects.equals(mVideoState, d.mVideoState) &&
|
||||
Objects.equals(mStatusHints, d.mStatusHints);
|
||||
Objects.equals(mStatusHints, d.mStatusHints) &&
|
||||
Objects.equals(mExtras, d.mExtras);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -222,7 +232,8 @@ public final class Call {
|
||||
Objects.hashCode(mConnectTimeMillis) +
|
||||
Objects.hashCode(mGatewayInfo) +
|
||||
Objects.hashCode(mVideoState) +
|
||||
Objects.hashCode(mStatusHints);
|
||||
Objects.hashCode(mStatusHints) +
|
||||
Objects.hashCode(mExtras);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@@ -238,7 +249,8 @@ public final class Call {
|
||||
long connectTimeMillis,
|
||||
GatewayInfo gatewayInfo,
|
||||
int videoState,
|
||||
StatusHints statusHints) {
|
||||
StatusHints statusHints,
|
||||
Bundle extras) {
|
||||
mHandle = handle;
|
||||
mHandlePresentation = handlePresentation;
|
||||
mCallerDisplayName = callerDisplayName;
|
||||
@@ -251,6 +263,7 @@ public final class Call {
|
||||
mGatewayInfo = gatewayInfo;
|
||||
mVideoState = videoState;
|
||||
mStatusHints = statusHints;
|
||||
mExtras = extras;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +620,8 @@ public final class Call {
|
||||
parcelableCall.getConnectTimeMillis(),
|
||||
parcelableCall.getGatewayInfo(),
|
||||
parcelableCall.getVideoState(),
|
||||
parcelableCall.getStatusHints());
|
||||
parcelableCall.getStatusHints(),
|
||||
parcelableCall.getExtras());
|
||||
boolean detailsChanged = !Objects.equals(mDetails, details);
|
||||
if (detailsChanged) {
|
||||
mDetails = details;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.telecomm;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
@@ -53,6 +54,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
private final StatusHints mStatusHints;
|
||||
private final int mVideoState;
|
||||
private final List<String> mConferenceableCallIds;
|
||||
private final Bundle mExtras;
|
||||
|
||||
public ParcelableCall(
|
||||
String id,
|
||||
@@ -73,7 +75,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
List<String> childCallIds,
|
||||
StatusHints statusHints,
|
||||
int videoState,
|
||||
List<String> conferenceableCallIds) {
|
||||
List<String> conferenceableCallIds,
|
||||
Bundle extras) {
|
||||
mId = id;
|
||||
mState = state;
|
||||
mDisconnectCauseCode = disconnectCauseCode;
|
||||
@@ -93,6 +96,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
mStatusHints = statusHints;
|
||||
mVideoState = videoState;
|
||||
mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds);
|
||||
mExtras = extras;
|
||||
}
|
||||
|
||||
/** The unique ID of the call. */
|
||||
@@ -220,6 +224,15 @@ public final class ParcelableCall implements Parcelable {
|
||||
return mVideoState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any extras to pass with the call
|
||||
*
|
||||
* @return a bundle of extras
|
||||
*/
|
||||
public Bundle getExtras() {
|
||||
return mExtras;
|
||||
}
|
||||
|
||||
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
|
||||
public static final Parcelable.Creator<ParcelableCall> CREATOR =
|
||||
new Parcelable.Creator<ParcelableCall> () {
|
||||
@@ -249,11 +262,12 @@ public final class ParcelableCall implements Parcelable {
|
||||
int videoState = source.readInt();
|
||||
List<String> conferenceableCallIds = new ArrayList<>();
|
||||
source.readList(conferenceableCallIds, classLoader);
|
||||
Bundle extras = source.readParcelable(classLoader);
|
||||
return new ParcelableCall(id, state, disconnectCauseCode, disconnectCauseMsg,
|
||||
cannedSmsResponses, capabilities, connectTimeMillis, handle, handlePresentation,
|
||||
callerDisplayName, callerDisplayNamePresentation, gatewayInfo,
|
||||
accountHandle, videoCallProvider, parentCallId, childCallIds, statusHints,
|
||||
videoState, conferenceableCallIds);
|
||||
videoState, conferenceableCallIds, extras);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -291,6 +305,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
destination.writeParcelable(mStatusHints, 0);
|
||||
destination.writeInt(mVideoState);
|
||||
destination.writeList(mConferenceableCallIds);
|
||||
destination.writeParcelable(mExtras, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,6 +100,17 @@ public class TelecommManager {
|
||||
public static final String EXTRA_INCOMING_CALL_EXTRAS =
|
||||
"android.intent.extra.INCOMING_CALL_EXTRAS";
|
||||
|
||||
/**
|
||||
* Optional extra for {@link android.content.Intent#ACTION_CALL} and
|
||||
* {@link android.content.Intent#ACTION_DIAL} {@code Intent} containing a {@link Bundle}
|
||||
* which contains metadata about the call. This {@link Bundle} will be saved into
|
||||
* {@code Call.Details}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_OUTGOING_CALL_EXTRAS =
|
||||
"android.intent.extra.OUTGOING_CALL_EXTRAS";
|
||||
|
||||
/**
|
||||
* Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
|
||||
* containing the disconnect code.
|
||||
|
||||
Reference in New Issue
Block a user