diff options
author | Brian Orr <brianorr@google.com> | 2021-06-15 12:47:53 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-06-17 13:37:54 -0700 |
commit | 71c831703ae59baf47e0afe611fecd714c481cdf (patch) | |
tree | 06731a987032723085b9e1a65951cf96abbc19cf /telecomm | |
parent | 065c9e9a6e9d61d4383a91721eb56a3de253bdbe (diff) | |
parent | 81833820d54b9a6b27894f9f8dfd72222d416992 (diff) |
Merge SP1A.210604.001
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/CallDiagnosticService.java | 21 | ||||
-rw-r--r-- | telecomm/java/android/telecom/PhoneAccount.java | 8 |
2 files changed, 21 insertions, 8 deletions
diff --git a/telecomm/java/android/telecom/CallDiagnosticService.java b/telecomm/java/android/telecom/CallDiagnosticService.java index 011dc17a1c1e..336a8ea3f310 100644 --- a/telecomm/java/android/telecom/CallDiagnosticService.java +++ b/telecomm/java/android/telecom/CallDiagnosticService.java @@ -294,6 +294,10 @@ public abstract class CallDiagnosticService extends Service { CallDiagnostics callDiagnostics; synchronized (mLock) { callDiagnostics = mDiagnosticCallByTelecomCallId.get(telecomCallId); + if (callDiagnostics == null) { + // Possible to get a call update after a call is removed. + return; + } mCallByTelecomCallId.put(telecomCallId, newCallDetails); } getExecutor().execute(() -> callDiagnostics.handleCallUpdated(newCallDetails)); @@ -306,12 +310,12 @@ public abstract class CallDiagnosticService extends Service { private void handleCallRemoved(@NonNull String telecomCallId) { Log.i(this, "handleCallRemoved: callId=%s - removed", telecomCallId); - if (mCallByTelecomCallId.containsKey(telecomCallId)) { - mCallByTelecomCallId.remove(telecomCallId); - } - CallDiagnostics callDiagnostics; synchronized (mLock) { + if (mCallByTelecomCallId.containsKey(telecomCallId)) { + mCallByTelecomCallId.remove(telecomCallId); + } + if (mDiagnosticCallByTelecomCallId.containsKey(telecomCallId)) { callDiagnostics = mDiagnosticCallByTelecomCallId.remove(telecomCallId); } else { @@ -353,7 +357,10 @@ public abstract class CallDiagnosticService extends Service { private void handleCallDisconnected(@NonNull String callId, @NonNull DisconnectCause disconnectCause) { Log.i(this, "handleCallDisconnected: call=%s; cause=%s", callId, disconnectCause); - CallDiagnostics callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId); + CallDiagnostics callDiagnostics; + synchronized (mLock) { + callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId); + } CharSequence message; if (disconnectCause.getImsReasonInfo() != null) { message = callDiagnostics.onCallDisconnected(disconnectCause.getImsReasonInfo()); @@ -391,7 +398,9 @@ public abstract class CallDiagnosticService extends Service { @NonNull CallQuality callQuality) { Log.i(this, "handleCallQualityChanged; call=%s, cq=%s", callId, callQuality); CallDiagnostics callDiagnostics; - callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId); + synchronized(mLock) { + callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId); + } if (callDiagnostics != null) { callDiagnostics.onCallQualityReceived(callQuality); } diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 579b33e9c283..e332d3ff2b4d 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -27,6 +27,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +import android.telephony.CarrierConfigManager; import android.telephony.TelephonyManager; import android.text.TextUtils; @@ -283,10 +284,13 @@ public final class PhoneAccount implements Parcelable { * number relies on presence. Should only be set if the {@code PhoneAccount} also has * {@link #CAPABILITY_VIDEO_CALLING}. * <p> - * When set, the {@link ConnectionService} is responsible for toggling the + * Note: As of Android 12, using the * {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE_VT_CAPABLE} bit on the * {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE} column to indicate whether - * a contact's phone number supports video calling. + * a contact's phone number supports video calling has been deprecated and should only be used + * on devices where {@link CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL} is set. On newer + * devices, applications must use {@link android.telephony.ims.RcsUceAdapter} instead to + * determine whether or not a contact's phone number supports carrier video calling. * <p> * See {@link #getCapabilities} */ |