Search in sources :

Example 1 with PhysicalChannelConfig

use of android.telephony.PhysicalChannelConfig in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class RadioInfo method updatePhysicalChannelConfiguration.

private void updatePhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) {
    StringBuilder sb = new StringBuilder();
    String div = "";
    sb.append("{");
    if (configs != null) {
        for (PhysicalChannelConfig c : configs) {
            sb.append(div).append(c);
            div = ",";
        }
    }
    sb.append("}");
    mPhyChanConfig.setText(sb.toString());
}
Also used : PhysicalChannelConfig(android.telephony.PhysicalChannelConfig)

Example 2 with PhysicalChannelConfig

use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.

the class RadioIndication method physicalChannelConfigsIndication.

private void physicalChannelConfigsIndication(List<? extends Object> configs) {
    List<PhysicalChannelConfig> response = new ArrayList<>(configs.size());
    for (Object obj : configs) {
        if (obj instanceof android.hardware.radio.V1_2.PhysicalChannelConfig) {
            android.hardware.radio.V1_2.PhysicalChannelConfig config = (android.hardware.radio.V1_2.PhysicalChannelConfig) obj;
            response.add(new PhysicalChannelConfig.Builder().setCellConnectionStatus(convertConnectionStatusFromCellConnectionStatus(config.status)).setCellBandwidthDownlinkKhz(config.cellBandwidthDownlink).build());
        } else if (obj instanceof android.hardware.radio.V1_4.PhysicalChannelConfig) {
            android.hardware.radio.V1_4.PhysicalChannelConfig config = (android.hardware.radio.V1_4.PhysicalChannelConfig) obj;
            PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
            setFrequencyRangeOrChannelNumber(builder, config);
            response.add(builder.setCellConnectionStatus(convertConnectionStatusFromCellConnectionStatus(config.base.status)).setCellBandwidthDownlinkKhz(config.base.cellBandwidthDownlink).setRat(ServiceState.rilRadioTechnologyToNetworkType(config.rat)).setPhysicalCellId(config.physicalCellId).setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray()).build());
        } else {
            mRil.riljLoge("Unsupported PhysicalChannelConfig " + obj);
        }
    }
    if (RIL.RILJ_LOGD)
        mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);
    mRil.mPhysicalChannelConfigurationRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
}
Also used : RIL_UNSOL_UICC_APPLICATIONS_ENABLEMENT_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_APPLICATIONS_ENABLEMENT_CHANGED) IRadioIndication(android.hardware.radio.V1_5.IRadioIndication) RIL_UNSOL_RINGBACK_TONE(com.android.internal.telephony.RILConstants.RIL_UNSOL_RINGBACK_TONE) RIL_UNSOL_SIGNAL_STRENGTH(com.android.internal.telephony.RILConstants.RIL_UNSOL_SIGNAL_STRENGTH) RIL_UNSOL_PCO_DATA(com.android.internal.telephony.RILConstants.RIL_UNSOL_PCO_DATA) RIL_UNSOL_RESTRICTED_STATE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESTRICTED_STATE_CHANGED) RIL_UNSOL_EMERGENCY_NUMBER_LIST(com.android.internal.telephony.RILConstants.RIL_UNSOL_EMERGENCY_NUMBER_LIST) RIL_UNSOL_RESPONSE_NEW_SMS(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS) CdmaT53AudioControlInfoRecord(android.hardware.radio.V1_0.CdmaT53AudioControlInfoRecord) CellInfo(android.telephony.CellInfo) RIL_UNSOL_CDMA_INFO_REC(com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_INFO_REC) RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED) RIL_UNSOL_DATA_CALL_LIST_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LIST_CHANGED) RIL_UNSOL_SIM_SMS_STORAGE_FULL(com.android.internal.telephony.RILConstants.RIL_UNSOL_SIM_SMS_STORAGE_FULL) CdmaCallWaitingNotification(com.android.internal.telephony.cdma.CdmaCallWaitingNotification) RIL_UNSOL_STK_SESSION_END(com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_SESSION_END) RIL_UNSOL_STK_CALL_SETUP(com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_CALL_SETUP) SsInfoData(android.hardware.radio.V1_0.SsInfoData) RIL_UNSOL_STK_EVENT_NOTIFY(com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_EVENT_NOTIFY) RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE(com.android.internal.telephony.RILConstants.RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig) SsData(com.android.internal.telephony.gsm.SsData) IccRefreshResponse(com.android.internal.telephony.uicc.IccRefreshResponse) ServiceState(android.telephony.ServiceState) CdmaInformationRecords(com.android.internal.telephony.cdma.CdmaInformationRecords) RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION(com.android.internal.telephony.RILConstants.RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION) SuppSvcNotification(android.hardware.radio.V1_0.SuppSvcNotification) RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG(com.android.internal.telephony.RILConstants.RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG) BarringInfo(android.telephony.BarringInfo) UUID(java.util.UUID) RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE(com.android.internal.telephony.RILConstants.RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE) EmergencyNumber(android.telephony.emergency.EmergencyNumber) NetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo) List(java.util.List) CdmaNumberInfoRecord(android.hardware.radio.V1_0.CdmaNumberInfoRecord) CdmaSignalInfoRecord(android.hardware.radio.V1_0.CdmaSignalInfoRecord) KeepaliveStatus(com.android.internal.telephony.dataconnection.KeepaliveStatus) RIL_UNSOL_SRVCC_STATE_NOTIFY(com.android.internal.telephony.RILConstants.RIL_UNSOL_SRVCC_STATE_NOTIFY) RIL_UNSOl_CDMA_PRL_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOl_CDMA_PRL_CHANGED) CdmaCallWaiting(android.hardware.radio.V1_0.CdmaCallWaiting) RIL_UNSOL_LCEDATA_RECV(com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV) SmsMessage(android.telephony.SmsMessage) RIL_UNSOL_CDMA_CALL_WAITING(com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_CALL_WAITING) RIL_UNSOL_RADIO_CAPABILITY(com.android.internal.telephony.RILConstants.RIL_UNSOL_RADIO_CAPABILITY) RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED) CellIdentity(android.telephony.CellIdentity) TelephonyProperties(android.sysprop.TelephonyProperties) AsyncResult(android.os.AsyncResult) IccUtils(com.android.internal.telephony.uicc.IccUtils) RIL_UNSOL_HARDWARE_CONFIG_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_HARDWARE_CONFIG_CHANGED) PcoDataInfo(android.hardware.radio.V1_0.PcoDataInfo) RadioPowerState(android.telephony.Annotation.RadioPowerState) ArrayList(java.util.ArrayList) RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED) RIL_UNSOL_RIL_CONNECTED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RIL_CONNECTED) RIL_UNSOL_CALL_RING(com.android.internal.telephony.RILConstants.RIL_UNSOL_CALL_RING) CdmaLineControlInfoRecord(android.hardware.radio.V1_0.CdmaLineControlInfoRecord) RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED) TelephonyManager(android.telephony.TelephonyManager) DataCallResponse(android.telephony.data.DataCallResponse) SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) SmsMessageConverter(com.android.internal.telephony.cdma.SmsMessageConverter) RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT) RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED) RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED) RIL_UNSOL_ON_USSD(com.android.internal.telephony.RILConstants.RIL_UNSOL_ON_USSD) RIL_UNSOL_MODEM_RESTART(com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART) RIL_UNSOL_CELL_INFO_LIST(com.android.internal.telephony.RILConstants.RIL_UNSOL_CELL_INFO_LIST) RIL_UNSOL_RESPONSE_CDMA_NEW_SMS(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_CDMA_NEW_SMS) RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM) CdmaRedirectingNumberInfoRecord(android.hardware.radio.V1_0.CdmaRedirectingNumberInfoRecord) RIL_UNSOL_KEEPALIVE_STATUS(com.android.internal.telephony.RILConstants.RIL_UNSOL_KEEPALIVE_STATUS) PcoData(android.telephony.PcoData) RIL_UNSOL_NETWORK_SCAN_RESULT(com.android.internal.telephony.RILConstants.RIL_UNSOL_NETWORK_SCAN_RESULT) RIL_UNSOL_STK_CC_ALPHA_NOTIFY(com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_CC_ALPHA_NOTIFY) AnomalyReporter(android.telephony.AnomalyReporter) TextUtils(android.text.TextUtils) RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL(com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED) RIL_UNSOL_ON_SS(com.android.internal.telephony.RILConstants.RIL_UNSOL_ON_SS) CfData(android.hardware.radio.V1_0.CfData) RIL_UNSOL_VOICE_RADIO_TECH_CHANGED(com.android.internal.telephony.RILConstants.RIL_UNSOL_VOICE_RADIO_TECH_CHANGED) SignalStrength(android.telephony.SignalStrength) StkCcUnsolSsResult(android.hardware.radio.V1_0.StkCcUnsolSsResult) RIL_UNSOL_RESEND_INCALL_MUTE(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESEND_INCALL_MUTE) SimRefreshResult(android.hardware.radio.V1_0.SimRefreshResult) RIL_UNSOL_STK_PROACTIVE_COMMAND(com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_PROACTIVE_COMMAND) CellConnectionStatus(android.hardware.radio.V1_2.CellConnectionStatus) RIL_UNSOL_NITZ_TIME_RECEIVED(com.android.internal.telephony.RILConstants.RIL_UNSOL_NITZ_TIME_RECEIVED) RIL_UNSOL_CDMA_OTA_PROVISION_STATUS(com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_OTA_PROVISION_STATUS) RIL_UNSOL_SIM_REFRESH(com.android.internal.telephony.RILConstants.RIL_UNSOL_SIM_REFRESH) RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS(com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS) RIL_UNSOL_SUPP_SVC_NOTIFICATION(com.android.internal.telephony.RILConstants.RIL_UNSOL_SUPP_SVC_NOTIFICATION) CdmaInformationRecord(android.hardware.radio.V1_0.CdmaInformationRecord) LceDataInfo(android.hardware.radio.V1_0.LceDataInfo) ArrayList(java.util.ArrayList) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig) AsyncResult(android.os.AsyncResult)

Example 3 with PhysicalChannelConfig

use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method updateNrStateFromPhysicalChannelConfigs.

private boolean updateNrStateFromPhysicalChannelConfigs(List<PhysicalChannelConfig> configs, ServiceState ss) {
    NetworkRegistrationInfo regInfo = ss.getNetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
    if (regInfo == null || configs == null)
        return false;
    boolean hasNrSecondaryServingCell = false;
    for (PhysicalChannelConfig config : configs) {
        if (isNrPhysicalChannelConfig(config) && config.getConnectionStatus() == PhysicalChannelConfig.CONNECTION_SECONDARY_SERVING) {
            hasNrSecondaryServingCell = true;
            break;
        }
    }
    int oldNrState = regInfo.getNrState();
    int newNrState = oldNrState;
    if (hasNrSecondaryServingCell) {
        newNrState = NetworkRegistrationInfo.NR_STATE_CONNECTED;
    } else {
        regInfo.updateNrState();
        newNrState = regInfo.getNrState();
    }
    boolean hasChanged = newNrState != oldNrState;
    regInfo.setNrState(newNrState);
    ss.addNetworkRegistrationInfo(regInfo);
    return hasChanged;
}
Also used : NetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig)

Example 4 with PhysicalChannelConfig

use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method updateNrFrequencyRangeFromPhysicalChannelConfigs.

private boolean updateNrFrequencyRangeFromPhysicalChannelConfigs(List<PhysicalChannelConfig> physicalChannelConfigs, ServiceState ss) {
    int newFrequencyRange = ServiceState.FREQUENCY_RANGE_UNKNOWN;
    if (physicalChannelConfigs != null) {
        DcTracker dcTracker = mPhone.getDcTracker(AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
        for (PhysicalChannelConfig config : physicalChannelConfigs) {
            if (isNrPhysicalChannelConfig(config)) {
                // Update the frequency range of the NR parameters if there is an internet data
                // connection associate to this NR physical channel channel config.
                int[] contextIds = config.getContextIds();
                for (int cid : contextIds) {
                    DataConnection dc = dcTracker.getDataConnectionByContextId(cid);
                    if (dc != null && dc.getNetworkCapabilities().hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) {
                        newFrequencyRange = ServiceState.getBetterNRFrequencyRange(newFrequencyRange, config.getFrequencyRange());
                        break;
                    }
                }
            }
        }
    }
    boolean hasChanged = newFrequencyRange != ss.getNrFrequencyRange();
    ss.setNrFrequencyRange(newFrequencyRange);
    return hasChanged;
}
Also used : DcTracker(com.android.internal.telephony.dataconnection.DcTracker) DataConnection(com.android.internal.telephony.dataconnection.DataConnection) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig)

Example 5 with PhysicalChannelConfig

use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.

the class PhysicalChannelConfigTest method testParcel.

@Test
public void testParcel() {
    PhysicalChannelConfig config = new Builder().setRat(RAT).setCellConnectionStatus(CONNECTION_STATUS).setCellBandwidthDownlinkKhz(CELL_BANDWIDTH).setFrequencyRange(FREQUENCY_RANGE).setChannelNumber(CHANNEL_NUMBER).setContextIds(CONTEXT_IDS).setPhysicalCellId(PHYSICAL_CELL_ID).build();
    Parcel parcel = Parcel.obtain();
    config.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    PhysicalChannelConfig fromParcel = PhysicalChannelConfig.CREATOR.createFromParcel(parcel);
    assertThat(fromParcel).isEqualTo(config);
}
Also used : Parcel(android.os.Parcel) Builder(android.telephony.PhysicalChannelConfig.Builder) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig) Test(org.junit.Test)

Aggregations

PhysicalChannelConfig (android.telephony.PhysicalChannelConfig)8 AsyncResult (android.os.AsyncResult)3 NetworkRegistrationInfo (android.telephony.NetworkRegistrationInfo)3 CellIdentity (android.telephony.CellIdentity)2 CellInfo (android.telephony.CellInfo)2 Builder (android.telephony.PhysicalChannelConfig.Builder)2 CdmaCallWaiting (android.hardware.radio.V1_0.CdmaCallWaiting)1 CdmaInformationRecord (android.hardware.radio.V1_0.CdmaInformationRecord)1 CdmaLineControlInfoRecord (android.hardware.radio.V1_0.CdmaLineControlInfoRecord)1 CdmaNumberInfoRecord (android.hardware.radio.V1_0.CdmaNumberInfoRecord)1 CdmaRedirectingNumberInfoRecord (android.hardware.radio.V1_0.CdmaRedirectingNumberInfoRecord)1 CdmaSignalInfoRecord (android.hardware.radio.V1_0.CdmaSignalInfoRecord)1 CdmaSmsMessage (android.hardware.radio.V1_0.CdmaSmsMessage)1 CdmaT53AudioControlInfoRecord (android.hardware.radio.V1_0.CdmaT53AudioControlInfoRecord)1 CfData (android.hardware.radio.V1_0.CfData)1 LceDataInfo (android.hardware.radio.V1_0.LceDataInfo)1 PcoDataInfo (android.hardware.radio.V1_0.PcoDataInfo)1 SimRefreshResult (android.hardware.radio.V1_0.SimRefreshResult)1 SsInfoData (android.hardware.radio.V1_0.SsInfoData)1 StkCcUnsolSsResult (android.hardware.radio.V1_0.StkCcUnsolSsResult)1