Merge "Expose ImsExternalCallState constructor as @SystemApi" am: 4133a00a10
am: 8e5a756f9d
Change-Id: Icc899e3da0472a9409856e51d1bd8f02074431ad
This commit is contained in:
@@ -5723,11 +5723,13 @@ package android.telephony.ims {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class ImsExternalCallState implements android.os.Parcelable {
|
public final class ImsExternalCallState implements android.os.Parcelable {
|
||||||
|
ctor public ImsExternalCallState(java.lang.String, android.net.Uri, android.net.Uri, boolean, int, int, boolean);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public android.net.Uri getAddress();
|
method public android.net.Uri getAddress();
|
||||||
method public int getCallId();
|
method public int getCallId();
|
||||||
method public int getCallState();
|
method public int getCallState();
|
||||||
method public int getCallType();
|
method public int getCallType();
|
||||||
|
method public android.net.Uri getLocalAddress();
|
||||||
method public boolean isCallHeld();
|
method public boolean isCallHeld();
|
||||||
method public boolean isCallPullable();
|
method public boolean isCallPullable();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
|
|||||||
@@ -16,22 +16,19 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
|
import android.annotation.IntDef;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.telecom.Log;
|
import android.telecom.Log;
|
||||||
import android.telephony.Rlog;
|
import android.telephony.Rlog;
|
||||||
|
|
||||||
/*
|
import java.lang.annotation.Retention;
|
||||||
* This file contains all the api's through which
|
import java.lang.annotation.RetentionPolicy;
|
||||||
* information received in Dialog Event Package can be
|
|
||||||
* queried
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parcelable object to handle MultiEndpoint Dialog Information
|
* Parcelable object to handle MultiEndpoint Dialog Event Package Information.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@@ -40,8 +37,39 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
private static final String TAG = "ImsExternalCallState";
|
private static final String TAG = "ImsExternalCallState";
|
||||||
|
|
||||||
// Dialog States
|
// Dialog States
|
||||||
|
/**
|
||||||
|
* The external call is in the confirmed dialog state.
|
||||||
|
*/
|
||||||
public static final int CALL_STATE_CONFIRMED = 1;
|
public static final int CALL_STATE_CONFIRMED = 1;
|
||||||
|
/**
|
||||||
|
* The external call is in the terminated dialog state.
|
||||||
|
*/
|
||||||
public static final int CALL_STATE_TERMINATED = 2;
|
public static final int CALL_STATE_TERMINATED = 2;
|
||||||
|
|
||||||
|
/**@hide*/
|
||||||
|
@IntDef(flag = true,
|
||||||
|
value = {
|
||||||
|
CALL_STATE_CONFIRMED,
|
||||||
|
CALL_STATE_TERMINATED
|
||||||
|
},
|
||||||
|
prefix = "CALL_STATE_")
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface ExternalCallState {}
|
||||||
|
|
||||||
|
/**@hide*/
|
||||||
|
@IntDef(flag = true,
|
||||||
|
value = {
|
||||||
|
ImsCallProfile.CALL_TYPE_VOICE,
|
||||||
|
ImsCallProfile.CALL_TYPE_VT_TX,
|
||||||
|
ImsCallProfile.CALL_TYPE_VT_RX,
|
||||||
|
ImsCallProfile.CALL_TYPE_VT
|
||||||
|
},
|
||||||
|
prefix = "CALL_TYPE_")
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface ExternalCallType {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Dialog Id
|
// Dialog Id
|
||||||
private int mCallId;
|
private int mCallId;
|
||||||
// Number
|
// Number
|
||||||
@@ -59,9 +87,8 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**@hide*/
|
/**@hide*/
|
||||||
@UnsupportedAppUsage
|
public ImsExternalCallState(int callId, Uri address, boolean isPullable,
|
||||||
public ImsExternalCallState(int callId, Uri address, boolean isPullable, int callState,
|
@ExternalCallState int callState, int callType, boolean isCallheld) {
|
||||||
int callType, boolean isCallheld) {
|
|
||||||
mCallId = callId;
|
mCallId = callId;
|
||||||
mAddress = address;
|
mAddress = address;
|
||||||
mIsPullable = isPullable;
|
mIsPullable = isPullable;
|
||||||
@@ -73,7 +100,8 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
|
|
||||||
/**@hide*/
|
/**@hide*/
|
||||||
public ImsExternalCallState(int callId, Uri address, Uri localAddress,
|
public ImsExternalCallState(int callId, Uri address, Uri localAddress,
|
||||||
boolean isPullable, int callState, int callType, boolean isCallheld) {
|
boolean isPullable, @ExternalCallState int callState, int callType,
|
||||||
|
boolean isCallheld) {
|
||||||
mCallId = callId;
|
mCallId = callId;
|
||||||
mAddress = address;
|
mAddress = address;
|
||||||
mLocalAddress = localAddress;
|
mLocalAddress = localAddress;
|
||||||
@@ -84,6 +112,31 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
Rlog.d(TAG, "ImsExternalCallState = " + this);
|
Rlog.d(TAG, "ImsExternalCallState = " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ImsExternalCallState instance to contain Multiendpoint Dialog information.
|
||||||
|
* @param callId The unique ID of the call, which will be used to identify this external
|
||||||
|
* connection.
|
||||||
|
* @param address A {@link Uri} containing the remote address of this external connection.
|
||||||
|
* @param localAddress A {@link Uri} containing the local address information.
|
||||||
|
* @param isPullable A flag determining if this external connection can be pulled to the current
|
||||||
|
* device.
|
||||||
|
* @param callState The state of the external call.
|
||||||
|
* @param callType The type of external call.
|
||||||
|
* @param isCallheld A flag determining if the external connection is currently held.
|
||||||
|
*/
|
||||||
|
public ImsExternalCallState(String callId, Uri address, Uri localAddress,
|
||||||
|
boolean isPullable, @ExternalCallState int callState, @ExternalCallType int callType,
|
||||||
|
boolean isCallheld) {
|
||||||
|
mCallId = getIdForString(callId);
|
||||||
|
mAddress = address;
|
||||||
|
mLocalAddress = localAddress;
|
||||||
|
mIsPullable = isPullable;
|
||||||
|
mCallState = callState;
|
||||||
|
mCallType = callType;
|
||||||
|
mIsHeld = isCallheld;
|
||||||
|
Rlog.d(TAG, "ImsExternalCallState = " + this);
|
||||||
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public ImsExternalCallState(Parcel in) {
|
public ImsExternalCallState(Parcel in) {
|
||||||
mCallId = in.readInt();
|
mCallId = in.readInt();
|
||||||
@@ -135,7 +188,9 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
return mAddress;
|
return mAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/**
|
||||||
|
* @return A {@link Uri} containing the local address from the Multiendpoint Dialog Information.
|
||||||
|
*/
|
||||||
public Uri getLocalAddress() {
|
public Uri getLocalAddress() {
|
||||||
return mLocalAddress;
|
return mLocalAddress;
|
||||||
}
|
}
|
||||||
@@ -144,11 +199,11 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
return mIsPullable;
|
return mIsPullable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCallState() {
|
public @ExternalCallState int getCallState() {
|
||||||
return mCallState;
|
return mCallState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCallType() {
|
public @ExternalCallType int getCallType() {
|
||||||
return mCallType;
|
return mCallType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,4 +221,15 @@ public final class ImsExternalCallState implements Parcelable {
|
|||||||
", mCallType = " + mCallType +
|
", mCallType = " + mCallType +
|
||||||
", mIsHeld = " + mIsHeld + "}";
|
", mIsHeld = " + mIsHeld + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getIdForString(String idString) {
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(idString);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// In the case that there are alphanumeric characters, we will create a hash of the
|
||||||
|
// String value as a backup.
|
||||||
|
// TODO: Modify call IDs to use Strings as keys instead of integers in telephony/telecom
|
||||||
|
return idString.hashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user