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

Commit 42c6f00a authored by Hyunho Shin's avatar Hyunho Shin Committed by Android (Google) Code Review
Browse files

Merge "CapabilityExchangeEventListener/RcsCapabilityExchangeImplBase to have...

Merge "CapabilityExchangeEventListener/RcsCapabilityExchangeImplBase to have the default implementation of the new method call the old version of the method"
parents 4ee917db fe283436
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -115,6 +115,10 @@ public interface CapabilityExchangeEventListener {
    @Deprecated
    default void onPublishUpdated(int reasonCode, @NonNull String reasonPhrase,
            int reasonHeaderCause, @NonNull String reasonHeaderText) throws ImsException {
        onPublishUpdated(new SipDetails.Builder(SipDetails.METHOD_PUBLISH)
                .setSipResponseCode(reasonCode, reasonPhrase)
                .setSipResponseReasonHeader(reasonHeaderCause, reasonHeaderText)
                .build());
    }

    /**
+15 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.telephony.ims.RcsUceAdapter;
import android.telephony.ims.SipDetails;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.RcsFeature;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;

@@ -205,6 +206,12 @@ public class RcsCapabilityExchangeImplBase {
         * when the Telephony stack has crashed.
         */
        default void onNetworkResponse(@NonNull SipDetails details) throws ImsException {
            if (TextUtils.isEmpty(details.getReasonHeaderText())) {
                onNetworkResponse(details.getResponseCode(), details.getResponsePhrase());
            } else {
                onNetworkResponse(details.getResponseCode(), details.getResponsePhrase(),
                        details.getReasonHeaderCause(), details.getReasonHeaderText());
            }
        }
    }

@@ -338,7 +345,14 @@ public class RcsCapabilityExchangeImplBase {
         * {@link RcsFeature} has not received the {@link ImsFeature#onFeatureReady()} callback.
         * This may also happen in rare cases when the Telephony stack has crashed.
         */
        default void onNetworkResponse(@NonNull SipDetails details) throws ImsException {};
        default void onNetworkResponse(@NonNull SipDetails details) throws ImsException {
            if (TextUtils.isEmpty(details.getReasonHeaderText())) {
                onNetworkResponse(details.getResponseCode(), details.getResponsePhrase());
            } else {
                onNetworkResponse(details.getResponseCode(), details.getResponsePhrase(),
                        details.getReasonHeaderCause(), details.getReasonHeaderText());
            }
        };

        /**
         * Notify the framework of the latest XML PIDF documents included in the network response