Merge "Expose telecom API for retrieving photo uri"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ad96102725
@@ -40523,6 +40523,7 @@ package android.telecom {
|
||||
method public int getCallerNumberVerificationStatus();
|
||||
method public final long getConnectTimeMillis();
|
||||
method @Nullable public String getContactDisplayName();
|
||||
method @Nullable public android.net.Uri getContactPhotoUri();
|
||||
method public long getCreationTimeMillis();
|
||||
method public android.telecom.DisconnectCause getDisconnectCause();
|
||||
method public android.os.Bundle getExtras();
|
||||
|
||||
@@ -738,6 +738,7 @@ public final class Call {
|
||||
private final String mContactDisplayName;
|
||||
private final @CallDirection int mCallDirection;
|
||||
private final @Connection.VerificationStatus int mCallerNumberVerificationStatus;
|
||||
private final Uri mContactPhotoUri;
|
||||
|
||||
/**
|
||||
* Whether the supplied capabilities supports the specified capability.
|
||||
@@ -944,6 +945,17 @@ public final class Call {
|
||||
return mHandlePresentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The contact photo URI which corresponds to
|
||||
* {@link android.provider.ContactsContract.PhoneLookup#PHOTO_URI}, or {@code null} if the
|
||||
* lookup is not yet complete, if there's no contacts entry for the caller,
|
||||
* or if the {@link InCallService} does not hold the
|
||||
* {@link android.Manifest.permission#READ_CONTACTS} permission.
|
||||
*/
|
||||
public @Nullable Uri getContactPhotoUri() {
|
||||
return mContactPhotoUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* The display name for the caller.
|
||||
* <p>
|
||||
@@ -1143,7 +1155,8 @@ public final class Call {
|
||||
Objects.equals(mContactDisplayName, d.mContactDisplayName) &&
|
||||
Objects.equals(mCallDirection, d.mCallDirection) &&
|
||||
Objects.equals(mCallerNumberVerificationStatus,
|
||||
d.mCallerNumberVerificationStatus);
|
||||
d.mCallerNumberVerificationStatus) &&
|
||||
Objects.equals(mContactPhotoUri, d.mContactPhotoUri);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1168,7 +1181,8 @@ public final class Call {
|
||||
mCreationTimeMillis,
|
||||
mContactDisplayName,
|
||||
mCallDirection,
|
||||
mCallerNumberVerificationStatus);
|
||||
mCallerNumberVerificationStatus,
|
||||
mContactPhotoUri);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@@ -1192,7 +1206,8 @@ public final class Call {
|
||||
long creationTimeMillis,
|
||||
String contactDisplayName,
|
||||
int callDirection,
|
||||
int callerNumberVerificationStatus) {
|
||||
int callerNumberVerificationStatus,
|
||||
Uri contactPhotoUri) {
|
||||
mState = state;
|
||||
mTelecomCallId = telecomCallId;
|
||||
mHandle = handle;
|
||||
@@ -1213,6 +1228,7 @@ public final class Call {
|
||||
mContactDisplayName = contactDisplayName;
|
||||
mCallDirection = callDirection;
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
mContactPhotoUri = contactPhotoUri;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@@ -1237,7 +1253,9 @@ public final class Call {
|
||||
parcelableCall.getCreationTimeMillis(),
|
||||
parcelableCall.getContactDisplayName(),
|
||||
parcelableCall.getCallDirection(),
|
||||
parcelableCall.getCallerNumberVerificationStatus());
|
||||
parcelableCall.getCallerNumberVerificationStatus(),
|
||||
parcelableCall.getContactPhotoUri()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2644,7 +2662,8 @@ public final class Call {
|
||||
mDetails.getCreationTimeMillis(),
|
||||
mDetails.getContactDisplayName(),
|
||||
mDetails.getCallDirection(),
|
||||
mDetails.getCallerNumberVerificationStatus()
|
||||
mDetails.getCallerNumberVerificationStatus(),
|
||||
mDetails.getContactPhotoUri()
|
||||
);
|
||||
fireDetailsChanged(mDetails);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
private int mCallerNumberVerificationStatus;
|
||||
private String mContactDisplayName;
|
||||
private String mActiveChildCallId;
|
||||
private Uri mContactPhotoUri;
|
||||
|
||||
public ParcelableCallBuilder setId(String id) {
|
||||
mId = id;
|
||||
@@ -224,6 +225,11 @@ public final class ParcelableCall implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ParcelableCallBuilder setContactPhotoUri(Uri contactPhotoUri) {
|
||||
mContactPhotoUri = contactPhotoUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ParcelableCall createParcelableCall() {
|
||||
return new ParcelableCall(
|
||||
mId,
|
||||
@@ -255,7 +261,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
mCallDirection,
|
||||
mCallerNumberVerificationStatus,
|
||||
mContactDisplayName,
|
||||
mActiveChildCallId);
|
||||
mActiveChildCallId,
|
||||
mContactPhotoUri);
|
||||
}
|
||||
|
||||
public static ParcelableCallBuilder fromParcelableCall(ParcelableCall parcelableCall) {
|
||||
@@ -292,6 +299,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
parcelableCall.mCallerNumberVerificationStatus;
|
||||
newBuilder.mContactDisplayName = parcelableCall.mContactDisplayName;
|
||||
newBuilder.mActiveChildCallId = parcelableCall.mActiveChildCallId;
|
||||
newBuilder.mContactPhotoUri = parcelableCall.mContactPhotoUri;
|
||||
return newBuilder;
|
||||
}
|
||||
}
|
||||
@@ -327,6 +335,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
private final int mCallerNumberVerificationStatus;
|
||||
private final String mContactDisplayName;
|
||||
private final String mActiveChildCallId; // Only valid for CDMA conferences
|
||||
private final Uri mContactPhotoUri;
|
||||
|
||||
public ParcelableCall(
|
||||
String id,
|
||||
@@ -358,7 +367,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
int callDirection,
|
||||
int callerNumberVerificationStatus,
|
||||
String contactDisplayName,
|
||||
String activeChildCallId
|
||||
String activeChildCallId,
|
||||
Uri contactPhotoUri
|
||||
) {
|
||||
mId = id;
|
||||
mState = state;
|
||||
@@ -390,6 +400,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
mContactDisplayName = contactDisplayName;
|
||||
mActiveChildCallId = activeChildCallId;
|
||||
mContactPhotoUri = contactPhotoUri;
|
||||
}
|
||||
|
||||
/** The unique ID of the call. */
|
||||
@@ -606,6 +617,14 @@ public final class ParcelableCall implements Parcelable {
|
||||
return mContactDisplayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the caller photo URI.
|
||||
*/
|
||||
public @Nullable Uri getContactPhotoUri() {
|
||||
return mContactPhotoUri;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return On a CDMA conference with two participants, returns the ID of the child call that's
|
||||
* currently active.
|
||||
@@ -655,6 +674,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
int callerNumberVerificationStatus = source.readInt();
|
||||
String contactDisplayName = source.readString();
|
||||
String activeChildCallId = source.readString();
|
||||
Uri contactPhotoUri = source.readParcelable(classLoader, Uri.class);
|
||||
return new ParcelableCallBuilder()
|
||||
.setId(id)
|
||||
.setState(state)
|
||||
@@ -686,6 +706,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
.setCallerNumberVerificationStatus(callerNumberVerificationStatus)
|
||||
.setContactDisplayName(contactDisplayName)
|
||||
.setActiveChildCallId(activeChildCallId)
|
||||
.setContactPhotoUri(contactPhotoUri)
|
||||
.createParcelableCall();
|
||||
}
|
||||
|
||||
@@ -735,6 +756,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
destination.writeInt(mCallerNumberVerificationStatus);
|
||||
destination.writeString(mContactDisplayName);
|
||||
destination.writeString(mActiveChildCallId);
|
||||
destination.writeParcelable(mContactPhotoUri, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user