Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +43 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.telecom.TelecomManager; import android.telecom.VideoProfile; import android.telephony.AccessNetworkConstants; import android.telephony.BarringInfo; import android.telephony.CarrierBandwidth; import android.telephony.CarrierConfigManager; import android.telephony.CellIdentity; import android.telephony.ImsiEncryptionInfo; Loading Loading @@ -244,6 +245,7 @@ public class GsmCdmaPhone extends Phone { private CarrierInfoManager mCIM; private final SettingsObserver mSettingsObserver; private CarrierBandwidth mCarrierBandwidth = new CarrierBandwidth(); // Constructors Loading Loading @@ -389,6 +391,7 @@ public class GsmCdmaPhone extends Phone { mCi.registerForRilConnected(this, EVENT_RIL_CONNECTED, null); mCi.registerForVoiceRadioTechChanged(this, EVENT_VOICE_RADIO_TECH_CHANGED, null); mCi.registerForLceInfo(this, EVENT_LINK_CAPACITY_CHANGED, null); IntentFilter filter = new IntentFilter( CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED); filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED); Loading Loading @@ -513,6 +516,37 @@ public class GsmCdmaPhone extends Phone { } } /** * get carrier bandwidth per primary and secondary carrier * @return CarrierBandwidth with bandwidth of both primary and secondary carrier. */ public CarrierBandwidth getCarrierBandwidth() { return mCarrierBandwidth; } private void updateCarrierBandwidths(LinkCapacityEstimate lce) { if (DBG) logd("updateCarrierBandwidths: lce=" + lce); if (lce == null) { mCarrierBandwidth = new CarrierBandwidth(); return; } int primaryDownlinkCapacityKbps = lce.downlinkCapacityKbps; int primaryUplinkCapacityKbps = lce.uplinkCapacityKbps; if (primaryDownlinkCapacityKbps != CarrierBandwidth.INVALID && lce.secondaryDownlinkCapacityKbps != CarrierBandwidth.INVALID) { primaryDownlinkCapacityKbps = lce.downlinkCapacityKbps - lce.secondaryDownlinkCapacityKbps; } if (primaryUplinkCapacityKbps != CarrierBandwidth.INVALID && lce.secondaryUplinkCapacityKbps != CarrierBandwidth.INVALID) { primaryUplinkCapacityKbps = lce.uplinkCapacityKbps - lce.secondaryUplinkCapacityKbps; } mCarrierBandwidth = new CarrierBandwidth(primaryDownlinkCapacityKbps, primaryUplinkCapacityKbps, lce.secondaryDownlinkCapacityKbps, lce.secondaryUplinkCapacityKbps); } @Override protected void finalize() { if(DBG) logd("GsmCdmaPhone finalized"); Loading Loading @@ -2793,6 +2827,15 @@ public class GsmCdmaPhone extends Phone { } break; case EVENT_LINK_CAPACITY_CHANGED: ar = (AsyncResult) msg.obj; if (ar.exception == null && ar.result != null) { updateCarrierBandwidths((LinkCapacityEstimate) ar.result); } else { logd("Unexpected exception on EVENT_LINK_CAPACITY_CHANGED"); } break; case EVENT_UPDATE_PHONE_OBJECT: phoneObjectUpdater(msg.arg1); break; Loading src/java/com/android/internal/telephony/LinkCapacityEstimate.java +29 −2 Original line number Diff line number Diff line Loading @@ -29,12 +29,20 @@ public class LinkCapacityEstimate { /** LCE is suspended; Deprecated in HAL 1.2 */ public static final int STATUS_SUSPENDED = 1; /** Downlink radio link capacity in kbps */ /** Downlink radio link capacity in kbps. In case of a dual connected network, * this includes capacity of both primary and secondary */ public final int downlinkCapacityKbps; /** Uplink radio link capacity; added in HAL 1.2 */ /** Uplink radio link capacity; added in HAL 1.2. In case of a dual connected network, * this includes capacity of both primary and secondary */ public final int uplinkCapacityKbps; /** Downlink radio link capacity of secondary network in kbps */ public final int secondaryDownlinkCapacityKbps; /** Uplink radio link capacity of secondary network in kbps */ public final int secondaryUplinkCapacityKbps; /** Confidence of the downlink estimate as a percentage [1, 100]; deprecated in HAL 1.2 */ public final int confidence; Loading @@ -47,6 +55,8 @@ public class LinkCapacityEstimate { this.confidence = confidence; this.status = status; this.uplinkCapacityKbps = INVALID; this.secondaryDownlinkCapacityKbps = INVALID; this.secondaryUplinkCapacityKbps = INVALID; } /** Constructor matching the estimate in Radio HAL v1.2 */ Loading @@ -55,6 +65,19 @@ public class LinkCapacityEstimate { this.uplinkCapacityKbps = uplinkCapacityKbps; this.confidence = INVALID; this.status = INVALID; this.secondaryDownlinkCapacityKbps = INVALID; this.secondaryUplinkCapacityKbps = INVALID; } /** Constructor matching the estimate in Radio HAL v1.6 */ public LinkCapacityEstimate(int downlinkCapacityKbps, int uplinkCapacityKbps, int secondaryDownlinkCapacityKbps, int secondaryUplinkCapacityKbps) { this.downlinkCapacityKbps = downlinkCapacityKbps; this.uplinkCapacityKbps = uplinkCapacityKbps; this.confidence = INVALID; this.status = INVALID; this.secondaryDownlinkCapacityKbps = secondaryDownlinkCapacityKbps; this.secondaryUplinkCapacityKbps = secondaryUplinkCapacityKbps; } @Override Loading @@ -68,6 +91,10 @@ public class LinkCapacityEstimate { .append(confidence) .append(", status=") .append(status) .append("{secondaryDownlinkCapacityKbps=") .append(secondaryDownlinkCapacityKbps) .append(", secondaryUplinkCapacityKbps=") .append(secondaryUplinkCapacityKbps) .toString(); } } src/java/com/android/internal/telephony/Phone.java +11 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.sysprop.TelephonyProperties; import android.telecom.VideoProfile; import android.telephony.AccessNetworkConstants; import android.telephony.Annotation.ApnType; import android.telephony.CarrierBandwidth; import android.telephony.CarrierConfigManager; import android.telephony.CarrierRestrictionRules; import android.telephony.CellIdentity; Loading Loading @@ -215,8 +216,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { protected static final int EVENT_REAPPLY_UICC_APPS_ENABLEMENT_DONE = 56; protected static final int EVENT_REGISTRATION_FAILED = 57; protected static final int EVENT_BARRING_INFO_CHANGED = 58; protected static final int EVENT_LINK_CAPACITY_CHANGED = 59; protected static final int EVENT_LAST = EVENT_BARRING_INFO_CHANGED; protected static final int EVENT_LAST = EVENT_LINK_CAPACITY_CHANGED; // For shared prefs. private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_"; Loading Loading @@ -2223,6 +2225,14 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { mCi.isNrDualConnectivityEnabled(message, workSource); } /** * get carrier bandwidth per primary and secondary carrier * @return CarrierBandwidth with bandwidth of both primary and secondary carrier. */ public CarrierBandwidth getCarrierBandwidth() { return new CarrierBandwidth(); } /** * Enable/Disable E-UTRA-NR Dual Connectivity * @param nrDualConnectivityState expected NR dual connectivity state Loading src/java/com/android/internal/telephony/RIL.java +11 −0 Original line number Diff line number Diff line Loading @@ -6863,6 +6863,17 @@ public class RIL extends BaseCommands implements CommandsInterface { return lce; } static LinkCapacityEstimate convertHalLceData( android.hardware.radio.V1_6.LinkCapacityEstimate halData, RIL ril) { final LinkCapacityEstimate lce = new LinkCapacityEstimate( halData.downlinkCapacityKbps, halData.uplinkCapacityKbps, halData.secondaryDownlinkCapacityKbps, halData.secondaryUplinkCapacityKbps); ril.riljLog("LCE capacity information received:" + lce); return lce; } /** * Convert CellInfo defined in 1.0/types.hal to CellInfo type. * @param records List of CellInfo defined in 1.0/types.hal Loading src/java/com/android/internal/telephony/RadioIndication.java +27 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ import android.hardware.radio.V1_0.SsInfoData; import android.hardware.radio.V1_0.StkCcUnsolSsResult; import android.hardware.radio.V1_0.SuppSvcNotification; import android.hardware.radio.V1_2.CellConnectionStatus; import android.hardware.radio.V1_5.IRadioIndication; import android.hardware.radio.V1_6.IRadioIndication; import android.os.AsyncResult; import android.sysprop.TelephonyProperties; import android.telephony.Annotation.RadioPowerState; Loading Loading @@ -263,6 +263,22 @@ public class RadioIndication extends IRadioIndication.Stub { } } /** * Indicates current link capacity estimate. */ public void currentLinkCapacityEstimate_1_6(int indicationType, android.hardware.radio.V1_6.LinkCapacityEstimate lce) { mRil.processIndication(indicationType); LinkCapacityEstimate response = RIL.convertHalLceData(lce, mRil); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_LCEDATA_RECV, response); if (mRil.mLceInfoRegistrants != null) { mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } } /** * Indicates the current signal strength of the camped or primary serving cell. */ Loading Loading @@ -359,6 +375,16 @@ public class RadioIndication extends IRadioIndication.Stub { responseDataCallListChanged(indicationType, dcList); } /** Indicates current data call list with radio HAL 1.6. */ public void dataCallListChanged_1_6(int indicationType, ArrayList<android.hardware.radio.V1_6.SetupDataCallResult> dcList) { responseDataCallListChanged(indicationType, dcList); } /** unthrottleApn */ public void unthrottleApn(int indicationType, String apn) { } public void suppSvcNotify(int indicationType, SuppSvcNotification suppSvcNotification) { mRil.processIndication(indicationType); Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +43 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.telecom.TelecomManager; import android.telecom.VideoProfile; import android.telephony.AccessNetworkConstants; import android.telephony.BarringInfo; import android.telephony.CarrierBandwidth; import android.telephony.CarrierConfigManager; import android.telephony.CellIdentity; import android.telephony.ImsiEncryptionInfo; Loading Loading @@ -244,6 +245,7 @@ public class GsmCdmaPhone extends Phone { private CarrierInfoManager mCIM; private final SettingsObserver mSettingsObserver; private CarrierBandwidth mCarrierBandwidth = new CarrierBandwidth(); // Constructors Loading Loading @@ -389,6 +391,7 @@ public class GsmCdmaPhone extends Phone { mCi.registerForRilConnected(this, EVENT_RIL_CONNECTED, null); mCi.registerForVoiceRadioTechChanged(this, EVENT_VOICE_RADIO_TECH_CHANGED, null); mCi.registerForLceInfo(this, EVENT_LINK_CAPACITY_CHANGED, null); IntentFilter filter = new IntentFilter( CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED); filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED); Loading Loading @@ -513,6 +516,37 @@ public class GsmCdmaPhone extends Phone { } } /** * get carrier bandwidth per primary and secondary carrier * @return CarrierBandwidth with bandwidth of both primary and secondary carrier. */ public CarrierBandwidth getCarrierBandwidth() { return mCarrierBandwidth; } private void updateCarrierBandwidths(LinkCapacityEstimate lce) { if (DBG) logd("updateCarrierBandwidths: lce=" + lce); if (lce == null) { mCarrierBandwidth = new CarrierBandwidth(); return; } int primaryDownlinkCapacityKbps = lce.downlinkCapacityKbps; int primaryUplinkCapacityKbps = lce.uplinkCapacityKbps; if (primaryDownlinkCapacityKbps != CarrierBandwidth.INVALID && lce.secondaryDownlinkCapacityKbps != CarrierBandwidth.INVALID) { primaryDownlinkCapacityKbps = lce.downlinkCapacityKbps - lce.secondaryDownlinkCapacityKbps; } if (primaryUplinkCapacityKbps != CarrierBandwidth.INVALID && lce.secondaryUplinkCapacityKbps != CarrierBandwidth.INVALID) { primaryUplinkCapacityKbps = lce.uplinkCapacityKbps - lce.secondaryUplinkCapacityKbps; } mCarrierBandwidth = new CarrierBandwidth(primaryDownlinkCapacityKbps, primaryUplinkCapacityKbps, lce.secondaryDownlinkCapacityKbps, lce.secondaryUplinkCapacityKbps); } @Override protected void finalize() { if(DBG) logd("GsmCdmaPhone finalized"); Loading Loading @@ -2793,6 +2827,15 @@ public class GsmCdmaPhone extends Phone { } break; case EVENT_LINK_CAPACITY_CHANGED: ar = (AsyncResult) msg.obj; if (ar.exception == null && ar.result != null) { updateCarrierBandwidths((LinkCapacityEstimate) ar.result); } else { logd("Unexpected exception on EVENT_LINK_CAPACITY_CHANGED"); } break; case EVENT_UPDATE_PHONE_OBJECT: phoneObjectUpdater(msg.arg1); break; Loading
src/java/com/android/internal/telephony/LinkCapacityEstimate.java +29 −2 Original line number Diff line number Diff line Loading @@ -29,12 +29,20 @@ public class LinkCapacityEstimate { /** LCE is suspended; Deprecated in HAL 1.2 */ public static final int STATUS_SUSPENDED = 1; /** Downlink radio link capacity in kbps */ /** Downlink radio link capacity in kbps. In case of a dual connected network, * this includes capacity of both primary and secondary */ public final int downlinkCapacityKbps; /** Uplink radio link capacity; added in HAL 1.2 */ /** Uplink radio link capacity; added in HAL 1.2. In case of a dual connected network, * this includes capacity of both primary and secondary */ public final int uplinkCapacityKbps; /** Downlink radio link capacity of secondary network in kbps */ public final int secondaryDownlinkCapacityKbps; /** Uplink radio link capacity of secondary network in kbps */ public final int secondaryUplinkCapacityKbps; /** Confidence of the downlink estimate as a percentage [1, 100]; deprecated in HAL 1.2 */ public final int confidence; Loading @@ -47,6 +55,8 @@ public class LinkCapacityEstimate { this.confidence = confidence; this.status = status; this.uplinkCapacityKbps = INVALID; this.secondaryDownlinkCapacityKbps = INVALID; this.secondaryUplinkCapacityKbps = INVALID; } /** Constructor matching the estimate in Radio HAL v1.2 */ Loading @@ -55,6 +65,19 @@ public class LinkCapacityEstimate { this.uplinkCapacityKbps = uplinkCapacityKbps; this.confidence = INVALID; this.status = INVALID; this.secondaryDownlinkCapacityKbps = INVALID; this.secondaryUplinkCapacityKbps = INVALID; } /** Constructor matching the estimate in Radio HAL v1.6 */ public LinkCapacityEstimate(int downlinkCapacityKbps, int uplinkCapacityKbps, int secondaryDownlinkCapacityKbps, int secondaryUplinkCapacityKbps) { this.downlinkCapacityKbps = downlinkCapacityKbps; this.uplinkCapacityKbps = uplinkCapacityKbps; this.confidence = INVALID; this.status = INVALID; this.secondaryDownlinkCapacityKbps = secondaryDownlinkCapacityKbps; this.secondaryUplinkCapacityKbps = secondaryUplinkCapacityKbps; } @Override Loading @@ -68,6 +91,10 @@ public class LinkCapacityEstimate { .append(confidence) .append(", status=") .append(status) .append("{secondaryDownlinkCapacityKbps=") .append(secondaryDownlinkCapacityKbps) .append(", secondaryUplinkCapacityKbps=") .append(secondaryUplinkCapacityKbps) .toString(); } }
src/java/com/android/internal/telephony/Phone.java +11 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.sysprop.TelephonyProperties; import android.telecom.VideoProfile; import android.telephony.AccessNetworkConstants; import android.telephony.Annotation.ApnType; import android.telephony.CarrierBandwidth; import android.telephony.CarrierConfigManager; import android.telephony.CarrierRestrictionRules; import android.telephony.CellIdentity; Loading Loading @@ -215,8 +216,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { protected static final int EVENT_REAPPLY_UICC_APPS_ENABLEMENT_DONE = 56; protected static final int EVENT_REGISTRATION_FAILED = 57; protected static final int EVENT_BARRING_INFO_CHANGED = 58; protected static final int EVENT_LINK_CAPACITY_CHANGED = 59; protected static final int EVENT_LAST = EVENT_BARRING_INFO_CHANGED; protected static final int EVENT_LAST = EVENT_LINK_CAPACITY_CHANGED; // For shared prefs. private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_"; Loading Loading @@ -2223,6 +2225,14 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { mCi.isNrDualConnectivityEnabled(message, workSource); } /** * get carrier bandwidth per primary and secondary carrier * @return CarrierBandwidth with bandwidth of both primary and secondary carrier. */ public CarrierBandwidth getCarrierBandwidth() { return new CarrierBandwidth(); } /** * Enable/Disable E-UTRA-NR Dual Connectivity * @param nrDualConnectivityState expected NR dual connectivity state Loading
src/java/com/android/internal/telephony/RIL.java +11 −0 Original line number Diff line number Diff line Loading @@ -6863,6 +6863,17 @@ public class RIL extends BaseCommands implements CommandsInterface { return lce; } static LinkCapacityEstimate convertHalLceData( android.hardware.radio.V1_6.LinkCapacityEstimate halData, RIL ril) { final LinkCapacityEstimate lce = new LinkCapacityEstimate( halData.downlinkCapacityKbps, halData.uplinkCapacityKbps, halData.secondaryDownlinkCapacityKbps, halData.secondaryUplinkCapacityKbps); ril.riljLog("LCE capacity information received:" + lce); return lce; } /** * Convert CellInfo defined in 1.0/types.hal to CellInfo type. * @param records List of CellInfo defined in 1.0/types.hal Loading
src/java/com/android/internal/telephony/RadioIndication.java +27 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ import android.hardware.radio.V1_0.SsInfoData; import android.hardware.radio.V1_0.StkCcUnsolSsResult; import android.hardware.radio.V1_0.SuppSvcNotification; import android.hardware.radio.V1_2.CellConnectionStatus; import android.hardware.radio.V1_5.IRadioIndication; import android.hardware.radio.V1_6.IRadioIndication; import android.os.AsyncResult; import android.sysprop.TelephonyProperties; import android.telephony.Annotation.RadioPowerState; Loading Loading @@ -263,6 +263,22 @@ public class RadioIndication extends IRadioIndication.Stub { } } /** * Indicates current link capacity estimate. */ public void currentLinkCapacityEstimate_1_6(int indicationType, android.hardware.radio.V1_6.LinkCapacityEstimate lce) { mRil.processIndication(indicationType); LinkCapacityEstimate response = RIL.convertHalLceData(lce, mRil); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_LCEDATA_RECV, response); if (mRil.mLceInfoRegistrants != null) { mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } } /** * Indicates the current signal strength of the camped or primary serving cell. */ Loading Loading @@ -359,6 +375,16 @@ public class RadioIndication extends IRadioIndication.Stub { responseDataCallListChanged(indicationType, dcList); } /** Indicates current data call list with radio HAL 1.6. */ public void dataCallListChanged_1_6(int indicationType, ArrayList<android.hardware.radio.V1_6.SetupDataCallResult> dcList) { responseDataCallListChanged(indicationType, dcList); } /** unthrottleApn */ public void unthrottleApn(int indicationType, String apn) { } public void suppSvcNotify(int indicationType, SuppSvcNotification suppSvcNotification) { mRil.processIndication(indicationType); Loading