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

Commit b52038f3 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Stop duplicate RADIO_POWER indcation when power off delay disabled

When the power off delay for IMS registration feature is disabled,
do not allow registration changes trigger EVENT_CHANGE_IMS_STATE or
in some cases it will trigger a duplicate RADIO_POWER event to the
modem before the previous event completed.

Bug: 189524310
Test: atest FrameworksTelephonyTests:ServiceStateTrackerTest
Change-Id: I37189e2d724809425092d1a5cc0943c774a7dc22
parent 289e29fd
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -288,7 +288,8 @@ public class ServiceStateTracker extends Handler {
    public    static final int EVENT_ICC_CHANGED                       = 42;
    protected static final int EVENT_GET_CELL_INFO_LIST                = 43;
    protected static final int EVENT_UNSOL_CELL_INFO_LIST              = 44;
    // Only sent if the IMS state is moving from true -> false
    // Only sent if the IMS state is moving from true -> false and power off delay for IMS
    // registration feature is enabled.
    protected static final int EVENT_CHANGE_IMS_STATE                  = 45;
    protected static final int EVENT_IMS_STATE_CHANGED                 = 46;
    protected static final int EVENT_IMS_STATE_DONE                    = 47;
@@ -3369,7 +3370,14 @@ public class ServiceStateTracker extends Handler {

        if (mImsRegistrationOnOff && !registered) {
            // moving to deregistered, only send this event if we need to re-evaluate
            if (getRadioPowerOffDelayTimeoutForImsRegistration() > 0) {
                // only send this event if the power off delay for IMS deregistration feature is
                // enabled.
                sendMessage(obtainMessage(EVENT_CHANGE_IMS_STATE));
            } else {
                log("setImsRegistrationState: EVENT_CHANGE_IMS_STATE not sent because power off "
                        + "delay for IMS deregistration is not enabled.");
            }
        }
        mImsRegistrationOnOff = registered;
    }