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

Commit 498bd4e9 authored by Sneh Bansal's avatar Sneh Bansal Committed by Bruno Martins
Browse files

Telephony: Send INITIAL_ATTACH only when it is applicable.

Issue is that SET_INITIAL_ATTACH is being sent whenever subId changes.

During bootup subId does change before records gets loaded. This results
in SET_INITIAL_ATTACH with incorrect APN setting/profile.

Solution is to send SET_INITIAL_ATTACH only when cdmaSubscriptionSource
is RUIM based and records have been loaded.

Change-Id: I68280db4831935326c732943e5b763d3b3a4c3fe

Fix to send initial attach apn

If there is no IA/default apn then do not perform initial
attach with any other available apns.

Change-Id: Ie3241747eb44df9070f2cb4874f13878f8ca3d9b
CRs-Fixed: 2178888
parent 68b87758
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -454,7 +454,7 @@ public class DcTracker extends Handler {
    // member variables
    // member variables
    protected final Phone mPhone;
    protected final Phone mPhone;
    private final UiccController mUiccController;
    private final UiccController mUiccController;
    private final AtomicReference<IccRecords> mIccRecords = new AtomicReference<IccRecords>();
    protected final AtomicReference<IccRecords> mIccRecords = new AtomicReference<IccRecords>();
    private DctConstants.Activity mActivity = DctConstants.Activity.NONE;
    private DctConstants.Activity mActivity = DctConstants.Activity.NONE;
    private DctConstants.State mState = DctConstants.State.IDLE;
    private DctConstants.State mState = DctConstants.State.IDLE;
    private final Handler mDataConnectionTracker;
    private final Handler mDataConnectionTracker;
@@ -2106,6 +2106,11 @@ public class DcTracker extends Handler {
            }
            }
        }
        }


        if ((iaApnSetting == null) && (defaultApnSetting == null) &&
                !allowInitialAttachForOperator()) {
            log("Abort Initial attach");
            return;
        }
        // The priority of apn candidates from highest to lowest is:
        // The priority of apn candidates from highest to lowest is:
        //   1) APN_TYPE_IA (Initial Attach)
        //   1) APN_TYPE_IA (Initial Attach)
        //   2) mPreferredApn, i.e. the current preferred apn
        //   2) mPreferredApn, i.e. the current preferred apn
@@ -2137,6 +2142,10 @@ public class DcTracker extends Handler {
        }
        }
    }
    }


    protected boolean allowInitialAttachForOperator() {
        return true;
    }

    /**
    /**
     * Handles changes to the APN database.
     * Handles changes to the APN database.
     */
     */