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

Commit 54eda31d authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge changes Ib28acc0c,Iaef52bed am: aaed5ee1

am: ec6e93c3

Change-Id: I77679f1f70aed9a6c367c83873cb06e085c522ff
parents 2f040002 ec6e93c3
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public class LocaleTracker extends Handler {
    public void updateOperatorNumeric(String operatorNumeric) {
        // Check if the operator numeric changes.
        if (!Objects.equals(mOperatorNumeric, operatorNumeric)) {
            String msg = "Operator numeric changes to " + operatorNumeric;
            String msg = "Operator numeric changes to \"" + operatorNumeric + "\"";
            if (DBG) log(msg);
            mLocalLog.log(msg);
            mOperatorNumeric = operatorNumeric;
@@ -286,23 +286,8 @@ public class LocaleTracker extends Handler {
            return;
        }
        List<CellInfo> cellInfoList = (List<CellInfo>) ar.result;
        String msg = "getCellInfo: cell info=" + cellInfoList;
        String msg = "processCellInfo: cell info=" + cellInfoList;
        if (DBG) log(msg);
        if (cellInfoList != null) {
            // We only log when cell identity changes, otherwise the local log is flooded with cell
            // info.
            if (mCellInfoList == null || cellInfoList.size() != mCellInfoList.size()) {
                mLocalLog.log(msg);
            } else {
                for (int i = 0; i < cellInfoList.size(); i++) {
                    if (!Objects.equals(mCellInfoList.get(i).getCellIdentity(),
                            cellInfoList.get(i).getCellIdentity())) {
                        mLocalLog.log(msg);
                        break;
                    }
                }
            }
        }
        mCellInfoList = cellInfoList;
        updateLocale();
    }
@@ -412,7 +397,7 @@ public class LocaleTracker extends Handler {
        boolean countryChanged = false;
        if (!Objects.equals(countryIso, mCurrentCountryIso)) {
            String msg = "updateLocale: Change the current country to \"" + countryIso
                    + "\", mcc = " + mcc;
                    + "\", mcc = " + mcc + ", mCellInfoList = " + mCellInfoList;
            log(msg);
            mLocalLog.log(msg);
            mCurrentCountryIso = countryIso;
+4 −4
Original line number Diff line number Diff line
@@ -2210,10 +2210,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mNotifier.notifyMessageWaitingChanged(this);
    }

    public void notifyDataConnection(String apnType, PhoneConstants.DataState state) {
        mNotifier.notifyDataConnection(this, apnType, state);
    }

    public void notifyDataConnection(String apnType) {
        mNotifier.notifyDataConnection(this, apnType, getDataConnectionState(apnType));
    }
@@ -2248,6 +2244,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mNotifier.notifySignalStrength(this);
    }

    public PhoneConstants.DataState getDataConnectionState(String apnType) {
        return PhoneConstants.DataState.DISCONNECTED;
    }

    public void notifyCellInfo(List<CellInfo> cellInfo) {
        AsyncResult ar = new AsyncResult(null, cellInfo, null);
        mCellInfoRegistrants.notifyRegistrants(ar);
+8 −51
Original line number Diff line number Diff line
@@ -1163,7 +1163,7 @@ public class DcTracker extends Handler {
        if (DBG) log ("onDataConnectionDetached: stop polling and notify detached");
        stopNetStatPoll();
        stopDataStallAlarm();
        notifyDataConnection();
        mPhone.notifyDataConnection();
        mAttached.set(false);
    }

@@ -1174,10 +1174,7 @@ public class DcTracker extends Handler {
            if (DBG) log("onDataConnectionAttached: start polling notify attached");
            startNetStatPoll();
            startDataStallAlarm(DATA_STALL_NOT_SUSPECTED);
            notifyDataConnection();
        } else {
            // update APN availability so that APN can be enabled.
            notifyOffApnsOfAvailability();
            mPhone.notifyDataConnection();
        }
        if (mAutoAttachOnCreationConfig) {
            mAutoAttachOnCreation.set(true);
@@ -1439,7 +1436,6 @@ public class DcTracker extends Handler {
                        buildWaitingApns(apnContext.getApnType(), radioTech);
                if (waitingApns.isEmpty()) {
                    notifyNoData(DataFailCause.MISSING_UNKNOWN_APN, apnContext);
                    notifyOffApnsOfAvailability();
                    String str = "trySetupData: X No APN found retValue=false";
                    if (DBG) log(str);
                    apnContext.requestLog(str);
@@ -1454,7 +1450,6 @@ public class DcTracker extends Handler {
            }

            boolean retValue = setupData(apnContext, radioTech, requestType);
            notifyOffApnsOfAvailability();

            if (DBG) log("trySetupData: X retValue=" + retValue);
            return retValue;
@@ -1463,7 +1458,6 @@ public class DcTracker extends Handler {
                    && apnContext.isConnectable()) {
                mPhone.notifyDataConnectionFailed(apnContext.getApnType());
            }
            notifyOffApnsOfAvailability();

            StringBuilder str = new StringBuilder();

@@ -1489,22 +1483,6 @@ public class DcTracker extends Handler {
        }
    }

    // Disabled apn's still need avail/unavail notifications - send them out
    private void notifyOffApnsOfAvailability() {
        for (ApnContext apnContext : mApnContexts.values()) {
            if (!mAttached.get() || !apnContext.isReady()) {
                if (DBG) log("notifyOffApnOfAvailability type:" + apnContext.getApnType());
                mPhone.notifyDataConnection(apnContext.getApnType(),
                                            PhoneConstants.DataState.DISCONNECTED);
            } else {
                if (VDBG) {
                    log("notifyOffApnsOfAvailability skipped apn due to attached && isReady " +
                            apnContext.toString());
                }
            }
        }
    }

    /**
     * Clean up all data connections. Note this is just detach the APN context from the data
     * connection. After all APN contexts are detached from the data connection, the data
@@ -2186,10 +2164,7 @@ public class DcTracker extends Handler {
        createAllApnList();
        setDataProfilesAsNeeded();
        setInitialAttachApn();
        if (mPhone.mCi.getRadioState() == TelephonyManager.RADIO_POWER_ON) {
            if (DBG) log("onRecordsLoadedOrSubIdChanged: notifying data availability");
            notifyOffApnsOfAvailability();
        }
        mPhone.notifyDataConnection();
        setupDataOnConnectableApns(Phone.REASON_SIM_LOADED, RetryFailures.ALWAYS);
    }

@@ -2583,10 +2558,9 @@ public class DcTracker extends Handler {
            // If the user did not enable data roaming, now when we transit from roaming to
            // non-roaming, we should try to reestablish the data connection.

            notifyOffApnsOfAvailability();
            setupDataOnConnectableApns(Phone.REASON_ROAMING_OFF, RetryFailures.ALWAYS);
        } else {
            notifyDataConnection();
            mPhone.notifyDataConnection();
        }
    }

@@ -2617,14 +2591,13 @@ public class DcTracker extends Handler {
            if (DBG) log("onDataRoamingOnOrSettingsChanged: setup data on roaming");

            setupDataOnConnectableApns(Phone.REASON_ROAMING_ON, RetryFailures.ALWAYS);
            notifyDataConnection();
            mPhone.notifyDataConnection();
        } else {
            // If the user does not turn on data roaming, when we transit from non-roaming to
            // roaming, we need to tear down the data connection otherwise the user might be
            // charged for data roaming usage.
            if (DBG) log("onDataRoamingOnOrSettingsChanged: Tear down data connection on roaming.");
            cleanUpAllConnectionsInternal(true, Phone.REASON_ROAMING_ON);
            notifyOffApnsOfAvailability();
        }
    }

@@ -2650,16 +2623,11 @@ public class DcTracker extends Handler {
            // Assume data is connected on the simulator
            // FIXME  this can be improved
            // setState(DctConstants.State.CONNECTED);
            notifyDataConnection();
            mPhone.notifyDataConnection();

            log("onRadioAvailable: We're on the simulator; assuming data is connected");
        }

        IccRecords r = mIccRecords.get();
        if (r != null && r.getRecordsLoaded()) {
            notifyOffApnsOfAvailability();
        }

        if (getOverallState() != DctConstants.State.IDLE) {
            cleanUpConnectionInternal(true, RELEASE_TYPE_DETACH, null);
        }
@@ -2682,7 +2650,6 @@ public class DcTracker extends Handler {
            if (DBG) log("onRadioOffOrNotAvailable: is off and clean up all connections");
            cleanUpAllConnectionsInternal(false, Phone.REASON_RADIO_TURNED_OFF);
        }
        notifyOffApnsOfAvailability();
    }

    private void completeConnection(ApnContext apnContext) {
@@ -3047,7 +3014,7 @@ public class DcTracker extends Handler {
            if (DBG) log("onVoiceCallStarted stop polling");
            stopNetStatPoll();
            stopDataStallAlarm();
            notifyDataConnection();
            mPhone.notifyDataConnection();
        }
    }

@@ -3058,7 +3025,7 @@ public class DcTracker extends Handler {
            if (!mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) {
                startNetStatPoll();
                startDataStallAlarm(DATA_STALL_NOT_SUSPECTED);
                notifyDataConnection();
                mPhone.notifyDataConnection();
            } else {
                // clean slate after call end.
                resetPollStats();
@@ -3090,16 +3057,6 @@ public class DcTracker extends Handler {
        return true;
    }

    private void notifyDataConnection() {
        for (ApnContext apnContext : mApnContexts.values()) {
            if (mAttached.get() && apnContext.isReady()) {
                if (DBG) log("notifyDataConnection: type:" + apnContext.getApnType());
                mPhone.notifyDataConnection(apnContext.getApnType());
            }
        }
        notifyOffApnsOfAvailability();
    }

    private void setDataProfilesAsNeeded() {
        if (DBG) log("setDataProfilesAsNeeded");

+0 −5
Original line number Diff line number Diff line
@@ -183,11 +183,6 @@ abstract class ImsPhoneBase extends Phone {
        return PhoneConstants.DataState.DISCONNECTED;
    }

    @Override
    public PhoneConstants.DataState getDataConnectionState(String apnType) {
        return PhoneConstants.DataState.DISCONNECTED;
    }

    @Override
    public DataActivityState getDataActivityState() {
        return DataActivityState.NONE;
+0 −5
Original line number Diff line number Diff line
@@ -134,11 +134,6 @@ abstract class SipPhoneBase extends Phone {
        return PhoneConstants.DataState.DISCONNECTED;
    }

    @Override
    public PhoneConstants.DataState getDataConnectionState(String apnType) {
        return PhoneConstants.DataState.DISCONNECTED;
    }

    @Override
    public DataActivityState getDataActivityState() {
        return DataActivityState.NONE;
Loading