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

Commit 4279308a authored by Brad Ebinger's avatar Brad Ebinger Committed by Automerger Merge Worker
Browse files

Merge "Adds SipDelegateManager#triggerFullNetworkRegistration API" am: c2548334 am: abd6be2e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1521013

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id04573ba07f7362ff51474d6fb8d1623a64bea40
parents f11186b8 abd6be2e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11555,6 +11555,7 @@ package android.telephony.ims {
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void createSipDelegate(@NonNull android.telephony.ims.DelegateRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.stub.DelegateConnectionStateCallback, @NonNull android.telephony.ims.stub.DelegateConnectionMessageCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void destroySipDelegate(@NonNull android.telephony.ims.SipDelegateConnection, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSupported() throws android.telephony.ims.ImsException;
    method public void triggerFullNetworkRegistration(@NonNull android.telephony.ims.SipDelegateConnection, @IntRange(from=100, to=699) int, @Nullable String);
    field public static final int DENIED_REASON_INVALID = 4; // 0x4
    field public static final int DENIED_REASON_IN_USE_BY_ANOTHER_DELEGATE = 1; // 0x1
    field public static final int DENIED_REASON_NOT_ALLOWED = 2; // 0x2
@@ -11799,6 +11800,7 @@ package android.telephony.ims.stub {
    method public final void onRegistering(int);
    method public final void onSubscriberAssociatedUriChanged(android.net.Uri[]);
    method public final void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo);
    method public void triggerFullNetworkRegistration(@IntRange(from=100, to=699) int, @Nullable String);
    field public static final int REGISTRATION_TECH_IWLAN = 1; // 0x1
    field public static final int REGISTRATION_TECH_LTE = 0; // 0x0
    field public static final int REGISTRATION_TECH_NONE = -1; // 0xffffffff
+35 −0
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package android.telephony.ims;

import android.Manifest;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.Context;
@@ -372,4 +374,37 @@ public class SipDelegateManager {
                    + " into this method");
        }
    }

    /**
     * Trigger a full network registration as required by receiving a SIP message containing a
     * permanent error from the network or never receiving a response to a SIP transaction request.
     *
     * @param connection The {@link SipDelegateConnection} that was being used when this error was
     *         received.
     * @param sipCode The SIP code response associated with the SIP message request that
     *         triggered this condition.
     * @param sipReason The SIP reason code associated with the SIP message request that triggered
     *         this condition. May be {@code null} if there was no reason String provided from the
     *         network.
     */
    public void triggerFullNetworkRegistration(@NonNull SipDelegateConnection connection,
            @IntRange(from = 100, to = 699) int sipCode, @Nullable String sipReason) {
        if (connection == null) {
            throw new IllegalArgumentException("invalid connection.");
        }
        if (connection instanceof SipDelegateConnectionAidlWrapper) {
            SipDelegateConnectionAidlWrapper w = (SipDelegateConnectionAidlWrapper) connection;
            try {
                IImsRcsController controller = mBinderCache.getBinder();
                controller.triggerNetworkRegistration(mSubId, w.getSipDelegateBinder(), sipCode,
                        sipReason);
            } catch (RemoteException e) {
                // Connection to telephony died, but this will signal destruction of SipDelegate
                // eventually anyway, so return.
            }
        } else {
            throw new IllegalArgumentException("Unknown SipDelegateConnection implementation passed"
                    + " into this method");
        }
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ interface IImsRcsController {
            ISipDelegateConnectionStateCallback delegateState,
            ISipDelegateMessageCallback delegateMessage);
    void destroySipDelegate(int subId, ISipDelegate connection, int reason);
    void triggerNetworkRegistration(int subId, ISipDelegate connection, int sipCode,
            String sipReason);

    // Internal commands that should not be made public
    void registerRcsFeatureCallback(int slotId, in IImsServiceFeatureCallback callback);
+1 −0
Original line number Diff line number Diff line
@@ -28,4 +28,5 @@ interface IImsRegistration {
   int getRegistrationTechnology();
   oneway void addRegistrationCallback(IImsRegistrationCallback c);
   oneway void removeRegistrationCallback(IImsRegistrationCallback c);
   oneway void triggerFullNetworkRegistration(int sipCode, String sipReason);
}
 No newline at end of file
+6 −2
Original line number Diff line number Diff line
@@ -92,6 +92,11 @@ public class ImsRegistrationImplBase {
        public void removeRegistrationCallback(IImsRegistrationCallback c) throws RemoteException {
            ImsRegistrationImplBase.this.removeRegistrationCallback(c);
        }

        @Override
        public void triggerFullNetworkRegistration(int sipCode, String sipReason) {
            ImsRegistrationImplBase.this.triggerFullNetworkRegistration(sipCode, sipReason);
        }
    };

    private final RemoteCallbackListExt<IImsRegistrationCallback> mCallbacks =
@@ -169,9 +174,8 @@ public class ImsRegistrationImplBase {
     *    be carrier specific.
     * @param sipReason The reason associated with the SIP error code. {@code null} if there was no
     *    reason associated with the error.
     * @hide
     */
    public void triggerNetworkReregistration(@IntRange(from = 100, to = 699) int sipCode,
    public void triggerFullNetworkRegistration(@IntRange(from = 100, to = 699) int sipCode,
            @Nullable String sipReason) {
        // Stub implementation, ImsService should implement this
    }