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

Commit 662b016d authored by Ramesh Sudini's avatar Ramesh Sudini Committed by Wink Saville
Browse files

Telephony: Data availability indication upon records loaded.

This will make sure if records loaded comes after radio availability we dont miss sending
out dataAvailability.

Change-Id: Ibbecaa89f28e1441e799bf1681d0b4692cf0f13a
parent 7353301f
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -115,6 +115,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
    static final Uri PREFERAPN_URI = Uri.parse("content://telephony/carriers/preferapn");
    static final Uri PREFERAPN_URI = Uri.parse("content://telephony/carriers/preferapn");
    static final String APN_ID = "apn_id";
    static final String APN_ID = "apn_id";
    private boolean canSetPreferApn = false;
    private boolean canSetPreferApn = false;
    private boolean mRadioAvailable = false;


    @Override
    @Override
    protected void onActionIntentReconnectAlarm(Intent intent) {
    protected void onActionIntentReconnectAlarm(Intent intent) {
@@ -1325,6 +1326,10 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
    private void onRecordsLoaded() {
    private void onRecordsLoaded() {
        if (DBG) log("onRecordsLoaded: createAllApnList");
        if (DBG) log("onRecordsLoaded: createAllApnList");
        createAllApnList();
        createAllApnList();
        if (mRadioAvailable) {
            if (DBG) log("onRecordsLoaded, notifying data availability");
            notifyDataAvailability(null);
        }
        setupDataOnReadyApns(Phone.REASON_SIM_LOADED);
        setupDataOnReadyApns(Phone.REASON_SIM_LOADED);
    }
    }


@@ -1436,6 +1441,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {


    @Override
    @Override
    protected void onRadioAvailable() {
    protected void onRadioAvailable() {

        mRadioAvailable = true;
        if (mPhone.getSimulatedRadioControl() != null) {
        if (mPhone.getSimulatedRadioControl() != null) {
            // Assume data is connected on the simulator
            // Assume data is connected on the simulator
            // FIXME  this can be improved
            // FIXME  this can be improved
@@ -1463,6 +1470,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
            dc.resetRetryCount();
            dc.resetRetryCount();
        }
        }
        mReregisterOnReconnectFailure = false;
        mReregisterOnReconnectFailure = false;
        mRadioAvailable = false;


        if (mPhone.getSimulatedRadioControl() != null) {
        if (mPhone.getSimulatedRadioControl() != null) {
            // Assume data is connected on the simulator
            // Assume data is connected on the simulator
@@ -1472,6 +1480,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
            if (DBG) log("Radio is off and clean up all connection");
            if (DBG) log("Radio is off and clean up all connection");
            cleanUpAllConnections(false, Phone.REASON_RADIO_TURNED_OFF);
            cleanUpAllConnections(false, Phone.REASON_RADIO_TURNED_OFF);
        }
        }
        notifyDataAvailability(null);
    }
    }


    @Override
    @Override