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

Commit 1c974129 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5434517 from b5b81e57 to qt-release

Change-Id: I8ece54db64dcf8b849aaaef4bb80abfc6ea866da
parents edc34ee7 b5b81e57
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3933,7 +3933,12 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    public void callEndCleanupHandOverCallIfAny() {
    }

    public void cancelUSSD() {
    /**
     * Cancel USSD session.
     *
     * @param msg The message to dispatch when the USSD session terminated.
     */
    public void cancelUSSD(Message msg) {
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                }
            }
        } catch (NoSuchElementException e) {
            mRadioProxy = null;
            mOemHookProxy = null;
            riljLoge("IOemHook service is not on the device HAL: " + e);
        }  catch (RemoteException e) {
            mOemHookProxy = null;
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class RadioBugDetector {
            mRadioBugStatus = isSystemError ? RADIO_BUG_REPETITIVE_SYSTEM_ERROR :
                    RADIO_BUG_REPETITIVE_WAKELOCK_TIMEOUT_ERROR;
            Intent intent = new Intent(TelephonyIntents.ACTION_REPORT_RADIO_BUG);
            intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            intent.putExtra(TelephonyIntents.EXTRA_SLOT_ID, mSlotId);
            intent.putExtra(TelephonyIntents.EXTRA_RADIO_BUG_TYPE, mRadioBugStatus);
            mContext.sendBroadcast(intent, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE);
+17 −4
Original line number Diff line number Diff line
@@ -21,13 +21,14 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.PersistableBundle;
import android.os.UserHandle;
import android.telephony.AccessNetworkConstants;
import android.telephony.CarrierConfigManager;
import android.telephony.ServiceState;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.util.SparseArray;
import android.util.SparseIntArray;

import java.util.ArrayList;
import java.util.Arrays;

/**
@@ -118,7 +119,13 @@ public class RatRatcheter {
        if (mVoiceRatchetEnabled) {
            int newVoiceRat = ratchetRat(oldSS.getRilVoiceRadioTechnology(),
                    newSS.getRilVoiceRadioTechnology());
            newSS.setRilVoiceRadioTechnology(newVoiceRat);
            NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo(
                    NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
            if (nri != null) {
                nri.setAccessNetworkTechnology(
                        ServiceState.rilRadioTechnologyToNetworkType(newVoiceRat));
                newSS.addNetworkRegistrationInfo(nri);
            }
        } else if (oldSS.getRilVoiceRadioTechnology() != newSS.getRilVoiceRadioTechnology()) {
            // resume rat ratchet on following rat change within the same location
            mVoiceRatchetEnabled = true;
@@ -127,7 +134,13 @@ public class RatRatcheter {
        if (mDataRatchetEnabled) {
            int newDataRat = ratchetRat(oldSS.getRilDataRadioTechnology(),
                    newSS.getRilDataRadioTechnology());
            newSS.setRilDataRadioTechnology(newDataRat);
            NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo(
                    NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
            if (nri != null) {
                nri.setAccessNetworkTechnology(
                        ServiceState.rilRadioTechnologyToNetworkType(newDataRat));
                newSS.addNetworkRegistrationInfo(nri);
            }
        } else if (oldSS.getRilDataRadioTechnology() != newSS.getRilDataRadioTechnology()) {
            // resume rat ratchet on following rat change within the same location
            mDataRatchetEnabled = true;
+54 −11
Original line number Diff line number Diff line
@@ -1988,7 +1988,6 @@ public class ServiceStateTracker extends Handler {
                == TelephonyManager.NETWORK_TYPE_IWLAN
                && wlanPsRegState.getRegistrationState()
                == NetworkRegistrationInfo.REGISTRATION_STATE_HOME) {
            serviceState.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN);
            serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE);
        } else if (wwanPsRegState != null) {
            // If the device is not camped on IWLAN, then we use cellular PS registration state
@@ -1997,7 +1996,6 @@ public class ServiceStateTracker extends Handler {
            int dataRat = ServiceState.networkTypeToRilRadioTechnology(
                    wwanPsRegState.getAccessNetworkTechnology());
            serviceState.setDataRegState(regCodeToServiceState(regState));
            serviceState.setRilDataRadioTechnology(dataRat);
        }
        if (DBG) {
            log("combinePsRegistrationStates: " + serviceState);
@@ -2019,7 +2017,6 @@ public class ServiceStateTracker extends Handler {

                mNewSS.setVoiceRegState(regCodeToServiceState(registrationState));
                mNewSS.setCssIndicator(cssIndicator);
                mNewSS.setRilVoiceRadioTechnology(newVoiceRat);
                mNewSS.addNetworkRegistrationInfo(networkRegState);
                setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity());

@@ -2153,8 +2150,6 @@ public class ServiceStateTracker extends Handler {

                updateServiceStateLteEarfcnBoost(mNewSS,
                        getLteEarfcn(networkRegState.getCellIdentity()));

                mNewSS.setIsUsingCarrierAggregation(dataSpecificStates.isUsingCarrierAggregation);
                break;
            }

@@ -2671,7 +2666,7 @@ public class ServiceStateTracker extends Handler {
                plmn = String.format(wfcVoiceSpnFormat, originalPlmn);
            } else if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) {
                // todo: temporary hack; should have a better fix. This is to avoid using operator
                // name from ServiceState (populated in resetServiceStateInIwlanMode()) until
                // name from ServiceState (populated in processIwlanRegistrationInfo()) until
                // wifi calling is actually enabled
                log("updateSpnDisplay: overwriting plmn from " + plmn + " to null as radio " +
                        "state is off");
@@ -2992,7 +2987,7 @@ public class ServiceStateTracker extends Handler {
            mNewSS.setDataRoaming(true);
        }
        useDataRegStateForDataOnlyDevices();
        resetServiceStateInIwlanMode();
        processIwlanRegistrationInfo();

        if (Build.IS_DEBUGGABLE && mPhone.mTelephonyTester != null) {
            mPhone.mTelephonyTester.overrideServiceState(mNewSS);
@@ -5044,8 +5039,13 @@ public class ServiceStateTracker extends Handler {
    /* Reset Service state when IWLAN is enabled as polling in airplane mode
     * causes state to go to OUT_OF_SERVICE state instead of STATE_OFF
     */
    @UnsupportedAppUsage
    protected void resetServiceStateInIwlanMode() {


    /**
     * This method adds IWLAN registration info for legacy mode devices camped on IWLAN. It also
     * makes some adjustments when the device camps on IWLAN in airplane mode.
     */
    private void processIwlanRegistrationInfo() {
        if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) {
            boolean resetIwlanRatVal = false;
            log("set service state as POWER_OFF");
@@ -5059,11 +5059,54 @@ public class ServiceStateTracker extends Handler {
            String operator = mNewSS.getOperatorAlphaLong();
            mNewSS.setStateOff();
            if (resetIwlanRatVal) {
                mNewSS.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN);
                mNewSS.setDataRegState(ServiceState.STATE_IN_SERVICE);
                NetworkRegistrationInfo nri = new NetworkRegistrationInfo.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN)
                        .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
                        .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN)
                        .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME)
                        .build();
                mNewSS.addNetworkRegistrationInfo(nri);
                if (mTransportManager.isInLegacyMode()) {
                    // If in legacy mode, simulate the behavior that IWLAN registration info
                    // is reported through WWAN transport.
                    nri = new NetworkRegistrationInfo.Builder()
                            .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                            .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
                            .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN)
                            .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME)
                            .build();
                    mNewSS.addNetworkRegistrationInfo(nri);
                }
                mNewSS.setOperatorAlphaLong(operator);
                log("pollStateDone: mNewSS = " + mNewSS);
            }
            return;
        }

        // If the device operates in legacy mode and camps on IWLAN, modem reports IWLAN as a RAT
        // through WWAN registration info. To be consistent with the behavior with AP-assisted mode,
        // we manually make a WLAN registration info for clients to consume. In this scenario,
        // both WWAN and WLAN registration info are the IWLAN registration info and that's the
        // unfortunate limitation we have when the device operates in legacy mode. In AP-assisted
        // mode, the WWAN registration will correctly report the actual cellular registration info
        // when the device camps on IWLAN.
        if (mTransportManager.isInLegacyMode()) {
            NetworkRegistrationInfo wwanNri = mSS.getNetworkRegistrationInfo(
                    NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
            if (wwanNri != null && wwanNri.getAccessNetworkTechnology()
                    == TelephonyManager.NETWORK_TYPE_IWLAN) {
                NetworkRegistrationInfo wlanNri = new NetworkRegistrationInfo.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN)
                        .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
                        .setRegistrationState(wwanNri.getRegistrationState())
                        .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN)
                        .setRejectCause(wwanNri.getRejectCause())
                        .setEmergencyOnly(wwanNri.isEmergencyEnabled())
                        .setAvailableServices(wwanNri.getAvailableServices())
                        .build();
                mSS.addNetworkRegistrationInfo(wlanNri);
            }
        }
    }

Loading