Loading src/java/com/android/internal/telephony/Phone.java +1 −1 Original line number Diff line number Diff line Loading @@ -2440,7 +2440,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void sendDialerSpecialCode(String code) { if (!TextUtils.isEmpty(code)) { final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setAllowBackgroundActivityStarts(true); options.setBackgroundActivityStartsAllowed(true); Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION, Uri.parse("android_secret_code://" + code)); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +36 −7 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.os.SystemProperties; import android.provider.Telephony; import android.telephony.AccessNetworkConstants.TransportType; import android.telephony.DataFailCause; import android.telephony.NetworkRegistrationState; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.TelephonyManager; Loading Loading @@ -111,6 +112,9 @@ public class DataConnection extends StateMachine { private static final String NETWORK_TYPE = "MOBILE"; private static final String RAT_NAME_5G = "nr"; private static final String RAT_NAME_EVDO = "evdo"; // The data connection providing default Internet connection will have a higher score of 50. // Other connections will have a slightly lower score of 45. The intention is other connections // will not cause ConnectivityService to tear down default internet connection. For example, Loading Loading @@ -883,6 +887,11 @@ public class DataConnection extends StateMachine { return true; } /** * TCP buffer size config based on the ril technology. There are 6 parameters * read_min, read_default, read_max, write_min, write_default, write_max in the TCP buffer * config string and they are separated by a comma. The unit of these parameters is byte. */ private static final String TCP_BUFFER_SIZES_GPRS = "4092,8760,48000,4096,8760,48000"; private static final String TCP_BUFFER_SIZES_EDGE = "4093,26280,70800,4096,16384,70800"; private static final String TCP_BUFFER_SIZES_UMTS = "58254,349525,1048576,58254,349525,1048576"; Loading @@ -893,7 +902,10 @@ public class DataConnection extends StateMachine { private static final String TCP_BUFFER_SIZES_HSPA = "40778,244668,734003,16777,100663,301990"; private static final String TCP_BUFFER_SIZES_LTE = "524288,1048576,2097152,262144,524288,1048576"; private static final String TCP_BUFFER_SIZES_HSPAP= "122334,734003,2202010,32040,192239,576717"; private static final String TCP_BUFFER_SIZES_HSPAP = "122334,734003,2202010,32040,192239,576717"; private static final String TCP_BUFFER_SIZES_NR = "2097152,6291456,16777216,512000,2097152,8388608"; private void updateTcpBufferSizes(int rilRat) { String sizes = null; Loading @@ -908,7 +920,13 @@ public class DataConnection extends StateMachine { if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0 || rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A || rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B) { ratName = "evdo"; ratName = RAT_NAME_EVDO; } // NR 5G Non-Standalone use LTE cell as the primary cell, the ril technology is LTE in this // case. We use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network. if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE && isNRConnected()) { ratName = RAT_NAME_5G; } // in the form: "ratname:rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max" Loading Loading @@ -956,7 +974,12 @@ public class DataConnection extends StateMachine { break; case ServiceState.RIL_RADIO_TECHNOLOGY_LTE: case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA: // Use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network. if (isNRConnected()) { sizes = TCP_BUFFER_SIZES_NR; } else { sizes = TCP_BUFFER_SIZES_LTE; } break; case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP: sizes = TCP_BUFFER_SIZES_HSPAP; Loading Loading @@ -2799,6 +2822,12 @@ public class DataConnection extends StateMachine { return "{" + toStringSimple() + " mApnContexts=" + mApnContexts + "}"; } /** Check if the device is connected to NR 5G Non-Standalone network. */ private boolean isNRConnected() { return mPhone.getServiceState().getNrStatus() == NetworkRegistrationState.NR_STATUS_CONNECTED; } private void dumpToLog() { dump(null, new PrintWriter(new StringWriter(0)) { @Override Loading src/java/com/android/internal/telephony/metrics/TelephonyEventBuilder.java +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony.metrics; import static com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities; import static com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState; import static com.android.internal.telephony.nano.TelephonyProto.RilDataCall; import static com.android.internal.telephony.nano.TelephonyProto.SimState; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.CarrierIdMatching; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.CarrierKeyChange; Loading @@ -30,6 +31,7 @@ import static com.android.internal.telephony.nano.TelephonyProto.TelephonyServic import static com.android.internal.telephony.nano.TelephonyProto.TelephonySettings; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.util.SparseArray; import com.android.internal.telephony.nano.TelephonyProto.ActiveSubscriptionInfo; Loading @@ -37,6 +39,8 @@ import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.DataSwi import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.OnDemandDataSwitch; import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.Type; import java.util.Arrays; public class TelephonyEventBuilder { private final TelephonyEvent mEvent = new TelephonyEvent(); Loading Loading @@ -147,12 +151,16 @@ public class TelephonyEventBuilder { /** Set and build SIM state change event. */ public TelephonyEventBuilder setSimStateChange(SparseArray<Integer> simStates) { int phoneCount = TelephonyManager.getDefault().getPhoneCount(); mEvent.simState = new int[phoneCount]; Arrays.fill(mEvent.simState, SimState.SIM_STATE_UNKNOWN); mEvent.type = Type.SIM_STATE_CHANGED; mEvent.simState = new int[simStates.size()]; for (int i = 0; i < simStates.size(); i++) { int key = simStates.keyAt(i); if (0 <= key && key < phoneCount) { mEvent.simState[key] = simStates.get(key); } } return this; } Loading src/java/com/android/internal/telephony/uicc/UiccController.java +1 −1 Original line number Diff line number Diff line Loading @@ -824,7 +824,7 @@ public class UiccController extends Handler { // broadcast slot status changed final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setAllowBackgroundActivityStarts(true); options.setBackgroundActivityStartsAllowed(true); Intent intent = new Intent(TelephonyManager.ACTION_SIM_SLOT_STATUS_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); Loading tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class CellIdentityNrTest extends AndroidTestCase { // THEN the get method should return correct value assertThat(cellIdentityNr.getType()).isEqualTo(CellInfo.TYPE_NR); assertThat(cellIdentityNr.getChannelNumber()).isEqualTo(NRARFCN); assertThat(cellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(cellIdentityNr.getPci()).isEqualTo(PCI); assertThat(cellIdentityNr.getTac()).isEqualTo(TAC); assertThat(cellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); Loading Loading @@ -95,7 +95,7 @@ public class CellIdentityNrTest extends AndroidTestCase { // THEN the new object is equal to the old one assertThat(anotherCellIdentityNr).isEqualTo(anotherCellIdentityNr); assertThat(anotherCellIdentityNr.getType()).isEqualTo(CellInfo.TYPE_NR); assertThat(anotherCellIdentityNr.getChannelNumber()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); Loading Loading
src/java/com/android/internal/telephony/Phone.java +1 −1 Original line number Diff line number Diff line Loading @@ -2440,7 +2440,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void sendDialerSpecialCode(String code) { if (!TextUtils.isEmpty(code)) { final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setAllowBackgroundActivityStarts(true); options.setBackgroundActivityStartsAllowed(true); Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION, Uri.parse("android_secret_code://" + code)); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +36 −7 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.os.SystemProperties; import android.provider.Telephony; import android.telephony.AccessNetworkConstants.TransportType; import android.telephony.DataFailCause; import android.telephony.NetworkRegistrationState; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.TelephonyManager; Loading Loading @@ -111,6 +112,9 @@ public class DataConnection extends StateMachine { private static final String NETWORK_TYPE = "MOBILE"; private static final String RAT_NAME_5G = "nr"; private static final String RAT_NAME_EVDO = "evdo"; // The data connection providing default Internet connection will have a higher score of 50. // Other connections will have a slightly lower score of 45. The intention is other connections // will not cause ConnectivityService to tear down default internet connection. For example, Loading Loading @@ -883,6 +887,11 @@ public class DataConnection extends StateMachine { return true; } /** * TCP buffer size config based on the ril technology. There are 6 parameters * read_min, read_default, read_max, write_min, write_default, write_max in the TCP buffer * config string and they are separated by a comma. The unit of these parameters is byte. */ private static final String TCP_BUFFER_SIZES_GPRS = "4092,8760,48000,4096,8760,48000"; private static final String TCP_BUFFER_SIZES_EDGE = "4093,26280,70800,4096,16384,70800"; private static final String TCP_BUFFER_SIZES_UMTS = "58254,349525,1048576,58254,349525,1048576"; Loading @@ -893,7 +902,10 @@ public class DataConnection extends StateMachine { private static final String TCP_BUFFER_SIZES_HSPA = "40778,244668,734003,16777,100663,301990"; private static final String TCP_BUFFER_SIZES_LTE = "524288,1048576,2097152,262144,524288,1048576"; private static final String TCP_BUFFER_SIZES_HSPAP= "122334,734003,2202010,32040,192239,576717"; private static final String TCP_BUFFER_SIZES_HSPAP = "122334,734003,2202010,32040,192239,576717"; private static final String TCP_BUFFER_SIZES_NR = "2097152,6291456,16777216,512000,2097152,8388608"; private void updateTcpBufferSizes(int rilRat) { String sizes = null; Loading @@ -908,7 +920,13 @@ public class DataConnection extends StateMachine { if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0 || rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A || rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B) { ratName = "evdo"; ratName = RAT_NAME_EVDO; } // NR 5G Non-Standalone use LTE cell as the primary cell, the ril technology is LTE in this // case. We use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network. if (rilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE && isNRConnected()) { ratName = RAT_NAME_5G; } // in the form: "ratname:rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max" Loading Loading @@ -956,7 +974,12 @@ public class DataConnection extends StateMachine { break; case ServiceState.RIL_RADIO_TECHNOLOGY_LTE: case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA: // Use NR 5G TCP buffer size when connected to NR 5G Non-Standalone network. if (isNRConnected()) { sizes = TCP_BUFFER_SIZES_NR; } else { sizes = TCP_BUFFER_SIZES_LTE; } break; case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP: sizes = TCP_BUFFER_SIZES_HSPAP; Loading Loading @@ -2799,6 +2822,12 @@ public class DataConnection extends StateMachine { return "{" + toStringSimple() + " mApnContexts=" + mApnContexts + "}"; } /** Check if the device is connected to NR 5G Non-Standalone network. */ private boolean isNRConnected() { return mPhone.getServiceState().getNrStatus() == NetworkRegistrationState.NR_STATUS_CONNECTED; } private void dumpToLog() { dump(null, new PrintWriter(new StringWriter(0)) { @Override Loading
src/java/com/android/internal/telephony/metrics/TelephonyEventBuilder.java +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony.metrics; import static com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities; import static com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState; import static com.android.internal.telephony.nano.TelephonyProto.RilDataCall; import static com.android.internal.telephony.nano.TelephonyProto.SimState; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.CarrierIdMatching; import static com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.CarrierKeyChange; Loading @@ -30,6 +31,7 @@ import static com.android.internal.telephony.nano.TelephonyProto.TelephonyServic import static com.android.internal.telephony.nano.TelephonyProto.TelephonySettings; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.util.SparseArray; import com.android.internal.telephony.nano.TelephonyProto.ActiveSubscriptionInfo; Loading @@ -37,6 +39,8 @@ import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.DataSwi import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.OnDemandDataSwitch; import com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.Type; import java.util.Arrays; public class TelephonyEventBuilder { private final TelephonyEvent mEvent = new TelephonyEvent(); Loading Loading @@ -147,12 +151,16 @@ public class TelephonyEventBuilder { /** Set and build SIM state change event. */ public TelephonyEventBuilder setSimStateChange(SparseArray<Integer> simStates) { int phoneCount = TelephonyManager.getDefault().getPhoneCount(); mEvent.simState = new int[phoneCount]; Arrays.fill(mEvent.simState, SimState.SIM_STATE_UNKNOWN); mEvent.type = Type.SIM_STATE_CHANGED; mEvent.simState = new int[simStates.size()]; for (int i = 0; i < simStates.size(); i++) { int key = simStates.keyAt(i); if (0 <= key && key < phoneCount) { mEvent.simState[key] = simStates.get(key); } } return this; } Loading
src/java/com/android/internal/telephony/uicc/UiccController.java +1 −1 Original line number Diff line number Diff line Loading @@ -824,7 +824,7 @@ public class UiccController extends Handler { // broadcast slot status changed final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setAllowBackgroundActivityStarts(true); options.setBackgroundActivityStartsAllowed(true); Intent intent = new Intent(TelephonyManager.ACTION_SIM_SLOT_STATUS_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); Loading
tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class CellIdentityNrTest extends AndroidTestCase { // THEN the get method should return correct value assertThat(cellIdentityNr.getType()).isEqualTo(CellInfo.TYPE_NR); assertThat(cellIdentityNr.getChannelNumber()).isEqualTo(NRARFCN); assertThat(cellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(cellIdentityNr.getPci()).isEqualTo(PCI); assertThat(cellIdentityNr.getTac()).isEqualTo(TAC); assertThat(cellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); Loading Loading @@ -95,7 +95,7 @@ public class CellIdentityNrTest extends AndroidTestCase { // THEN the new object is equal to the old one assertThat(anotherCellIdentityNr).isEqualTo(anotherCellIdentityNr); assertThat(anotherCellIdentityNr.getType()).isEqualTo(CellInfo.TYPE_NR); assertThat(anotherCellIdentityNr.getChannelNumber()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); Loading