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

Commit ac3c58e4 authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Add triggerImsDeregistration to ImsIndication

Bug: 216387835
Test: build & flash
Change-Id: I8a770cf81c35e1a5004c2dc2c603d0f7f69c2a6e
Merged-In: I8a770cf81c35e1a5004c2dc2c603d0f7f69c2a6e
parent 98231dd4
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ public abstract class BaseCommands implements CommandsInterface {
    protected RegistrantList mEmergencyNetworkScanRegistrants = new RegistrantList();
    protected RegistrantList mConnectionSetupFailureRegistrants = new RegistrantList();
    protected RegistrantList mNotifyAnbrRegistrants = new RegistrantList();
    protected RegistrantList mTriggerImsDeregistrationRegistrants = new RegistrantList();

    @UnsupportedAppUsage
    protected Registrant mGsmSmsRegistrant;
@@ -1177,4 +1178,14 @@ public abstract class BaseCommands implements CommandsInterface {
    public void unregisterForNotifyAnbr(Handler h) {
        mNotifyAnbrRegistrants.remove(h);
    }

    @Override
    public void registerForTriggerImsDeregistration(Handler h, int what, Object obj) {
        mTriggerImsDeregistrationRegistrants.add(h, what, obj);
    }

    @Override
    public void unregisterForTriggerImsDeregistration(Handler h) {
        mTriggerImsDeregistrationRegistrants.remove(h);
    }
}
+16 −0
Original line number Diff line number Diff line
@@ -2788,6 +2788,22 @@ public interface CommandsInterface {
     */
    default void unregisterForNotifyAnbr(Handler h) {}

    /**
     * Registers for IMS deregistration trigger from modem.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    default void registerForTriggerImsDeregistration(Handler h, int what, Object obj) {}

    /**
     * Unregisters for IMS deregistration trigger from modem.
     *
     * @param h Handler to be removed from the registrant list.
     */
    default void unregisterForTriggerImsDeregistration(Handler h) {}

    /**
     * Set the UE's usage setting.
     *
+19 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.telephony;

import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CONNECTION_SETUP_FAILURE;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NOTIFY_ANBR;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_TRIGGER_IMS_DEREGISTRATION;

import android.hardware.radio.ims.IRadioImsIndication;
import android.os.AsyncResult;
@@ -81,4 +82,22 @@ public class ImsIndication extends IRadioImsIndication.Stub {

        mRil.mNotifyAnbrRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
    }

    /**
     * Fired by radio when a graceful IMS deregistration needs to be performed by telephony
     * prior to radio performing network detach. Example scenarios are SIM refresh or user
     * mode preference change which would cause network detach. The radio waits for the
     * IMS deregistration, which will be notified by telephony via
     * {@link IRadioIms#updateImsRegistrationInfo()}, or a certain timeout interval to start
     * the network detach procedure.
     *
     * @param indicationType Type of radio indication
     */
    public void triggerImsDeregistration(int indicationType) {
        mRil.processIndication(RIL.IMS_SERVICE, indicationType);

        if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_TRIGGER_IMS_DEREGISTRATION);

        mRil.mTriggerImsDeregistrationRegistrants.notifyRegistrants();
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_EVENT_NO
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_PROACTIVE_COMMAND;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_SESSION_END;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SUPP_SVC_NOTIFICATION;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_TRIGGER_IMS_DEREGISTRATION;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_APPLICATIONS_ENABLEMENT_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN;
@@ -5199,6 +5200,8 @@ public class RILUtils {
                return "UNSOL_CONNECTION_SETUP_FAILURE";
            case RIL_UNSOL_NOTIFY_ANBR:
                return "UNSOL_NOTIFY_ANBR";
            case RIL_UNSOL_TRIGGER_IMS_DEREGISTRATION:
                return "UNSOL_TRIGGER_IMS_DEREGISTRATION";
            default:
                return "<unknown response>";
        }