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

Commit 5b971d54 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5307677 from d4ddbe3d to qt-release

Change-Id: Ic4c698c52514af70f63f9f7e4a563000a9cba7b7
parents 9b827d24 d4ddbe3d
Loading
Loading
Loading
Loading
+41 −54
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ message TelephonyLog {

  // Hardware revision (EVT, DVT, PVT etc.)
  optional string hardware_revision = 9;

  // The active subscription info for a specific slot.
  repeated ActiveSubscriptionInfo active_subscription_info = 10;
}

// The time information
@@ -276,9 +279,6 @@ message TelephonyServiceState {

  // Current data radio technology
  optional RadioAccessTechnology data_rat = 6 [default = UNKNOWN];

  // All the active subscription information.
  repeated ActiveSubscriptionInfo active_subscription_info = 7;
}

// Radio access families
@@ -619,9 +619,6 @@ message RilDataCall {

  // The network interface name e.g. wlan0, rmnet_data0.
  optional string iframe = 3;

  // All the active subscription information.
  repeated ActiveSubscriptionInfo active_subscription_info = 4;
}

message TelephonyEvent {
@@ -675,35 +672,41 @@ message TelephonyEvent {
    // Carrier Key Change event.
    CARRIER_KEY_CHANGED = 14;

    // Phone status change event.
    PHONE_STATUS_CHANGED = 15;

    // Data switch event.
    DATA_SWITCH = 16;
    DATA_SWITCH = 15;

    // Network validate event.
    NETWORK_VALIDATE = 17;
    NETWORK_VALIDATE = 16;

    // On deman data switch event.
    ON_DEMAND_DATA_SWITCH = 18;
    ON_DEMAND_DATA_SWITCH = 17;

    // SIM state change event.
    SIM_STATE_CHANGE = 18;

    // Active subscription info change event.
    ACTIVE_SUBSCRIPTION_INFO_CHANGE = 19;

    // Enabled modem change event.
    ENABLED_MODEM_CHANGE = 20;
  }

  enum ApnType {
      DEFAULT = 0;
      MMS = 1;
      SUPL = 2;
      DUN = 3;
      HIPRI = 4;
      FOTA = 5;
      IMS = 6;
      CBS = 7;
      IA = 8;
      EMERGENCY = 9;
      DEFAULT = 1;
      MMS = 2;
      SUPL = 3;
      DUN = 4;
      HIPRI = 5;
      FOTA = 6;
      IMS = 7;
      CBS = 8;
      IA = 9;
      EMERGENCY = 10;
  }

  enum EventState {
      START = 0;
      END = 1;
      START = 1;
      END = 2;
  }

  enum NetworkValidationState {
@@ -1542,17 +1545,6 @@ message TelephonyEvent {
    optional string mccmnc = 3;
  }

  message PhoneStatus {
      /** The sim state of each active slot. */
      repeated SimState sim_state = 1;

      /**
       * The modem state represent by a bitmap, the i-th bit(LSB) indicates the i-th modem
       * state(0 - disabled, 1 - enabled).
       */
      optional int32 enabled_modem_bitmap = 2;
  }

  // Time when event happened on device, in milliseconds since epoch
  optional int64 timestamp_millis = 1;

@@ -1604,9 +1596,6 @@ message TelephonyEvent {
  // Carrier key change
  optional CarrierKeyChange carrier_key_change = 17;

  // Phone status
  optional PhoneStatus phone_status = 18;

  // Data switch event
  optional DataSwitch data_switch = 19;

@@ -1615,17 +1604,27 @@ message TelephonyEvent {

  // On demand data switch event
  optional OnDemandDataSwitch on_demand_data_switch = 21;

  // Sim state for each slot.
  repeated SimState sim_state = 22;

  // The active subscription info for a specific slot.
  optional ActiveSubscriptionInfo active_subscription_info = 23;

  // The modem state represent by a bitmap, the i-th bit(LSB) indicates the i-th modem
  // state(0 - disabled, 1 - enabled).
  optional int32 enabled_modem_bitmap = 24;
}

message ActiveSubscriptionInfo {
    /** The slot index which this subscription associated with. */
    /** The slot index which this subscription is associated with. */
    optional int32 slot_index = 1;

    /** The Carrier id of this subscription. */
    /** The Carrier id of this subscription. -1 indicates unknown value. */
    optional int32 carrier_id = 2;

    /** whether subscription is opportunistic. */
    optional bool is_opportunistic = 3;
    /** whether subscription is opportunistic (0 - false, 1 - true, -1 - unknown). */
    optional int32 is_opportunistic = 3;
};

enum SimState {
@@ -2007,12 +2006,6 @@ message TelephonyCallSession {

  // Indicating some call events are dropped
  optional bool events_dropped = 4;

  // SIM state of the active slots
  repeated SimState sim_states = 5;

  // All the active subscription information.
  repeated ActiveSubscriptionInfo active_subscription_info = 6;
}

message SmsSession {
@@ -2227,12 +2220,6 @@ message SmsSession {

  // Indicating some sms session events are dropped
  optional bool events_dropped = 4;

  // SIM state of the active slots.
  repeated SimState sim_state = 5;

  // All the active subscription information.
  repeated ActiveSubscriptionInfo active_subscription_info = 6;
}

// Power stats for modem
+2 −0
Original line number Diff line number Diff line
@@ -860,6 +860,8 @@ public class GsmCdmaCallTracker extends CallTracker {
                                hoConnection.mPreHandoverState != GsmCdmaCall.State.HOLDING &&
                                dc.state == DriverCall.State.ACTIVE) {
                            mConnections[i].onConnectedInOrOut();
                        } else {
                            mConnections[i].onConnectedConnectionMigrated();
                        }

                        mHandoverConnections.remove(hoConnection);
+10 −0
Original line number Diff line number Diff line
@@ -780,6 +780,16 @@ public class GsmCdmaConnection extends Connection {
        }
    }

    /**
     * We have completed the migration of another connection to this GsmCdmaConnection (for example,
     * in the case of SRVCC) and not still DIALING/ALERTING/INCOMING/WAITING.
     */
    void onConnectedConnectionMigrated() {
        // We can release the wakelock in this case, the migrated call is not still
        // DIALING/ALERTING/INCOMING/WAITING.
        releaseWakeLock();
    }

    private void
    doDisconnect() {
        mIndex = -1;
+90 −53
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import android.os.UserHandle;
import android.os.WorkSource;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.CarrierConfigManager;
@@ -203,9 +202,10 @@ public class ServiceStateTracker extends Handler {
    protected static final int EVENT_RADIO_STATE_CHANGED                    = 1;
    protected static final int EVENT_NETWORK_STATE_CHANGED                  = 2;
    protected static final int EVENT_GET_SIGNAL_STRENGTH                    = 3;
    protected static final int EVENT_POLL_STATE_REGISTRATION           = 4;
    protected static final int EVENT_POLL_STATE_GPRS                   = 5;
    protected static final int EVENT_POLL_STATE_OPERATOR               = 6;
    protected static final int EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION    = 4;
    protected static final int EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION    = 5;
    protected static final int EVENT_POLL_STATE_PS_IWLAN_REGISTRATION       = 6;
    protected static final int EVENT_POLL_STATE_OPERATOR                    = 7;
    protected static final int EVENT_POLL_SIGNAL_STRENGTH                   = 10;
    protected static final int EVENT_NITZ_TIME                              = 11;
    protected static final int EVENT_SIGNAL_STRENGTH_UPDATE                 = 12;
@@ -1125,8 +1125,9 @@ public class ServiceStateTracker extends Handler {
                disableSingleLocationUpdate();
                break;

            case EVENT_POLL_STATE_REGISTRATION:
            case EVENT_POLL_STATE_GPRS:
            case EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION:
            case EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION:
            case EVENT_POLL_STATE_PS_IWLAN_REGISTRATION:
            case EVENT_POLL_STATE_OPERATOR:
                ar = (AsyncResult) msg.obj;
                handlePollStateResult(msg.what, ar);
@@ -1189,7 +1190,7 @@ public class ServiceStateTracker extends Handler {
                ar = (AsyncResult) msg.obj;

                if (ar.exception == null) {
                    mRegStateManagers.get(AccessNetworkConstants.TransportType.WWAN)
                    mRegStateManagers.get(TransportType.WWAN)
                            .getNetworkRegistrationState(NetworkRegistrationState.DOMAIN_CS,
                            obtainMessage(EVENT_GET_LOC_DONE, null));
                }
@@ -1449,8 +1450,8 @@ public class ServiceStateTracker extends Handler {
                            updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS);
                    hasChanged |= updateNrStatusFromPhysicalChannelConfigs(
                            list,
                            mSS.getNetworkRegistrationState(
                                    NetworkRegistrationState.DOMAIN_PS, AccessNetworkType.EUTRAN));
                            mSS.getNetworkRegistrationState(NetworkRegistrationState.DOMAIN_PS,
                                    AccessNetworkType.EUTRAN));

                    // Notify NR frequency, NR connection status or bandwidths changed.
                    if (hasChanged
@@ -1704,6 +1705,7 @@ public class ServiceStateTracker extends Handler {

        if (mPollingContext[0] == 0) {
            mNewSS.setEmergencyOnly(mEmergencyOnly);
            combinePsRegistrationStates(mNewSS);
            if (mPhone.isPhoneTypeGsm()) {
                updateRoamingState();
            } else {
@@ -1898,10 +1900,44 @@ public class ServiceStateTracker extends Handler {
        return config.getRat() == TelephonyManager.NETWORK_TYPE_NR;
    }

    /**
     * This combine PS registration states from cellular and IWLAN and generates the final data
     * reg state and rat for backward compatibility purpose. In reality there should be two separate
     * registration states for cellular and IWLAN, but in legacy mode, if the device camps on IWLAN,
     * the IWLAN registration states overwrites the service states. This method is to simulate that
     * behavior.
     *
     * @param serviceState The service state having combined registration states.
     */
    private void combinePsRegistrationStates(ServiceState serviceState) {
        NetworkRegistrationState wlanPsRegState = serviceState.getNetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, TransportType.WLAN);
        NetworkRegistrationState wwanPsRegState = serviceState.getNetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, TransportType.WWAN);
        if (wlanPsRegState != null
                && wlanPsRegState.getAccessNetworkTechnology()
                == TelephonyManager.NETWORK_TYPE_IWLAN
                && wlanPsRegState.getRegState() == NetworkRegistrationState.REG_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
            // to compute reg state and rat.
            int regState = wwanPsRegState.getRegState();
            int dataRat = ServiceState.networkTypeToRilRadioTechnology(
                    wwanPsRegState.getAccessNetworkTechnology());
            serviceState.setDataRegState(regCodeToServiceState(regState));
            serviceState.setRilDataRadioTechnology(dataRat);
        }
        if (DBG) {
            log("combinePsRegistrationStates: " + serviceState);
        }
    }

    void handlePollStateResultMessage(int what, AsyncResult ar) {
        int ints[];
        switch (what) {
            case EVENT_POLL_STATE_REGISTRATION: {
            case EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION: {
                NetworkRegistrationState networkRegState = (NetworkRegistrationState) ar.result;
                VoiceSpecificRegistrationStates voiceSpecificStates =
                        networkRegState.getVoiceSpecificStates();
@@ -1980,16 +2016,29 @@ public class ServiceStateTracker extends Handler {
                break;
            }

            case EVENT_POLL_STATE_GPRS: {
            case EVENT_POLL_STATE_PS_IWLAN_REGISTRATION: {
                NetworkRegistrationState networkRegState = (NetworkRegistrationState) ar.result;
                mNewSS.addNetworkRegistrationState(networkRegState);

                if (DBG) {
                    log("handlPollStateResultMessage: PS IWLAN. " + networkRegState);
                }
                break;
            }

            case EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION: {
                NetworkRegistrationState networkRegState = (NetworkRegistrationState) ar.result;
                mNewSS.addNetworkRegistrationState(networkRegState);
                DataSpecificRegistrationStates dataSpecificStates =
                        networkRegState.getDataSpecificStates();
                int registrationState = networkRegState.getRegState();
                int serviceState = regCodeToServiceState(registrationState);
                int newDataRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());
                mNewSS.setDataRegState(serviceState);
                mNewSS.setRilDataRadioTechnology(newDataRat);

                if (DBG) {
                    log("handlPollStateResultMessage: PS cellular. " + networkRegState);
                }

                // When we receive OOS reset the PhyChanConfig list so that non-return-to-idle
                // implementers of PhyChanConfig unsol will not carry forward a CA report
@@ -2000,7 +2049,6 @@ public class ServiceStateTracker extends Handler {
                }
                updateNrStatusFromPhysicalChannelConfigs(
                        mLastPhysicalChannelConfigList, networkRegState);
                mNewSS.addNetworkRegistrationState(networkRegState);
                setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity());

                if (mPhone.isPhoneTypeGsm()) {
@@ -2008,22 +2056,10 @@ public class ServiceStateTracker extends Handler {
                    mNewReasonDataDenied = networkRegState.getRejectCause();
                    mNewMaxDataCalls = dataSpecificStates.maxDataCalls;
                    mDataRoaming = regCodeIsRoaming(registrationState);

                    if (DBG) {
                        log("handlPollStateResultMessage: GsmSST dataServiceState=" + serviceState
                                + " regState=" + registrationState
                                + " dataRadioTechnology=" + newDataRat);
                    }
                } else if (mPhone.isPhoneTypeCdma()) {

                    boolean isDataRoaming = regCodeIsRoaming(registrationState);
                    mNewSS.setDataRoaming(isDataRoaming);

                    if (DBG) {
                        log("handlPollStateResultMessage: cdma dataServiceState=" + serviceState
                                + " regState=" + registrationState
                                + " dataRadioTechnology=" + newDataRat);
                    }
                } else {

                    // If the unsolicited signal strength comes just before data RAT family changes
@@ -2044,11 +2080,6 @@ public class ServiceStateTracker extends Handler {
                    // voice roaming state in done while handling EVENT_POLL_STATE_REGISTRATION_CDMA
                    boolean isDataRoaming = regCodeIsRoaming(registrationState);
                    mNewSS.setDataRoaming(isDataRoaming);
                    if (DBG) {
                        log("handlPollStateResultMessage: CdmaLteSST dataServiceState="
                                + serviceState + " registrationState=" + registrationState
                                + " dataRadioTechnology=" + newDataRat);
                    }
                }

                updateServiceStateLteEarfcnBoost(mNewSS,
@@ -2869,19 +2900,25 @@ public class ServiceStateTracker extends Handler {
            default:
                // Issue all poll-related commands at once then count down the responses, which
                // are allowed to arrive out-of-order
                // TODO: Add WLAN support.
                mPollingContext[0]++;
                mCi.getOperator(obtainMessage(EVENT_POLL_STATE_OPERATOR, mPollingContext));

                mPollingContext[0]++;
                mRegStateManagers.get(AccessNetworkConstants.TransportType.WWAN)
                        .getNetworkRegistrationState(NetworkRegistrationState.DOMAIN_PS,
                        obtainMessage(EVENT_POLL_STATE_GPRS, mPollingContext));
                mRegStateManagers.get(TransportType.WWAN).getNetworkRegistrationState(
                        NetworkRegistrationState.DOMAIN_PS,
                        obtainMessage(EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION, mPollingContext));

                mPollingContext[0]++;
                mRegStateManagers.get(AccessNetworkConstants.TransportType.WWAN)
                mRegStateManagers.get(TransportType.WWAN)
                        .getNetworkRegistrationState(NetworkRegistrationState.DOMAIN_CS,
                        obtainMessage(EVENT_POLL_STATE_REGISTRATION, mPollingContext));
                        obtainMessage(EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION, mPollingContext));

                if (mRegStateManagers.get(TransportType.WLAN) != null) {
                    mPollingContext[0]++;
                    mRegStateManagers.get(TransportType.WLAN).getNetworkRegistrationState(
                            NetworkRegistrationState.DOMAIN_PS,
                            obtainMessage(EVENT_POLL_STATE_PS_IWLAN_REGISTRATION, mPollingContext));
                }

                if (mPhone.isPhoneTypeGsm()) {
                    mPollingContext[0]++;
+6 −1
Original line number Diff line number Diff line
@@ -2771,6 +2771,8 @@ public class SubscriptionController extends ISub.Stub {

            refreshCachedActiveSubscriptionInfoList();

            notifySubscriptionInfoChanged();

            return groupUUID;
        } finally {
            Binder.restoreCallingIdentity(identity);
@@ -2818,6 +2820,8 @@ public class SubscriptionController extends ISub.Stub {

            refreshCachedActiveSubscriptionInfoList();

            notifySubscriptionInfoChanged();

            return result != 0;
        } finally {
            Binder.restoreCallingIdentity(identity);
@@ -3329,7 +3333,8 @@ public class SubscriptionController extends ISub.Stub {
    private void deactivateSubscription(SubscriptionInfo info) {
        // TODO: b/120439488 deactivate pSIM.
        if (info.isEmbedded()) {
            EuiccManager euiccManager = new EuiccManager(mContext);
            EuiccManager euiccManager = (EuiccManager)
                    mContext.getSystemService(Context.EUICC_SERVICE);
            euiccManager.switchToSubscription(SubscriptionManager.INVALID_SUBSCRIPTION_ID,
                    PendingIntent.getService(mContext, 0, new Intent(), 0));
        }
Loading