Merge "For NR (non-standalone), use LTE signal strength as primary rule" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6cfdd46d4b
@@ -2528,6 +2528,16 @@ public class CarrierConfigManager {
|
|||||||
public static final String KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT =
|
public static final String KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT =
|
||||||
"parameters_use_for_5g_nr_signal_bar_int";
|
"parameters_use_for_5g_nr_signal_bar_int";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* There are two signal strengths, NR and LTE signal strength, during NR (non-standalone).
|
||||||
|
* Boolean indicating whether to use LTE signal strength as primary during NR (non-standalone).
|
||||||
|
* By default this value is true.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String KEY_SIGNAL_STRENGTH_NR_NSA_USE_LTE_AS_PRIMARY_BOOL =
|
||||||
|
"signal_strength_nr_nsa_use_lte_as_primary_bool";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String array of default bandwidth values per network type.
|
* String array of default bandwidth values per network type.
|
||||||
* The entries should be of form "network_name:downstream,upstream", with values in Kbps.
|
* The entries should be of form "network_name:downstream,upstream", with values in Kbps.
|
||||||
@@ -4095,6 +4105,7 @@ public class CarrierConfigManager {
|
|||||||
});
|
});
|
||||||
sDefaults.putInt(KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT,
|
sDefaults.putInt(KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT,
|
||||||
CellSignalStrengthNr.USE_SSRSRP);
|
CellSignalStrengthNr.USE_SSRSRP);
|
||||||
|
sDefaults.putBoolean(KEY_SIGNAL_STRENGTH_NR_NSA_USE_LTE_AS_PRIMARY_BOOL, true);
|
||||||
sDefaults.putStringArray(KEY_BANDWIDTH_STRING_ARRAY, new String[]{
|
sDefaults.putStringArray(KEY_BANDWIDTH_STRING_ARRAY, new String[]{
|
||||||
"GPRS:24,24", "EDGE:70,18", "UMTS:115,115", "CDMA-IS95A:14,14", "CDMA-IS95B:14,14",
|
"GPRS:24,24", "EDGE:70,18", "UMTS:115,115", "CDMA-IS95A:14,14", "CDMA-IS95B:14,14",
|
||||||
"1xRTT:30,30", "EvDo-rev.0:750,48", "EvDo-rev.A:950,550", "HSDPA:4300,620",
|
"1xRTT:30,30", "EvDo-rev.0:750,48", "EvDo-rev.A:950,550", "HSDPA:4300,620",
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ public class SignalStrength implements Parcelable {
|
|||||||
// Effectively final. Timestamp is set during construction of SignalStrength
|
// Effectively final. Timestamp is set during construction of SignalStrength
|
||||||
private long mTimestampMillis;
|
private long mTimestampMillis;
|
||||||
|
|
||||||
|
private boolean mLteAsPrimaryInNrNsa = true;
|
||||||
|
|
||||||
CellSignalStrengthCdma mCdma;
|
CellSignalStrengthCdma mCdma;
|
||||||
CellSignalStrengthGsm mGsm;
|
CellSignalStrengthGsm mGsm;
|
||||||
CellSignalStrengthWcdma mWcdma;
|
CellSignalStrengthWcdma mWcdma;
|
||||||
@@ -188,6 +190,10 @@ public class SignalStrength implements Parcelable {
|
|||||||
private CellSignalStrength getPrimary() {
|
private CellSignalStrength getPrimary() {
|
||||||
// This behavior is intended to replicate the legacy behavior of getLevel() by prioritizing
|
// This behavior is intended to replicate the legacy behavior of getLevel() by prioritizing
|
||||||
// newer faster RATs for default/for display purposes.
|
// newer faster RATs for default/for display purposes.
|
||||||
|
|
||||||
|
if (mLteAsPrimaryInNrNsa) {
|
||||||
|
if (mLte.isValid()) return mLte;
|
||||||
|
}
|
||||||
if (mNr.isValid()) return mNr;
|
if (mNr.isValid()) return mNr;
|
||||||
if (mLte.isValid()) return mLte;
|
if (mLte.isValid()) return mLte;
|
||||||
if (mCdma.isValid()) return mCdma;
|
if (mCdma.isValid()) return mCdma;
|
||||||
@@ -268,6 +274,10 @@ public class SignalStrength implements Parcelable {
|
|||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public void updateLevel(PersistableBundle cc, ServiceState ss) {
|
public void updateLevel(PersistableBundle cc, ServiceState ss) {
|
||||||
|
if (cc != null) {
|
||||||
|
mLteAsPrimaryInNrNsa = cc.getBoolean(
|
||||||
|
CarrierConfigManager.KEY_SIGNAL_STRENGTH_NR_NSA_USE_LTE_AS_PRIMARY_BOOL, true);
|
||||||
|
}
|
||||||
mCdma.updateLevel(cc, ss);
|
mCdma.updateLevel(cc, ss);
|
||||||
mGsm.updateLevel(cc, ss);
|
mGsm.updateLevel(cc, ss);
|
||||||
mWcdma.updateLevel(cc, ss);
|
mWcdma.updateLevel(cc, ss);
|
||||||
|
|||||||
Reference in New Issue
Block a user