Merge "[PhysicalChannelConfig] Deprecated getChannelNumber and implement relevant API"
This commit is contained in:
@@ -39783,6 +39783,7 @@ package android.telephony {
|
||||
field public static final int BAND_25 = 25; // 0x19
|
||||
field public static final int BAND_257 = 257; // 0x101
|
||||
field public static final int BAND_258 = 258; // 0x102
|
||||
field public static final int BAND_26 = 26; // 0x1a
|
||||
field public static final int BAND_260 = 260; // 0x104
|
||||
field public static final int BAND_261 = 261; // 0x105
|
||||
field public static final int BAND_28 = 28; // 0x1c
|
||||
@@ -39794,10 +39795,12 @@ package android.telephony {
|
||||
field public static final int BAND_39 = 39; // 0x27
|
||||
field public static final int BAND_40 = 40; // 0x28
|
||||
field public static final int BAND_41 = 41; // 0x29
|
||||
field public static final int BAND_46 = 46; // 0x2e
|
||||
field public static final int BAND_48 = 48; // 0x30
|
||||
field public static final int BAND_5 = 5; // 0x5
|
||||
field public static final int BAND_50 = 50; // 0x32
|
||||
field public static final int BAND_51 = 51; // 0x33
|
||||
field public static final int BAND_53 = 53; // 0x35
|
||||
field public static final int BAND_65 = 65; // 0x41
|
||||
field public static final int BAND_66 = 66; // 0x42
|
||||
field public static final int BAND_7 = 7; // 0x7
|
||||
@@ -39823,6 +39826,7 @@ package android.telephony {
|
||||
field public static final int BAND_93 = 93; // 0x5d
|
||||
field public static final int BAND_94 = 94; // 0x5e
|
||||
field public static final int BAND_95 = 95; // 0x5f
|
||||
field public static final int BAND_96 = 96; // 0x60
|
||||
}
|
||||
|
||||
public static final class AccessNetworkConstants.UtranBand {
|
||||
@@ -41334,17 +41338,27 @@ package android.telephony {
|
||||
|
||||
public final class PhysicalChannelConfig implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public int getCellBandwidthDownlink();
|
||||
method public int getChannelNumber();
|
||||
method @IntRange(from=1, to=261) public int getBand();
|
||||
method @IntRange(from=1) public int getCellBandwidthDownlinkKhz();
|
||||
method @IntRange(from=1) public int getCellBandwidthUplinkKhz();
|
||||
method @Deprecated public int getChannelNumber();
|
||||
method public int getConnectionStatus();
|
||||
method @IntRange(from=0) public int getDownlinkChannelNumber();
|
||||
method @IntRange(from=0) public int getDownlinkFrequencyKhz();
|
||||
method public int getNetworkType();
|
||||
method @IntRange(from=0, to=1007) public int getPhysicalCellId();
|
||||
method @IntRange(from=0) public int getUplinkChannelNumber();
|
||||
method @IntRange(from=0) public int getUplinkFrequencyKhz();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field public static final int BAND_UNKNOWN = 0; // 0x0
|
||||
field public static final int CELL_BANDWIDTH_UNKNOWN = 0; // 0x0
|
||||
field public static final int CHANNEL_NUMBER_UNKNOWN = -1; // 0xffffffff
|
||||
field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
|
||||
field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
|
||||
field public static final int CONNECTION_UNKNOWN = -1; // 0xffffffff
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhysicalChannelConfig> CREATOR;
|
||||
field public static final int FREQUENCY_UNKNOWN = -1; // 0xffffffff
|
||||
field public static final int PHYSICAL_CELL_ID_MAXIMUM_VALUE = 1007; // 0x3ef
|
||||
field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff
|
||||
}
|
||||
|
||||
|
||||
@@ -564,8 +564,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mPreciseDataConnectionStates.add(new ArrayMap<>());
|
||||
mBarringInfo.add(i, new BarringInfo());
|
||||
mTelephonyDisplayInfos[i] = null;
|
||||
mPhysicalChannelConfigs.add(i, new PhysicalChannelConfig(
|
||||
PhysicalChannelConfig.CONNECTION_UNKNOWN,0));
|
||||
mPhysicalChannelConfigs.add(i, new PhysicalChannelConfig.Builder().build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,8 +655,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mPreciseDataConnectionStates.add(new ArrayMap<>());
|
||||
mBarringInfo.add(i, new BarringInfo());
|
||||
mTelephonyDisplayInfos[i] = null;
|
||||
mPhysicalChannelConfigs.add(i, new PhysicalChannelConfig(
|
||||
PhysicalChannelConfig.CONNECTION_UNKNOWN,0));
|
||||
mPhysicalChannelConfigs.add(i, new PhysicalChannelConfig.Builder().build());
|
||||
}
|
||||
|
||||
mAppOps = mContext.getSystemService(AppOpsManager.class);
|
||||
|
||||
@@ -18,10 +18,7 @@ package android.telephony;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.SystemApi;
|
||||
import android.hardware.radio.V1_1.GeranBands;
|
||||
import android.hardware.radio.V1_5.AccessNetwork;
|
||||
import android.hardware.radio.V1_5.EutranBands;
|
||||
import android.hardware.radio.V1_5.UtranBands;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -117,52 +114,120 @@ public final class AccessNetworkConstants {
|
||||
* http://www.etsi.org/deliver/etsi_ts/145000_145099/145005/14.00.00_60/ts_145005v140000p.pdf
|
||||
*/
|
||||
public static final class GeranBand {
|
||||
public static final int BAND_T380 = GeranBands.BAND_T380;
|
||||
public static final int BAND_T410 = GeranBands.BAND_T410;
|
||||
public static final int BAND_450 = GeranBands.BAND_450;
|
||||
public static final int BAND_480 = GeranBands.BAND_480;
|
||||
public static final int BAND_710 = GeranBands.BAND_710;
|
||||
public static final int BAND_750 = GeranBands.BAND_750;
|
||||
public static final int BAND_T810 = GeranBands.BAND_T810;
|
||||
public static final int BAND_850 = GeranBands.BAND_850;
|
||||
public static final int BAND_P900 = GeranBands.BAND_P900;
|
||||
public static final int BAND_E900 = GeranBands.BAND_E900;
|
||||
public static final int BAND_R900 = GeranBands.BAND_R900;
|
||||
public static final int BAND_DCS1800 = GeranBands.BAND_DCS1800;
|
||||
public static final int BAND_PCS1900 = GeranBands.BAND_PCS1900;
|
||||
public static final int BAND_ER900 = GeranBands.BAND_ER900;
|
||||
public static final int BAND_T380 = android.hardware.radio.V1_1.GeranBands.BAND_T380;
|
||||
public static final int BAND_T410 = android.hardware.radio.V1_1.GeranBands.BAND_T410;
|
||||
public static final int BAND_450 = android.hardware.radio.V1_1.GeranBands.BAND_450;
|
||||
public static final int BAND_480 = android.hardware.radio.V1_1.GeranBands.BAND_480;
|
||||
public static final int BAND_710 = android.hardware.radio.V1_1.GeranBands.BAND_710;
|
||||
public static final int BAND_750 = android.hardware.radio.V1_1.GeranBands.BAND_750;
|
||||
public static final int BAND_T810 = android.hardware.radio.V1_1.GeranBands.BAND_T810;
|
||||
public static final int BAND_850 = android.hardware.radio.V1_1.GeranBands.BAND_850;
|
||||
public static final int BAND_P900 = android.hardware.radio.V1_1.GeranBands.BAND_P900;
|
||||
public static final int BAND_E900 = android.hardware.radio.V1_1.GeranBands.BAND_E900;
|
||||
public static final int BAND_R900 = android.hardware.radio.V1_1.GeranBands.BAND_R900;
|
||||
public static final int BAND_DCS1800 = android.hardware.radio.V1_1.GeranBands.BAND_DCS1800;
|
||||
public static final int BAND_PCS1900 = android.hardware.radio.V1_1.GeranBands.BAND_PCS1900;
|
||||
public static final int BAND_ER900 = android.hardware.radio.V1_1.GeranBands.BAND_ER900;
|
||||
|
||||
/**
|
||||
* GeranBand
|
||||
*
|
||||
* @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(prefix = {"BAND_"},
|
||||
value = {BAND_T380,
|
||||
BAND_T410,
|
||||
BAND_450,
|
||||
BAND_480,
|
||||
BAND_710,
|
||||
BAND_750,
|
||||
BAND_T810,
|
||||
BAND_850,
|
||||
BAND_P900,
|
||||
BAND_E900,
|
||||
BAND_R900,
|
||||
BAND_DCS1800,
|
||||
BAND_PCS1900,
|
||||
BAND_ER900})
|
||||
|
||||
public @interface GeranBands {}
|
||||
|
||||
/** @hide */
|
||||
private GeranBand() {}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 45.005 Table 2-1 Dynamically mapped ARFCN.
|
||||
* 3GPP TS 45.005 Table 2-2 Fixed designation of ARFCN.
|
||||
* @hide
|
||||
*/
|
||||
enum GeranBandArfcnFrequency {
|
||||
|
||||
// Dynamically mapped ARFCN
|
||||
// GERAN_ARFCN_FREQUENCY_BAND_T380(GeranBand.BAND_T380, 380.2, 0),
|
||||
// GERAN_ARFCN_FREQUENCY_BAND_T410(GeranBand.BAND_T410, 410.2, 0),
|
||||
// GERAN_ARFCN_FREQUENCY_BAND_710(GeranBand.BAND_710, 698, 0),
|
||||
// GERAN_ARFCN_FREQUENCY_BAND_750(GeranBand.BAND_750, 747, 438, 30),
|
||||
// GERAN_ARFCN_FREQUENCY_BAND_T810(GeranBand.BAND_T810, 806, 350),
|
||||
// Fixed designation of ARFCN
|
||||
GERAN_ARFCN_FREQUENCY_BAND_450(GeranBand.BAND_450, 450600, 259, 259, 293, 10),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_480(GeranBand.BAND_480, 479000, 306, 306, 340, 10),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_850(GeranBand.BAND_850, 824200, 128, 128, 251, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_DCS1800(GeranBand.BAND_DCS1800, 1710200, 512, 512, 885, 95),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_PCS1900(GeranBand.BAND_PCS1900, 1850200, 512, 512, 810, 80),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_E900_1(GeranBand.BAND_E900, 890000, 0, 0, 124, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_E900_2(GeranBand.BAND_E900, 890000, 1024, 975, 1023, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_R900_1(GeranBand.BAND_R900, 890000, 0, 0, 124, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_R900_2(GeranBand.BAND_R900, 890000, 1024, 955, 1023, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_P900(GeranBand.BAND_P900, 890000, 0, 1, 124, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_ER900_1(GeranBand.BAND_ER900, 890000, 0, 0, 124, 45),
|
||||
GERAN_ARFCN_FREQUENCY_BAND_ER900_2(GeranBand.BAND_ER900, 890000, 1024, 940, 1023, 1024);
|
||||
|
||||
GeranBandArfcnFrequency(int band, int uplinkFrequencyFirstKhz, int arfcnOffset,
|
||||
int arfcnRangeFirst, int arfcnRangeLast, int downlinkOffset) {
|
||||
this.band = band;
|
||||
this.uplinkFrequencyFirst = uplinkFrequencyFirstKhz;
|
||||
this.arfcnOffset = arfcnOffset;
|
||||
this.arfcnRangeFirst = arfcnRangeFirst;
|
||||
this.arfcnRangeLast = arfcnRangeLast;
|
||||
this.downlinkOffset = downlinkOffset;
|
||||
}
|
||||
|
||||
int band;
|
||||
int uplinkFrequencyFirst;
|
||||
int arfcnOffset;
|
||||
int arfcnRangeFirst;
|
||||
int arfcnRangeLast;
|
||||
int downlinkOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency bands for UTRAN.
|
||||
* http://www.etsi.org/deliver/etsi_ts/125100_125199/125104/13.03.00_60/ts_125104v130p.pdf
|
||||
*/
|
||||
public static final class UtranBand {
|
||||
public static final int BAND_1 = UtranBands.BAND_1;
|
||||
public static final int BAND_2 = UtranBands.BAND_2;
|
||||
public static final int BAND_3 = UtranBands.BAND_3;
|
||||
public static final int BAND_4 = UtranBands.BAND_4;
|
||||
public static final int BAND_5 = UtranBands.BAND_5;
|
||||
public static final int BAND_6 = UtranBands.BAND_6;
|
||||
public static final int BAND_7 = UtranBands.BAND_7;
|
||||
public static final int BAND_8 = UtranBands.BAND_8;
|
||||
public static final int BAND_9 = UtranBands.BAND_9;
|
||||
public static final int BAND_10 = UtranBands.BAND_10;
|
||||
public static final int BAND_11 = UtranBands.BAND_11;
|
||||
public static final int BAND_12 = UtranBands.BAND_12;
|
||||
public static final int BAND_13 = UtranBands.BAND_13;
|
||||
public static final int BAND_14 = UtranBands.BAND_14;
|
||||
public static final int BAND_1 = android.hardware.radio.V1_5.UtranBands.BAND_1;
|
||||
public static final int BAND_2 = android.hardware.radio.V1_5.UtranBands.BAND_2;
|
||||
public static final int BAND_3 = android.hardware.radio.V1_5.UtranBands.BAND_3;
|
||||
public static final int BAND_4 = android.hardware.radio.V1_5.UtranBands.BAND_4;
|
||||
public static final int BAND_5 = android.hardware.radio.V1_5.UtranBands.BAND_5;
|
||||
public static final int BAND_6 = android.hardware.radio.V1_5.UtranBands.BAND_6;
|
||||
public static final int BAND_7 = android.hardware.radio.V1_5.UtranBands.BAND_7;
|
||||
public static final int BAND_8 = android.hardware.radio.V1_5.UtranBands.BAND_8;
|
||||
public static final int BAND_9 = android.hardware.radio.V1_5.UtranBands.BAND_9;
|
||||
public static final int BAND_10 = android.hardware.radio.V1_5.UtranBands.BAND_10;
|
||||
public static final int BAND_11 = android.hardware.radio.V1_5.UtranBands.BAND_11;
|
||||
public static final int BAND_12 = android.hardware.radio.V1_5.UtranBands.BAND_12;
|
||||
public static final int BAND_13 = android.hardware.radio.V1_5.UtranBands.BAND_13;
|
||||
public static final int BAND_14 = android.hardware.radio.V1_5.UtranBands.BAND_14;
|
||||
// band 15, 16, 17, 18 are reserved
|
||||
public static final int BAND_19 = UtranBands.BAND_19;
|
||||
public static final int BAND_20 = UtranBands.BAND_20;
|
||||
public static final int BAND_21 = UtranBands.BAND_21;
|
||||
public static final int BAND_22 = UtranBands.BAND_22;
|
||||
public static final int BAND_19 = android.hardware.radio.V1_5.UtranBands.BAND_19;
|
||||
public static final int BAND_20 = android.hardware.radio.V1_5.UtranBands.BAND_20;
|
||||
public static final int BAND_21 = android.hardware.radio.V1_5.UtranBands.BAND_21;
|
||||
public static final int BAND_22 = android.hardware.radio.V1_5.UtranBands.BAND_22;
|
||||
// band 23, 24 are reserved
|
||||
public static final int BAND_25 = UtranBands.BAND_25;
|
||||
public static final int BAND_26 = UtranBands.BAND_26;
|
||||
public static final int BAND_25 = android.hardware.radio.V1_5.UtranBands.BAND_25;
|
||||
public static final int BAND_26 = android.hardware.radio.V1_5.UtranBands.BAND_26;
|
||||
|
||||
// Frequency bands for TD-SCDMA. Defined in 3GPP TS 25.102, Table 5.2.
|
||||
|
||||
@@ -171,114 +236,422 @@ public final class AccessNetworkConstants {
|
||||
* 1900 - 1920 MHz: Uplink and downlink transmission
|
||||
* 2010 - 2025 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_A = UtranBands.BAND_A;
|
||||
public static final int BAND_A = android.hardware.radio.V1_5.UtranBands.BAND_A;
|
||||
|
||||
/**
|
||||
* Band B
|
||||
* 1850 - 1910 MHz: Uplink and downlink transmission
|
||||
* 1930 - 1990 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_B = UtranBands.BAND_B;
|
||||
public static final int BAND_B = android.hardware.radio.V1_5.UtranBands.BAND_B;
|
||||
|
||||
/**
|
||||
* Band C
|
||||
* 1910 - 1930 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_C = UtranBands.BAND_C;
|
||||
public static final int BAND_C = android.hardware.radio.V1_5.UtranBands.BAND_C;
|
||||
|
||||
/**
|
||||
* Band D
|
||||
* 2570 - 2620 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_D = UtranBands.BAND_D;
|
||||
public static final int BAND_D = android.hardware.radio.V1_5.UtranBands.BAND_D;
|
||||
|
||||
/**
|
||||
* Band E
|
||||
* 2300—2400 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_E = UtranBands.BAND_E;
|
||||
public static final int BAND_E = android.hardware.radio.V1_5.UtranBands.BAND_E;
|
||||
|
||||
/**
|
||||
* Band F
|
||||
* 1880 - 1920 MHz: Uplink and downlink transmission
|
||||
*/
|
||||
public static final int BAND_F = UtranBands.BAND_F;
|
||||
public static final int BAND_F = android.hardware.radio.V1_5.UtranBands.BAND_F;
|
||||
|
||||
/**
|
||||
* UtranBand
|
||||
*
|
||||
* @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(prefix = {"BAND_"},
|
||||
value = {BAND_1,
|
||||
BAND_2,
|
||||
BAND_3,
|
||||
BAND_4,
|
||||
BAND_5,
|
||||
BAND_6,
|
||||
BAND_7,
|
||||
BAND_8,
|
||||
BAND_9,
|
||||
BAND_10,
|
||||
BAND_11,
|
||||
BAND_12,
|
||||
BAND_13,
|
||||
BAND_14,
|
||||
BAND_19,
|
||||
BAND_20,
|
||||
BAND_21,
|
||||
BAND_22,
|
||||
BAND_25,
|
||||
BAND_26,
|
||||
BAND_A,
|
||||
BAND_B,
|
||||
BAND_C,
|
||||
BAND_D,
|
||||
BAND_E,
|
||||
BAND_F})
|
||||
|
||||
public @interface UtranBands {}
|
||||
|
||||
/** @hide */
|
||||
private UtranBand() {}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 25.101, Table 5.1 UARFCN definition (general)
|
||||
* 3GPP TS 25.102, Table 5.2 UTRA Absolute Radio Frequency Channel Number 1.28 Mcps TDD Option.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
enum UtranBandArfcnFrequency {
|
||||
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_1(UtranBand.BAND_1, 0, 10562, 10838, 0, 9612, 9888),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_2(UtranBand.BAND_2, 0, 9662, 9938, 0, 9262, 9538),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_3(UtranBand.BAND_3, 1575000, 1162, 1513, 1525000, 937, 1288),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_4(UtranBand.BAND_4, 1805000, 1537, 1738, 1450000, 1312, 1513),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_5(UtranBand.BAND_5, 0, 4357, 4458, 0, 4132, 4233),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_6(UtranBand.BAND_6, 0, 4387, 4413, 0, 4162, 4188),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_7(UtranBand.BAND_7, 2175000, 2237, 2563, 2100000, 2012, 2338),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_8(UtranBand.BAND_8, 340000, 2937, 3088, 340000, 2712, 2863),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_9(UtranBand.BAND_9, 0, 9327, 9837, 0, 8762, 8912),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_10(UtranBand.BAND_10, 1490000, 3112, 3388, 1135000, 2887, 3163),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_11(UtranBand.BAND_11, 736000, 3712, 3787, 733000, 3487, 3562),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_12(UtranBand.BAND_12, -37000, 3842, 3903, -22000, 3617, 3678),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_13(UtranBand.BAND_13, -55000, 4017, 4043, 21000, 3792, 3818),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_14(UtranBand.BAND_14, -63000, 4117, 4143, 12000, 3892, 3918),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_19(UtranBand.BAND_19, 735000, 712, 763, 770000, 312, 363),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_20(UtranBand.BAND_20, -109000, 4512, 4638, -23000, 4287, 4413),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_21(UtranBand.BAND_21, 1326000, 862, 912, 1358000, 462, 512),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_22(UtranBand.BAND_22, 2580000, 4662, 5038, 2525000, 4437, 4813),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_25(UtranBand.BAND_25, 910000, 5112, 5413, 875000, 4887, 5188),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_A(UtranBand.BAND_A, 0, 10054, 10121, 0, 9504, 9596),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_B(UtranBand.BAND_B, 0, 9654, 9946, 0, 9254, 9546),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_C(UtranBand.BAND_C, 0, 0, 0, 0, 9554, 9646),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_D(UtranBand.BAND_D, 0, 0, 0, 0, 12854, 13096),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_E(UtranBand.BAND_E, 0, 0, 0, 0, 11504, 11996),
|
||||
UTRAN_ARFCN_FREQUENCY_BAND_F(UtranBand.BAND_F, 0, 0, 0, 0, 9404, 9596);
|
||||
|
||||
UtranBandArfcnFrequency(int band, int downlinkOffsetKhz, int downlinkRangeFirst,
|
||||
int downlinkRangeLast, int uplinkOffsetKhz, int uplinkRangeFirst,
|
||||
int uplinkRangeLast) {
|
||||
this.band = band;
|
||||
this.downlinkOffset = downlinkOffsetKhz;
|
||||
this.downlinkRangeFirst = downlinkRangeFirst;
|
||||
this.downlinkRangeLast = downlinkRangeLast;
|
||||
this.uplinkOffset = uplinkOffsetKhz;
|
||||
this.uplinkRangeFirst = uplinkRangeFirst;
|
||||
this.uplinkRangeLast = uplinkRangeLast;
|
||||
}
|
||||
|
||||
int band;
|
||||
int downlinkOffset;
|
||||
int downlinkRangeFirst;
|
||||
int downlinkRangeLast;
|
||||
int uplinkOffset;
|
||||
int uplinkRangeFirst;
|
||||
int uplinkRangeLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency bands for EUTRAN.
|
||||
* 3GPP TS 36.101, Version 16.4.0, Table 5.5: Operating bands
|
||||
* https://www.etsi.org/deliver/etsi_ts/136100_136199/136101/15.09.00_60/ts_136101v150900p.pdf
|
||||
*/
|
||||
public static final class EutranBand {
|
||||
public static final int BAND_1 = EutranBands.BAND_1;
|
||||
public static final int BAND_2 = EutranBands.BAND_2;
|
||||
public static final int BAND_3 = EutranBands.BAND_3;
|
||||
public static final int BAND_4 = EutranBands.BAND_4;
|
||||
public static final int BAND_5 = EutranBands.BAND_5;
|
||||
public static final int BAND_6 = EutranBands.BAND_6;
|
||||
public static final int BAND_7 = EutranBands.BAND_7;
|
||||
public static final int BAND_8 = EutranBands.BAND_8;
|
||||
public static final int BAND_9 = EutranBands.BAND_9;
|
||||
public static final int BAND_10 = EutranBands.BAND_10;
|
||||
public static final int BAND_11 = EutranBands.BAND_11;
|
||||
public static final int BAND_12 = EutranBands.BAND_12;
|
||||
public static final int BAND_13 = EutranBands.BAND_13;
|
||||
public static final int BAND_14 = EutranBands.BAND_14;
|
||||
public static final int BAND_17 = EutranBands.BAND_17;
|
||||
public static final int BAND_18 = EutranBands.BAND_18;
|
||||
public static final int BAND_19 = EutranBands.BAND_19;
|
||||
public static final int BAND_20 = EutranBands.BAND_20;
|
||||
public static final int BAND_21 = EutranBands.BAND_21;
|
||||
public static final int BAND_22 = EutranBands.BAND_22;
|
||||
public static final int BAND_23 = EutranBands.BAND_23;
|
||||
public static final int BAND_24 = EutranBands.BAND_24;
|
||||
public static final int BAND_25 = EutranBands.BAND_25;
|
||||
public static final int BAND_26 = EutranBands.BAND_26;
|
||||
public static final int BAND_27 = EutranBands.BAND_27;
|
||||
public static final int BAND_28 = EutranBands.BAND_28;
|
||||
public static final int BAND_30 = EutranBands.BAND_30;
|
||||
public static final int BAND_31 = EutranBands.BAND_31;
|
||||
public static final int BAND_33 = EutranBands.BAND_33;
|
||||
public static final int BAND_34 = EutranBands.BAND_34;
|
||||
public static final int BAND_35 = EutranBands.BAND_35;
|
||||
public static final int BAND_36 = EutranBands.BAND_36;
|
||||
public static final int BAND_37 = EutranBands.BAND_37;
|
||||
public static final int BAND_38 = EutranBands.BAND_38;
|
||||
public static final int BAND_39 = EutranBands.BAND_39;
|
||||
public static final int BAND_40 = EutranBands.BAND_40;
|
||||
public static final int BAND_41 = EutranBands.BAND_41;
|
||||
public static final int BAND_42 = EutranBands.BAND_42;
|
||||
public static final int BAND_43 = EutranBands.BAND_43;
|
||||
public static final int BAND_44 = EutranBands.BAND_44;
|
||||
public static final int BAND_45 = EutranBands.BAND_45;
|
||||
public static final int BAND_46 = EutranBands.BAND_46;
|
||||
public static final int BAND_47 = EutranBands.BAND_47;
|
||||
public static final int BAND_48 = EutranBands.BAND_48;
|
||||
public static final int BAND_49 = EutranBands.BAND_49;
|
||||
public static final int BAND_50 = EutranBands.BAND_50;
|
||||
public static final int BAND_51 = EutranBands.BAND_51;
|
||||
public static final int BAND_52 = EutranBands.BAND_52;
|
||||
public static final int BAND_53 = EutranBands.BAND_53;
|
||||
public static final int BAND_65 = EutranBands.BAND_65;
|
||||
public static final int BAND_66 = EutranBands.BAND_66;
|
||||
public static final int BAND_68 = EutranBands.BAND_68;
|
||||
public static final int BAND_70 = EutranBands.BAND_70;
|
||||
public static final int BAND_71 = EutranBands.BAND_71;
|
||||
public static final int BAND_72 = EutranBands.BAND_72;
|
||||
public static final int BAND_73 = EutranBands.BAND_73;
|
||||
public static final int BAND_74 = EutranBands.BAND_74;
|
||||
public static final int BAND_85 = EutranBands.BAND_85;
|
||||
public static final int BAND_87 = EutranBands.BAND_87;
|
||||
public static final int BAND_88 = EutranBands.BAND_88;
|
||||
public static final int BAND_1 = android.hardware.radio.V1_5.EutranBands.BAND_1;
|
||||
public static final int BAND_2 = android.hardware.radio.V1_5.EutranBands.BAND_2;
|
||||
public static final int BAND_3 = android.hardware.radio.V1_5.EutranBands.BAND_3;
|
||||
public static final int BAND_4 = android.hardware.radio.V1_5.EutranBands.BAND_4;
|
||||
public static final int BAND_5 = android.hardware.radio.V1_5.EutranBands.BAND_5;
|
||||
public static final int BAND_6 = android.hardware.radio.V1_5.EutranBands.BAND_6;
|
||||
public static final int BAND_7 = android.hardware.radio.V1_5.EutranBands.BAND_7;
|
||||
public static final int BAND_8 = android.hardware.radio.V1_5.EutranBands.BAND_8;
|
||||
public static final int BAND_9 = android.hardware.radio.V1_5.EutranBands.BAND_9;
|
||||
public static final int BAND_10 = android.hardware.radio.V1_5.EutranBands.BAND_10;
|
||||
public static final int BAND_11 = android.hardware.radio.V1_5.EutranBands.BAND_11;
|
||||
public static final int BAND_12 = android.hardware.radio.V1_5.EutranBands.BAND_12;
|
||||
public static final int BAND_13 = android.hardware.radio.V1_5.EutranBands.BAND_13;
|
||||
public static final int BAND_14 = android.hardware.radio.V1_5.EutranBands.BAND_14;
|
||||
public static final int BAND_17 = android.hardware.radio.V1_5.EutranBands.BAND_17;
|
||||
public static final int BAND_18 = android.hardware.radio.V1_5.EutranBands.BAND_18;
|
||||
public static final int BAND_19 = android.hardware.radio.V1_5.EutranBands.BAND_19;
|
||||
public static final int BAND_20 = android.hardware.radio.V1_5.EutranBands.BAND_20;
|
||||
public static final int BAND_21 = android.hardware.radio.V1_5.EutranBands.BAND_21;
|
||||
public static final int BAND_22 = android.hardware.radio.V1_5.EutranBands.BAND_22;
|
||||
public static final int BAND_23 = android.hardware.radio.V1_5.EutranBands.BAND_23;
|
||||
public static final int BAND_24 = android.hardware.radio.V1_5.EutranBands.BAND_24;
|
||||
public static final int BAND_25 = android.hardware.radio.V1_5.EutranBands.BAND_25;
|
||||
public static final int BAND_26 = android.hardware.radio.V1_5.EutranBands.BAND_26;
|
||||
public static final int BAND_27 = android.hardware.radio.V1_5.EutranBands.BAND_27;
|
||||
public static final int BAND_28 = android.hardware.radio.V1_5.EutranBands.BAND_28;
|
||||
public static final int BAND_30 = android.hardware.radio.V1_5.EutranBands.BAND_30;
|
||||
public static final int BAND_31 = android.hardware.radio.V1_5.EutranBands.BAND_31;
|
||||
public static final int BAND_33 = android.hardware.radio.V1_5.EutranBands.BAND_33;
|
||||
public static final int BAND_34 = android.hardware.radio.V1_5.EutranBands.BAND_34;
|
||||
public static final int BAND_35 = android.hardware.radio.V1_5.EutranBands.BAND_35;
|
||||
public static final int BAND_36 = android.hardware.radio.V1_5.EutranBands.BAND_36;
|
||||
public static final int BAND_37 = android.hardware.radio.V1_5.EutranBands.BAND_37;
|
||||
public static final int BAND_38 = android.hardware.radio.V1_5.EutranBands.BAND_38;
|
||||
public static final int BAND_39 = android.hardware.radio.V1_5.EutranBands.BAND_39;
|
||||
public static final int BAND_40 = android.hardware.radio.V1_5.EutranBands.BAND_40;
|
||||
public static final int BAND_41 = android.hardware.radio.V1_5.EutranBands.BAND_41;
|
||||
public static final int BAND_42 = android.hardware.radio.V1_5.EutranBands.BAND_42;
|
||||
public static final int BAND_43 = android.hardware.radio.V1_5.EutranBands.BAND_43;
|
||||
public static final int BAND_44 = android.hardware.radio.V1_5.EutranBands.BAND_44;
|
||||
public static final int BAND_45 = android.hardware.radio.V1_5.EutranBands.BAND_45;
|
||||
public static final int BAND_46 = android.hardware.radio.V1_5.EutranBands.BAND_46;
|
||||
public static final int BAND_47 = android.hardware.radio.V1_5.EutranBands.BAND_47;
|
||||
public static final int BAND_48 = android.hardware.radio.V1_5.EutranBands.BAND_48;
|
||||
public static final int BAND_49 = android.hardware.radio.V1_5.EutranBands.BAND_49;
|
||||
public static final int BAND_50 = android.hardware.radio.V1_5.EutranBands.BAND_50;
|
||||
public static final int BAND_51 = android.hardware.radio.V1_5.EutranBands.BAND_51;
|
||||
public static final int BAND_52 = android.hardware.radio.V1_5.EutranBands.BAND_52;
|
||||
public static final int BAND_53 = android.hardware.radio.V1_5.EutranBands.BAND_53;
|
||||
public static final int BAND_65 = android.hardware.radio.V1_5.EutranBands.BAND_65;
|
||||
public static final int BAND_66 = android.hardware.radio.V1_5.EutranBands.BAND_66;
|
||||
public static final int BAND_68 = android.hardware.radio.V1_5.EutranBands.BAND_68;
|
||||
public static final int BAND_70 = android.hardware.radio.V1_5.EutranBands.BAND_70;
|
||||
public static final int BAND_71 = android.hardware.radio.V1_5.EutranBands.BAND_71;
|
||||
public static final int BAND_72 = android.hardware.radio.V1_5.EutranBands.BAND_72;
|
||||
public static final int BAND_73 = android.hardware.radio.V1_5.EutranBands.BAND_73;
|
||||
public static final int BAND_74 = android.hardware.radio.V1_5.EutranBands.BAND_74;
|
||||
public static final int BAND_85 = android.hardware.radio.V1_5.EutranBands.BAND_85;
|
||||
public static final int BAND_87 = android.hardware.radio.V1_5.EutranBands.BAND_87;
|
||||
public static final int BAND_88 = android.hardware.radio.V1_5.EutranBands.BAND_88;
|
||||
|
||||
/**
|
||||
* EutranBands
|
||||
*
|
||||
* @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(prefix = {"BAND_"},
|
||||
value = {BAND_1,
|
||||
BAND_2,
|
||||
BAND_3,
|
||||
BAND_4,
|
||||
BAND_5,
|
||||
BAND_6,
|
||||
BAND_7,
|
||||
BAND_8,
|
||||
BAND_9,
|
||||
BAND_10,
|
||||
BAND_11,
|
||||
BAND_12,
|
||||
BAND_13,
|
||||
BAND_14,
|
||||
BAND_17,
|
||||
BAND_18,
|
||||
BAND_19,
|
||||
BAND_20,
|
||||
BAND_21,
|
||||
BAND_22,
|
||||
BAND_23,
|
||||
BAND_24,
|
||||
BAND_25,
|
||||
BAND_26,
|
||||
BAND_27,
|
||||
BAND_28,
|
||||
BAND_30,
|
||||
BAND_31,
|
||||
BAND_33,
|
||||
BAND_34,
|
||||
BAND_35,
|
||||
BAND_36,
|
||||
BAND_37,
|
||||
BAND_38,
|
||||
BAND_39,
|
||||
BAND_40,
|
||||
BAND_41,
|
||||
BAND_42,
|
||||
BAND_43,
|
||||
BAND_44,
|
||||
BAND_45,
|
||||
BAND_46,
|
||||
BAND_47,
|
||||
BAND_48,
|
||||
BAND_49,
|
||||
BAND_50,
|
||||
BAND_51,
|
||||
BAND_52,
|
||||
BAND_53,
|
||||
BAND_65,
|
||||
BAND_66,
|
||||
BAND_68,
|
||||
BAND_70,
|
||||
BAND_71,
|
||||
BAND_72,
|
||||
BAND_73,
|
||||
BAND_74,
|
||||
BAND_85,
|
||||
BAND_87,
|
||||
BAND_88})
|
||||
|
||||
public @interface EutranBands {}
|
||||
|
||||
/** @hide */
|
||||
private EutranBand() {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 36.101 Table 5.7.3-1 E-UTRA channel numbers.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
enum EutranBandArfcnFrequency {
|
||||
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_1(
|
||||
EutranBand.BAND_1, 2110000, 0, 599, 1920000, 18800, 18599),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_2(
|
||||
EutranBand.BAND_2, 1930000, 600, 1199, 1850000, 18600, 19199),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_3(
|
||||
EutranBand.BAND_3, 1805000, 1200, 1949, 1710000, 19200, 19949),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_4(
|
||||
EutranBand.BAND_4, 2110000, 1950, 2399, 1710000, 19950, 20399),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_5(
|
||||
EutranBand.BAND_5, 869000, 2400, 2649, 824000, 20400, 20649),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_6(
|
||||
EutranBand.BAND_6, 875000, 2650, 2749, 830000, 20650, 20749),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_7(
|
||||
EutranBand.BAND_7, 2620000, 2750, 3449, 2500000, 20750, 21449),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_8(
|
||||
EutranBand.BAND_8, 925000, 3450, 3799, 880000, 21450, 21799),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_9(
|
||||
EutranBand.BAND_9, 1844900, 3800, 4149, 1749900, 21800, 22149),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_10(
|
||||
EutranBand.BAND_10, 2110000, 4150, 4749, 1710000, 22150, 22749),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_11(
|
||||
EutranBand.BAND_11, 1475900, 4750, 4949, 1427900, 22750, 22949),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_12(
|
||||
EutranBand.BAND_12, 729000, 5010, 5179, 699000, 23010, 23179),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_13(
|
||||
EutranBand.BAND_13, 746000, 5180, 5279, 777000, 23180, 23279),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_14(
|
||||
EutranBand.BAND_14, 758000, 5280, 5379, 788000, 23230, 23379),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_17(
|
||||
EutranBand.BAND_17, 734000, 5730, 5849, 704000, 23730, 23849),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_18(
|
||||
EutranBand.BAND_18, 860000, 5850, 5999, 815000, 23850, 23999),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_19(
|
||||
EutranBand.BAND_19, 875000, 6000, 6149, 830000, 24000, 24149),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_20(
|
||||
EutranBand.BAND_20, 791000, 6150, 6449, 832000, 24150, 24449),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_21(
|
||||
EutranBand.BAND_21, 1495900, 6450, 6599, 1447900, 24450, 24599),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_22(
|
||||
EutranBand.BAND_22, 3510000, 6600, 7399, 3410000, 24600, 25399),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_23(
|
||||
EutranBand.BAND_23, 2180000, 7500, 7699, 2000000, 25500, 25699),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_24(
|
||||
EutranBand.BAND_24, 1525000, 7700, 8039, 1626500, 25700, 26039),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_25(
|
||||
EutranBand.BAND_25, 1930000, 8040, 8689, 1850000, 26040, 26689),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_26(
|
||||
EutranBand.BAND_26, 859000, 8690, 9039, 814000, 26690, 27039),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_27(
|
||||
EutranBand.BAND_27, 852000, 9040, 9209, 807000, 27040, 27209),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_28(
|
||||
EutranBand.BAND_28, 758000, 9210, 9659, 703000, 27210, 27659),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_30(
|
||||
EutranBand.BAND_30, 2350000, 9770, 9869, 2305000, 27660, 27759),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_31(
|
||||
EutranBand.BAND_31, 462500, 9870, 9919, 452500, 27760, 27809),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_33(
|
||||
EutranBand.BAND_33, 1900000, 36000, 36199, 1900000, 36000, 36199),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_34(
|
||||
EutranBand.BAND_34, 2010000, 36200, 36349, 2010000, 36200, 36349),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_35(
|
||||
EutranBand.BAND_35, 1850000, 36350, 36949, 1850000, 36350, 36949),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_36(
|
||||
EutranBand.BAND_36, 1930000, 36950, 37549, 1930000, 36950, 37549),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_37(
|
||||
EutranBand.BAND_37, 1910000, 37550, 37749, 1910000, 37550, 37749),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_38(
|
||||
EutranBand.BAND_38, 2570000, 37750, 38249, 2570000, 37750, 38249),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_39(
|
||||
EutranBand.BAND_39, 1880000, 38250, 38649, 1880000, 38250, 38649),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_40(
|
||||
EutranBand.BAND_40, 2300000, 38650, 39649, 2300000, 38650, 39649),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_41(
|
||||
EutranBand.BAND_41, 2496000, 39650, 41589, 2496000, 39650, 41589),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_42(
|
||||
EutranBand.BAND_42, 3400000, 41950, 43589, 3400000, 41950, 43589),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_43(
|
||||
EutranBand.BAND_43, 3600000, 43950, 45589, 3600000, 43950, 45589),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_44(
|
||||
EutranBand.BAND_44, 703000, 45590, 46589, 703000, 45590, 46589),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_45(
|
||||
EutranBand.BAND_45, 1447000, 46590, 46789, 1447000, 46590, 46789),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_46(
|
||||
EutranBand.BAND_46, 5150000, 46790, 54539, 5150000, 46790, 54539),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_47(
|
||||
EutranBand.BAND_47, 5855000, 54540, 55239, 5855000, 54540, 55239),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_48(
|
||||
EutranBand.BAND_48, 3550000, 55240, 56739, 3550000, 55240, 56739),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_49(
|
||||
EutranBand.BAND_49, 3550000, 56740, 58239, 3550000, 56740, 58239),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_50(
|
||||
EutranBand.BAND_50, 1432000, 58240, 59089, 1432000, 58240, 59089),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_51(
|
||||
EutranBand.BAND_51, 1427000, 59090, 59139, 1427000, 59090, 59139),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_52(
|
||||
EutranBand.BAND_52, 3300000, 59140, 60139, 3300000, 59140, 60139),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_53(
|
||||
EutranBand.BAND_53, 2483500, 60140, 60254, 2483500, 60140, 60254),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_65(
|
||||
EutranBand.BAND_65, 2110000, 65536, 66435, 1920000, 131072, 131971),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_66(
|
||||
EutranBand.BAND_66, 2110000, 66436, 67335, 1710000, 131972, 132671),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_68(
|
||||
EutranBand.BAND_68, 753000, 67536, 67835, 698000, 132672, 132971),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_70(
|
||||
EutranBand.BAND_70, 1995000, 68336, 68585, 1695000, 132972, 133121),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_71(
|
||||
EutranBand.BAND_71, 617000, 68586, 68935, 663000, 133122, 133471),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_72(
|
||||
EutranBand.BAND_72, 461000, 68936, 68985, 451000, 133472, 133521),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_73(
|
||||
EutranBand.BAND_73, 460000, 68986, 69035, 450000, 133522, 133571),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_74(
|
||||
EutranBand.BAND_74, 1475000, 69036, 69465, 1427000, 133572, 134001),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_85(
|
||||
EutranBand.BAND_85, 728000, 70366, 70545, 698000, 134002, 134181),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_87(
|
||||
EutranBand.BAND_87, 420000, 70546, 70595, 410000, 134182, 134231),
|
||||
EUTRAN_ARFCN_FREQUENCY_BAND_88(
|
||||
EutranBand.BAND_88, 422000, 70596, 70645, 412000, 134231, 134280);
|
||||
|
||||
EutranBandArfcnFrequency(int band, int downlinkLowKhz, int downlinkOffset,
|
||||
int downlinkRange, int uplinkLowKhz, int uplinkOffset,
|
||||
int uplinkRange) {
|
||||
this.band = band;
|
||||
this.downlinkLowKhz = downlinkLowKhz;
|
||||
this.downlinkOffset = downlinkOffset;
|
||||
this.uplinkLowKhz = uplinkLowKhz;
|
||||
this.uplinkOffset = uplinkOffset;
|
||||
this.downlinkRange = downlinkRange;
|
||||
this.uplinkRange = uplinkRange;
|
||||
}
|
||||
|
||||
int band;
|
||||
int downlinkLowKhz;
|
||||
int downlinkOffset;
|
||||
int uplinkLowKhz;
|
||||
int uplinkOffset;
|
||||
int downlinkRange;
|
||||
int uplinkRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency bands for CDMA2000.
|
||||
* http://www.3gpp2.org/Public_html/Specs/C.S0057-E_v1.0_Bandclass_Specification.pdf
|
||||
@@ -320,7 +693,7 @@ public final class AccessNetworkConstants {
|
||||
* https://www.etsi.org/deliver/etsi_ts/138100_138199/13810102/15.08.00_60/ts_13810102v150800p.pdf
|
||||
*/
|
||||
public static final class NgranBands {
|
||||
/** 3GPP TS 38.101-1, Version 16.2.0, Table 5.2-1: FR1 bands */
|
||||
/** 3GPP TS 38.101-1, Version 16.5.0, Table 5.2-1: FR1 bands */
|
||||
public static final int BAND_1 = android.hardware.radio.V1_5.NgranBands.BAND_1;
|
||||
public static final int BAND_2 = android.hardware.radio.V1_5.NgranBands.BAND_2;
|
||||
public static final int BAND_3 = android.hardware.radio.V1_5.NgranBands.BAND_3;
|
||||
@@ -332,6 +705,7 @@ public final class AccessNetworkConstants {
|
||||
public static final int BAND_18 = android.hardware.radio.V1_5.NgranBands.BAND_18;
|
||||
public static final int BAND_20 = android.hardware.radio.V1_5.NgranBands.BAND_20;
|
||||
public static final int BAND_25 = android.hardware.radio.V1_5.NgranBands.BAND_25;
|
||||
public static final int BAND_26 = android.hardware.radio.V1_6.NgranBands.BAND_26;
|
||||
public static final int BAND_28 = android.hardware.radio.V1_5.NgranBands.BAND_28;
|
||||
public static final int BAND_29 = android.hardware.radio.V1_5.NgranBands.BAND_29;
|
||||
public static final int BAND_30 = android.hardware.radio.V1_5.NgranBands.BAND_30;
|
||||
@@ -340,9 +714,11 @@ public final class AccessNetworkConstants {
|
||||
public static final int BAND_39 = android.hardware.radio.V1_5.NgranBands.BAND_39;
|
||||
public static final int BAND_40 = android.hardware.radio.V1_5.NgranBands.BAND_40;
|
||||
public static final int BAND_41 = android.hardware.radio.V1_5.NgranBands.BAND_41;
|
||||
public static final int BAND_46 = android.hardware.radio.V1_6.NgranBands.BAND_46;
|
||||
public static final int BAND_48 = android.hardware.radio.V1_5.NgranBands.BAND_48;
|
||||
public static final int BAND_50 = android.hardware.radio.V1_5.NgranBands.BAND_50;
|
||||
public static final int BAND_51 = android.hardware.radio.V1_5.NgranBands.BAND_51;
|
||||
public static final int BAND_53 = android.hardware.radio.V1_6.NgranBands.BAND_53;
|
||||
public static final int BAND_65 = android.hardware.radio.V1_5.NgranBands.BAND_65;
|
||||
public static final int BAND_66 = android.hardware.radio.V1_5.NgranBands.BAND_66;
|
||||
public static final int BAND_70 = android.hardware.radio.V1_5.NgranBands.BAND_70;
|
||||
@@ -366,6 +742,7 @@ public final class AccessNetworkConstants {
|
||||
public static final int BAND_93 = android.hardware.radio.V1_5.NgranBands.BAND_93;
|
||||
public static final int BAND_94 = android.hardware.radio.V1_5.NgranBands.BAND_94;
|
||||
public static final int BAND_95 = android.hardware.radio.V1_5.NgranBands.BAND_95;
|
||||
public static final int BAND_96 = android.hardware.radio.V1_6.NgranBands.BAND_96;
|
||||
|
||||
/** 3GPP TS 38.101-2, Version 16.2.0, Table 5.2-1: FR2 bands */
|
||||
public static final int BAND_257 = android.hardware.radio.V1_5.NgranBands.BAND_257;
|
||||
@@ -390,6 +767,7 @@ public final class AccessNetworkConstants {
|
||||
BAND_18,
|
||||
BAND_20,
|
||||
BAND_25,
|
||||
BAND_26,
|
||||
BAND_28,
|
||||
BAND_29,
|
||||
BAND_30,
|
||||
@@ -398,9 +776,11 @@ public final class AccessNetworkConstants {
|
||||
BAND_39,
|
||||
BAND_40,
|
||||
BAND_41,
|
||||
BAND_46,
|
||||
BAND_48,
|
||||
BAND_50,
|
||||
BAND_51,
|
||||
BAND_53,
|
||||
BAND_65,
|
||||
BAND_66,
|
||||
BAND_70,
|
||||
@@ -424,6 +804,7 @@ public final class AccessNetworkConstants {
|
||||
BAND_93,
|
||||
BAND_94,
|
||||
BAND_95,
|
||||
BAND_96,
|
||||
BAND_257,
|
||||
BAND_258,
|
||||
BAND_260,
|
||||
@@ -464,7 +845,8 @@ public final class AccessNetworkConstants {
|
||||
value = {
|
||||
FREQUENCY_RANGE_GROUP_UNKNOWN,
|
||||
FREQUENCY_RANGE_GROUP_1,
|
||||
FREQUENCY_RANGE_GROUP_2})
|
||||
FREQUENCY_RANGE_GROUP_2
|
||||
})
|
||||
public @interface FrequencyRangeGroup {}
|
||||
|
||||
/**
|
||||
@@ -489,6 +871,7 @@ public final class AccessNetworkConstants {
|
||||
case BAND_18:
|
||||
case BAND_20:
|
||||
case BAND_25:
|
||||
case BAND_26:
|
||||
case BAND_28:
|
||||
case BAND_29:
|
||||
case BAND_30:
|
||||
@@ -497,9 +880,11 @@ public final class AccessNetworkConstants {
|
||||
case BAND_39:
|
||||
case BAND_40:
|
||||
case BAND_41:
|
||||
case BAND_46:
|
||||
case BAND_48:
|
||||
case BAND_50:
|
||||
case BAND_51:
|
||||
case BAND_53:
|
||||
case BAND_65:
|
||||
case BAND_66:
|
||||
case BAND_70:
|
||||
@@ -523,6 +908,7 @@ public final class AccessNetworkConstants {
|
||||
case BAND_93:
|
||||
case BAND_94:
|
||||
case BAND_95:
|
||||
case BAND_96:
|
||||
return FREQUENCY_RANGE_GROUP_1;
|
||||
case BAND_257:
|
||||
case BAND_258:
|
||||
@@ -538,6 +924,33 @@ public final class AccessNetworkConstants {
|
||||
private NgranBands() {}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 38.104 Table 5.4.2.1-1 NR-ARFCN parameters for the global frequency raster.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
enum NgranArfcnFrequency {
|
||||
|
||||
NGRAN_ARFCN_FREQUENCY_RANGE_1(5, 0, 0, 0, 599999),
|
||||
NGRAN_ARFCN_FREQUENCY_RANGE_2(15, 3000000, 600000, 600000, 2016666),
|
||||
NGRAN_ARFCN_FREQUENCY_RANGE_3(60, 24250080, 2016667, 2016667, 3279165);
|
||||
|
||||
NgranArfcnFrequency(int globalKhz, int rangeOffset, int arfcnOffset,
|
||||
int rangeFirst, int rangeLast) {
|
||||
this.globalKhz = globalKhz;
|
||||
this.rangeOffset = rangeOffset;
|
||||
this.arfcnOffset = arfcnOffset;
|
||||
this.rangeFirst = rangeFirst;
|
||||
this.rangeLast = rangeLast;
|
||||
}
|
||||
|
||||
int globalKhz;
|
||||
int rangeOffset;
|
||||
int arfcnOffset;
|
||||
int rangeFirst;
|
||||
int rangeLast;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
private AccessNetworkConstants() {};
|
||||
}
|
||||
|
||||
@@ -4,12 +4,20 @@ import static android.telephony.ServiceState.DUPLEX_MODE_FDD;
|
||||
import static android.telephony.ServiceState.DUPLEX_MODE_TDD;
|
||||
import static android.telephony.ServiceState.DUPLEX_MODE_UNKNOWN;
|
||||
|
||||
import android.telephony.AccessNetworkConstants.EutranBandArfcnFrequency;
|
||||
import android.telephony.AccessNetworkConstants.EutranBand;
|
||||
import android.telephony.AccessNetworkConstants.GeranBand;
|
||||
import android.telephony.AccessNetworkConstants.GeranBandArfcnFrequency;
|
||||
import android.telephony.AccessNetworkConstants.NgranArfcnFrequency;
|
||||
import android.telephony.AccessNetworkConstants.NgranBands;
|
||||
import android.telephony.AccessNetworkConstants.UtranBand;
|
||||
import android.telephony.AccessNetworkConstants.UtranBandArfcnFrequency;
|
||||
import android.telephony.ServiceState.DuplexMode;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Utilities to map between radio constants.
|
||||
@@ -22,9 +30,27 @@ public class AccessNetworkUtils {
|
||||
private AccessNetworkUtils() {}
|
||||
|
||||
public static final int INVALID_BAND = -1;
|
||||
public static final int INVALID_FREQUENCY = -1;
|
||||
|
||||
/** ISO country code of Japan. */
|
||||
private static final String JAPAN_ISO_COUNTRY_CODE = "jp";
|
||||
private static final String TAG = "AccessNetworkUtils";
|
||||
|
||||
private static final int FREQUENCY_KHZ = 1000;
|
||||
private static final int FREQUENCY_RANGE_LOW_KHZ = 1000000;
|
||||
private static final int FREQUENCY_RANGE_MID_KHZ = 3000000;
|
||||
private static final int FREQUENCY_RANGE_HIGH_KHZ = 6000000;
|
||||
|
||||
private static final Set<Integer> UARFCN_NOT_GENERAL_BAND;
|
||||
static {
|
||||
UARFCN_NOT_GENERAL_BAND = new HashSet<Integer>();
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_A);
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_B);
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_C);
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_D);
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_E);
|
||||
UARFCN_NOT_GENERAL_BAND.add(UtranBand.BAND_F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the duplex mode for the given EUTRAN operating band.
|
||||
@@ -325,4 +351,403 @@ public class AccessNetworkUtils {
|
||||
}
|
||||
return INVALID_BAND;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get geran bands from {@link PhysicalChannelConfig#getBand()}
|
||||
*/
|
||||
public static int getFrequencyRangeGroupFromGeranBand(@GeranBand.GeranBands int band) {
|
||||
switch (band) {
|
||||
case GeranBand.BAND_T380:
|
||||
case GeranBand.BAND_T410:
|
||||
case GeranBand.BAND_450:
|
||||
case GeranBand.BAND_480:
|
||||
case GeranBand.BAND_710:
|
||||
case GeranBand.BAND_750:
|
||||
case GeranBand.BAND_T810:
|
||||
case GeranBand.BAND_850:
|
||||
case GeranBand.BAND_P900:
|
||||
case GeranBand.BAND_E900:
|
||||
case GeranBand.BAND_R900:
|
||||
case GeranBand.BAND_ER900:
|
||||
return ServiceState.FREQUENCY_RANGE_LOW;
|
||||
case GeranBand.BAND_DCS1800:
|
||||
case GeranBand.BAND_PCS1900:
|
||||
return ServiceState.FREQUENCY_RANGE_MID;
|
||||
default:
|
||||
return ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get utran bands from {@link PhysicalChannelConfig#getBand()}
|
||||
*/
|
||||
public static int getFrequencyRangeGroupFromUtranBand(@UtranBand.UtranBands int band) {
|
||||
switch (band) {
|
||||
case UtranBand.BAND_5:
|
||||
case UtranBand.BAND_6:
|
||||
case UtranBand.BAND_8:
|
||||
case UtranBand.BAND_12:
|
||||
case UtranBand.BAND_13:
|
||||
case UtranBand.BAND_14:
|
||||
case UtranBand.BAND_19:
|
||||
case UtranBand.BAND_20:
|
||||
case UtranBand.BAND_26:
|
||||
return ServiceState.FREQUENCY_RANGE_LOW;
|
||||
case UtranBand.BAND_1:
|
||||
case UtranBand.BAND_2:
|
||||
case UtranBand.BAND_3:
|
||||
case UtranBand.BAND_4:
|
||||
case UtranBand.BAND_7:
|
||||
case UtranBand.BAND_9:
|
||||
case UtranBand.BAND_10:
|
||||
case UtranBand.BAND_11:
|
||||
case UtranBand.BAND_21:
|
||||
case UtranBand.BAND_25:
|
||||
case UtranBand.BAND_A:
|
||||
case UtranBand.BAND_B:
|
||||
case UtranBand.BAND_C:
|
||||
case UtranBand.BAND_D:
|
||||
case UtranBand.BAND_E:
|
||||
case UtranBand.BAND_F:
|
||||
return ServiceState.FREQUENCY_RANGE_MID;
|
||||
case UtranBand.BAND_22:
|
||||
return ServiceState.FREQUENCY_RANGE_HIGH;
|
||||
default:
|
||||
return ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get eutran bands from {@link PhysicalChannelConfig#getBand()}
|
||||
* 3GPP TS 36.101 Table 5.5 EUTRA operating bands
|
||||
*/
|
||||
public static int getFrequencyRangeGroupFromEutranBand(@EutranBand.EutranBands int band) {
|
||||
switch (band) {
|
||||
case EutranBand.BAND_5:
|
||||
case EutranBand.BAND_6:
|
||||
case EutranBand.BAND_8:
|
||||
case EutranBand.BAND_12:
|
||||
case EutranBand.BAND_13:
|
||||
case EutranBand.BAND_14:
|
||||
case EutranBand.BAND_17:
|
||||
case EutranBand.BAND_18:
|
||||
case EutranBand.BAND_19:
|
||||
case EutranBand.BAND_20:
|
||||
case EutranBand.BAND_26:
|
||||
case EutranBand.BAND_27:
|
||||
case EutranBand.BAND_28:
|
||||
case EutranBand.BAND_31:
|
||||
case EutranBand.BAND_44:
|
||||
case EutranBand.BAND_50:
|
||||
case EutranBand.BAND_51:
|
||||
case EutranBand.BAND_68:
|
||||
case EutranBand.BAND_71:
|
||||
case EutranBand.BAND_72:
|
||||
case EutranBand.BAND_73:
|
||||
case EutranBand.BAND_85:
|
||||
case EutranBand.BAND_87:
|
||||
case EutranBand.BAND_88:
|
||||
return ServiceState.FREQUENCY_RANGE_LOW;
|
||||
case EutranBand.BAND_1:
|
||||
case EutranBand.BAND_2:
|
||||
case EutranBand.BAND_3:
|
||||
case EutranBand.BAND_4:
|
||||
case EutranBand.BAND_7:
|
||||
case EutranBand.BAND_9:
|
||||
case EutranBand.BAND_10:
|
||||
case EutranBand.BAND_11:
|
||||
case EutranBand.BAND_21:
|
||||
case EutranBand.BAND_23:
|
||||
case EutranBand.BAND_24:
|
||||
case EutranBand.BAND_25:
|
||||
case EutranBand.BAND_30:
|
||||
case EutranBand.BAND_33:
|
||||
case EutranBand.BAND_34:
|
||||
case EutranBand.BAND_35:
|
||||
case EutranBand.BAND_36:
|
||||
case EutranBand.BAND_37:
|
||||
case EutranBand.BAND_38:
|
||||
case EutranBand.BAND_39:
|
||||
case EutranBand.BAND_40:
|
||||
case EutranBand.BAND_41:
|
||||
case EutranBand.BAND_45:
|
||||
case EutranBand.BAND_53:
|
||||
case EutranBand.BAND_65:
|
||||
case EutranBand.BAND_66:
|
||||
case EutranBand.BAND_70:
|
||||
case EutranBand.BAND_74:
|
||||
return ServiceState.FREQUENCY_RANGE_MID;
|
||||
case EutranBand.BAND_22:
|
||||
case EutranBand.BAND_42:
|
||||
case EutranBand.BAND_43:
|
||||
case EutranBand.BAND_46:
|
||||
case EutranBand.BAND_47:
|
||||
case EutranBand.BAND_48:
|
||||
case EutranBand.BAND_49:
|
||||
case EutranBand.BAND_52:
|
||||
return ServiceState.FREQUENCY_RANGE_HIGH;
|
||||
default:
|
||||
return ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ngran band from {@link PhysicalChannelConfig#getBand()}
|
||||
* 3GPP TS 38.104 Table 5.2-1 NR operating bands in FR1
|
||||
* 3GPP TS 38.104 Table 5.2-2 NR operating bands in FR2
|
||||
*/
|
||||
public static int getFrequencyRangeGroupFromNrBand(@NgranBands.NgranBand int band) {
|
||||
switch (band) {
|
||||
case NgranBands.BAND_5:
|
||||
case NgranBands.BAND_8:
|
||||
case NgranBands.BAND_12:
|
||||
case NgranBands.BAND_14:
|
||||
case NgranBands.BAND_18:
|
||||
case NgranBands.BAND_20:
|
||||
case NgranBands.BAND_26:
|
||||
case NgranBands.BAND_28:
|
||||
case NgranBands.BAND_29:
|
||||
case NgranBands.BAND_71:
|
||||
case NgranBands.BAND_81:
|
||||
case NgranBands.BAND_82:
|
||||
case NgranBands.BAND_83:
|
||||
case NgranBands.BAND_89:
|
||||
return ServiceState.FREQUENCY_RANGE_LOW;
|
||||
case NgranBands.BAND_1:
|
||||
case NgranBands.BAND_2:
|
||||
case NgranBands.BAND_3:
|
||||
case NgranBands.BAND_7:
|
||||
case NgranBands.BAND_25:
|
||||
case NgranBands.BAND_30:
|
||||
case NgranBands.BAND_34:
|
||||
case NgranBands.BAND_38:
|
||||
case NgranBands.BAND_39:
|
||||
case NgranBands.BAND_40:
|
||||
case NgranBands.BAND_41:
|
||||
case NgranBands.BAND_50:
|
||||
case NgranBands.BAND_51:
|
||||
case NgranBands.BAND_53:
|
||||
case NgranBands.BAND_65:
|
||||
case NgranBands.BAND_66:
|
||||
case NgranBands.BAND_70:
|
||||
case NgranBands.BAND_74:
|
||||
case NgranBands.BAND_75:
|
||||
case NgranBands.BAND_76:
|
||||
case NgranBands.BAND_80:
|
||||
case NgranBands.BAND_84:
|
||||
case NgranBands.BAND_86:
|
||||
case NgranBands.BAND_90:
|
||||
case NgranBands.BAND_91:
|
||||
case NgranBands.BAND_92:
|
||||
case NgranBands.BAND_93:
|
||||
case NgranBands.BAND_94:
|
||||
case NgranBands.BAND_95:
|
||||
return ServiceState.FREQUENCY_RANGE_MID;
|
||||
case NgranBands.BAND_46:
|
||||
case NgranBands.BAND_48:
|
||||
case NgranBands.BAND_77:
|
||||
case NgranBands.BAND_78:
|
||||
case NgranBands.BAND_79:
|
||||
return ServiceState.FREQUENCY_RANGE_HIGH;
|
||||
case NgranBands.BAND_96:
|
||||
case NgranBands.BAND_257:
|
||||
case NgranBands.BAND_258:
|
||||
case NgranBands.BAND_260:
|
||||
case NgranBands.BAND_261:
|
||||
return ServiceState.FREQUENCY_RANGE_MMWAVE;
|
||||
default:
|
||||
return ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 38.104 Table 5.4.2.1-1 NR-ARFCN parameters for the global frequency raster.
|
||||
* Formula of NR-ARFCN convert to actual frequency:
|
||||
* Actual frequency(kHz) = (RANGE_OFFSET + GLOBAL_KHZ * (ARFCN - ARFCN_OFFSET))
|
||||
*/
|
||||
public static int getFrequencyFromNrArfcn(int nrArfcn) {
|
||||
|
||||
int globalKhz = 0;
|
||||
int rangeOffset = 0;
|
||||
int arfcnOffset = 0;
|
||||
for (NgranArfcnFrequency nrArfcnFrequency : AccessNetworkConstants.
|
||||
NgranArfcnFrequency.values()) {
|
||||
if (nrArfcn >= nrArfcnFrequency.rangeFirst
|
||||
&& nrArfcn <= nrArfcnFrequency.rangeLast) {
|
||||
globalKhz = nrArfcnFrequency.globalKhz;
|
||||
rangeOffset = nrArfcnFrequency.rangeOffset;
|
||||
arfcnOffset = nrArfcnFrequency.arfcnOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rangeOffset + globalKhz * (nrArfcn - arfcnOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actual frequency from E-UTRA ARFCN.
|
||||
*/
|
||||
public static int getFrequencyFromEarfcn(int band, int earfcn, boolean isUplink) {
|
||||
|
||||
int low = 0;
|
||||
int offset = 0;
|
||||
for (EutranBandArfcnFrequency earfcnFrequency : EutranBandArfcnFrequency.values()) {
|
||||
if (band == earfcnFrequency.band) {
|
||||
if (isInEarfcnRange(earfcn, earfcnFrequency, isUplink)) {
|
||||
low = isUplink ? earfcnFrequency.uplinkLowKhz : earfcnFrequency.downlinkLowKhz;
|
||||
offset = isUplink ? earfcnFrequency.uplinkOffset
|
||||
: earfcnFrequency.downlinkOffset;
|
||||
break;
|
||||
} else {
|
||||
Log.e(TAG, "Band and the range of EARFCN are not consistent.");
|
||||
return INVALID_FREQUENCY;
|
||||
}
|
||||
}
|
||||
}
|
||||
return convertEarfcnToFrequency(low, earfcn, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 36.101 Table 5.7.3-1 E-UTRA channel numbers.
|
||||
* Formula of E-UTRA ARFCN convert to actual frequency:
|
||||
* Actual frequency(kHz) = (DOWNLINK_LOW + 0.1 * (ARFCN - DOWNLINK_OFFSET)) * FREQUENCY_KHZ
|
||||
* Actual frequency(kHz) = (UPLINK_LOW + 0.1 * (ARFCN - UPLINK_OFFSET)) * FREQUENCY_KHZ
|
||||
*/
|
||||
private static int convertEarfcnToFrequency(int low, int earfcn, int offset) {
|
||||
return low + 100 * (earfcn - offset);
|
||||
}
|
||||
|
||||
private static boolean isInEarfcnRange(int earfcn, EutranBandArfcnFrequency earfcnFrequency,
|
||||
boolean isUplink) {
|
||||
if (isUplink) {
|
||||
return earfcn >= earfcnFrequency.uplinkOffset && earfcn <= earfcnFrequency.uplinkRange;
|
||||
} else {
|
||||
return earfcn >= earfcnFrequency.downlinkOffset
|
||||
&& earfcn <= earfcnFrequency.downlinkRange;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actual frequency from UTRA ARFCN.
|
||||
*/
|
||||
public static int getFrequencyFromUarfcn(int band, int uarfcn, boolean isUplink) {
|
||||
|
||||
int offsetKhz = 0;
|
||||
for (UtranBandArfcnFrequency uarfcnFrequency : AccessNetworkConstants.
|
||||
UtranBandArfcnFrequency.values()) {
|
||||
if (band == uarfcnFrequency.band) {
|
||||
if (isInUarfcnRange(uarfcn, uarfcnFrequency, isUplink)) {
|
||||
offsetKhz = isUplink ? uarfcnFrequency.uplinkOffset
|
||||
: uarfcnFrequency.downlinkOffset;
|
||||
break;
|
||||
} else {
|
||||
Log.e(TAG, "Band and the range of UARFCN are not consistent.");
|
||||
return INVALID_FREQUENCY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!UARFCN_NOT_GENERAL_BAND.contains(band)) {
|
||||
return convertUarfcnToFrequency(offsetKhz, uarfcn);
|
||||
} else {
|
||||
return convertUarfcnTddToFrequency(band, uarfcn);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 25.101, Table 5.1 UARFCN definition (general).
|
||||
* Formula of UTRA ARFCN convert to actual frequency:
|
||||
* For general bands:
|
||||
* Downlink actual frequency(kHz) = (DOWNLINK_OFFSET + 0.2 * ARFCN) * FREQUENCY_KHZ
|
||||
* Uplink actual frequency(kHz) = (UPLINK_OFFSET + 0.2 * ARFCN) * FREQUENCY_KHZ
|
||||
*/
|
||||
private static int convertUarfcnToFrequency(int offsetKhz, int uarfcn) {
|
||||
return offsetKhz + (200 * uarfcn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 25.102, Table 5.2 UTRA Absolute Radio Frequency Channel Number 1.28 Mcps TDD Option.
|
||||
* For FDD bands A, B, C, E, F:
|
||||
* Actual frequency(kHz) = 5 * ARFCN * FREQUENCY_KHZ
|
||||
* For TDD bands D:
|
||||
* Actual frequency(kHz) = (5 * (ARFCN - 2150.1MHz)) * FREQUENCY_KHZ
|
||||
*/
|
||||
private static int convertUarfcnTddToFrequency(int band, int uarfcn) {
|
||||
if (band != UtranBand.BAND_D) {
|
||||
return 5 * uarfcn * FREQUENCY_KHZ;
|
||||
} else {
|
||||
return 5 * ((FREQUENCY_KHZ * uarfcn) - 2150100);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isInUarfcnRange(int uarfcn, UtranBandArfcnFrequency uarfcnFrequency,
|
||||
boolean isUplink) {
|
||||
if (isUplink) {
|
||||
return uarfcn >= uarfcnFrequency.uplinkRangeFirst
|
||||
&& uarfcn <= uarfcnFrequency.uplinkRangeLast;
|
||||
} else {
|
||||
if (uarfcnFrequency.downlinkRangeFirst != 0 && uarfcnFrequency.downlinkRangeLast != 0) {
|
||||
return uarfcn >= uarfcnFrequency.downlinkRangeFirst
|
||||
&& uarfcn <= uarfcnFrequency.downlinkRangeLast;
|
||||
} else {
|
||||
// BAND_C, BAND_D, BAND_E and BAND_F do not have the downlink range.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actual frequency from GERAN ARFCN.
|
||||
*/
|
||||
public static int getFrequencyFromArfcn(int band, int arfcn, boolean isUplink) {
|
||||
|
||||
int uplinkFrequencyFirst = 0;
|
||||
int arfcnOffset = 0;
|
||||
int downlinkOffset = 0;
|
||||
int frequency = 0;
|
||||
for (GeranBandArfcnFrequency arfcnFrequency : AccessNetworkConstants.
|
||||
GeranBandArfcnFrequency.values()) {
|
||||
if (band == arfcnFrequency.band) {
|
||||
if (arfcn >= arfcnFrequency.arfcnRangeFirst
|
||||
&& arfcn <= arfcnFrequency.arfcnRangeLast) {
|
||||
uplinkFrequencyFirst = arfcnFrequency.uplinkFrequencyFirst;
|
||||
downlinkOffset = arfcnFrequency.downlinkOffset;
|
||||
arfcnOffset = arfcnFrequency.arfcnOffset;
|
||||
frequency = convertArfcnToFrequency(arfcn, uplinkFrequencyFirst,
|
||||
arfcnOffset);
|
||||
break;
|
||||
} else {
|
||||
Log.e(TAG, "Band and the range of ARFCN are not consistent.");
|
||||
return INVALID_FREQUENCY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isUplink ? frequency : frequency + downlinkOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3GPP TS 45.005 Table 2-1 Dynamically mapped ARFCN
|
||||
* Formula of Geran ARFCN convert to actual frequency:
|
||||
* Uplink actual frequency(kHz) =
|
||||
* (UPLINK_FREQUENCY_FIRST + 0.2 * (ARFCN - ARFCN_RANGE_FIRST)) * FREQUENCY_KHZ
|
||||
* Downlink actual frequency(kHz) = Uplink actual frequency + 10
|
||||
*/
|
||||
private static int convertArfcnToFrequency(int arfcn, int uplinkFrequencyFirstKhz,
|
||||
int arfcnOffset) {
|
||||
return uplinkFrequencyFirstKhz + 200 * (arfcn - arfcnOffset);
|
||||
}
|
||||
|
||||
public static int getFrequencyRangeFromArfcn(int frequency) {
|
||||
if (frequency < FREQUENCY_RANGE_LOW_KHZ) {
|
||||
return ServiceState.FREQUENCY_RANGE_LOW;
|
||||
} else if (frequency < FREQUENCY_RANGE_MID_KHZ
|
||||
&& frequency >= FREQUENCY_RANGE_LOW_KHZ) {
|
||||
return ServiceState.FREQUENCY_RANGE_MID;
|
||||
} else if (frequency < FREQUENCY_RANGE_HIGH_KHZ
|
||||
&& frequency >= FREQUENCY_RANGE_MID_KHZ) {
|
||||
return ServiceState.FREQUENCY_RANGE_HIGH;
|
||||
} else {
|
||||
return ServiceState.FREQUENCY_RANGE_MMWAVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package android.telephony;
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.IntRange;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SystemApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.telephony.Annotation.NetworkType;
|
||||
@@ -56,6 +55,18 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
/** Physical Cell Id is unknown. */
|
||||
public static final int PHYSICAL_CELL_ID_UNKNOWN = -1;
|
||||
|
||||
/** Physical Cell Id's maximum value is 1007. */
|
||||
public static final int PHYSICAL_CELL_ID_MAXIMUM_VALUE = 1007;
|
||||
|
||||
/** Cell bandwidth is unknown. */
|
||||
public static final int CELL_BANDWIDTH_UNKNOWN = 0;
|
||||
|
||||
/** The frequency is unknown. */
|
||||
public static final int FREQUENCY_UNKNOWN = -1;
|
||||
|
||||
/** The band is unknown. */
|
||||
public static final int BAND_UNKNOWN = 0;
|
||||
|
||||
/**
|
||||
* Connection status of the cell.
|
||||
*
|
||||
@@ -65,15 +76,20 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
private int mCellConnectionStatus;
|
||||
|
||||
/**
|
||||
* Cell bandwidth, in kHz.
|
||||
* Downlink cell bandwidth, in kHz.
|
||||
*/
|
||||
private int mCellBandwidthDownlinkKhz;
|
||||
|
||||
/**
|
||||
* Uplink cell bandwidth, in kHz.
|
||||
*/
|
||||
private int mCellBandwidthUplinkKhz;
|
||||
|
||||
/**
|
||||
* The radio technology for this physical channel.
|
||||
*/
|
||||
@NetworkType
|
||||
private int mRat;
|
||||
private int mNetworkType;
|
||||
|
||||
/**
|
||||
* The rough frequency range for this physical channel.
|
||||
@@ -82,9 +98,24 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
private int mFrequencyRange;
|
||||
|
||||
/**
|
||||
* The absolute radio frequency channel number, {@link #CHANNEL_NUMBER_UNKNOWN} if unknown.
|
||||
* The frequency of Downlink.
|
||||
*/
|
||||
private int mChannelNumber;
|
||||
private int mDownlinkFrequency;
|
||||
|
||||
/**
|
||||
* The frequency of Uplink.
|
||||
*/
|
||||
private int mUplinkFrequency;
|
||||
|
||||
/**
|
||||
* Downlink Absolute Radio Frequency Channel Number
|
||||
*/
|
||||
private int mDownlinkChannelNumber;
|
||||
|
||||
/**
|
||||
* Uplink Absolute Radio Frequency Channel Number
|
||||
*/
|
||||
private int mUplinkChannelNumber;
|
||||
|
||||
/**
|
||||
* A list of data calls mapped to this physical channel. An empty list means the physical
|
||||
@@ -98,6 +129,11 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
*/
|
||||
private int mPhysicalCellId;
|
||||
|
||||
/**
|
||||
* This is the band which is being used.
|
||||
*/
|
||||
private int mBand;
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
@@ -107,27 +143,39 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
dest.writeInt(mCellConnectionStatus);
|
||||
dest.writeInt(mCellBandwidthDownlinkKhz);
|
||||
dest.writeInt(mRat);
|
||||
dest.writeInt(mChannelNumber);
|
||||
dest.writeInt(mCellBandwidthUplinkKhz);
|
||||
dest.writeInt(mNetworkType);
|
||||
dest.writeInt(mDownlinkChannelNumber);
|
||||
dest.writeInt(mUplinkChannelNumber);
|
||||
dest.writeInt(mFrequencyRange);
|
||||
dest.writeIntArray(mContextIds);
|
||||
dest.writeInt(mPhysicalCellId);
|
||||
dest.writeInt(mBand);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cell bandwidth, in kHz
|
||||
* @return Downlink cell bandwidth in kHz, {@link #CELL_BANDWIDTH_UNKNOWN} if unknown.
|
||||
*/
|
||||
public int getCellBandwidthDownlink() {
|
||||
@IntRange(from = 1)
|
||||
public int getCellBandwidthDownlinkKhz() {
|
||||
return mCellBandwidthDownlinkKhz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Uplink cell bandwidth in kHz, {@link #CELL_BANDWIDTH_UNKNOWN} if unknown.
|
||||
*/
|
||||
@IntRange(from = 1)
|
||||
public int getCellBandwidthUplinkKhz() {
|
||||
return mCellBandwidthUplinkKhz;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of data call ids mapped to this physical channel. This list is sorted into
|
||||
* ascending numerical order. Each id in this list must match the id in
|
||||
* {@link com.android.internal.telephony.dataconnection.DataConnection}. An empty list means the
|
||||
* physical channel has no data call mapped to it.
|
||||
*
|
||||
* @return an integer list indicates the data call ids.
|
||||
* @return an integer list indicates the data call ids,
|
||||
* @hide
|
||||
*/
|
||||
public int[] getContextIds() {
|
||||
@@ -135,7 +183,18 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rough frequency range for this physical channel.
|
||||
* @return the absolute radio frequency channel number for this physical channel,
|
||||
* {@link #CHANNEL_NUMBER_UNKNOWN} if unknown.
|
||||
* @deprecated Use {@link #getDownlinkChannelNumber()} to get the channel number.
|
||||
*/
|
||||
@Deprecated
|
||||
public int getChannelNumber() {
|
||||
return getDownlinkChannelNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rough frequency range for this physical channel,
|
||||
* {@link ServiceState#FREQUENCY_RANGE_UNKNOWN} if unknown.
|
||||
* @see {@link ServiceState#FREQUENCY_RANGE_LOW}
|
||||
* @see {@link ServiceState#FREQUENCY_RANGE_MID}
|
||||
* @see {@link ServiceState#FREQUENCY_RANGE_HIGH}
|
||||
@@ -148,11 +207,48 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the absolute radio frequency channel number for this physical channel,
|
||||
* @return Downlink Absolute Radio Frequency Channel Number,
|
||||
* {@link #CHANNEL_NUMBER_UNKNOWN} if unknown.
|
||||
*/
|
||||
public int getChannelNumber() {
|
||||
return mChannelNumber;
|
||||
@IntRange(from = 0)
|
||||
public int getDownlinkChannelNumber() {
|
||||
return mDownlinkChannelNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Uplink Absolute Radio Frequency Channel Number,
|
||||
* {@link #CHANNEL_NUMBER_UNKNOWN} if unknown.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public int getUplinkChannelNumber() {
|
||||
return mUplinkChannelNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* The valid bands are {@link AccessNetworkConstants.GeranBand},
|
||||
* {@link AccessNetworkConstants.UtranBand}, {@link AccessNetworkConstants.EutranBand} and
|
||||
* {@link AccessNetworkConstants.NgranBands}.
|
||||
*
|
||||
* @return the frequency band, {@link #BAND_UNKNOWN} if unknown. */
|
||||
@IntRange(from = 1, to = 261)
|
||||
public int getBand() {
|
||||
return mBand;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The downlink frequency in kHz, {@link #FREQUENCY_UNKNOWN} if unknown.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public int getDownlinkFrequencyKhz() {
|
||||
return mDownlinkFrequency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The uplink frequency in kHz, {@link #FREQUENCY_UNKNOWN} if unknown.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public int getUplinkFrequencyKhz() {
|
||||
return mUplinkFrequency;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,10 +269,13 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
return mPhysicalCellId;
|
||||
}
|
||||
|
||||
/**The radio technology for this physical channel. */
|
||||
/**
|
||||
* @return The network type for this physical channel,
|
||||
* {@link TelephonyManager#NETWORK_TYPE_UNKNOWN} if unknown.
|
||||
*/
|
||||
@NetworkType
|
||||
public int getNetworkType() {
|
||||
return mRat;
|
||||
return mNetworkType;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,7 +285,7 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
* @see #CONNECTION_SECONDARY_SERVING
|
||||
* @see #CONNECTION_UNKNOWN
|
||||
*
|
||||
* @return Connection status of the cell
|
||||
* @return Connection status of the cell, {@link #CONNECTION_UNKNOWN} if unknown.
|
||||
*/
|
||||
@ConnectionStatus
|
||||
public int getConnectionStatus() {
|
||||
@@ -210,6 +309,97 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
}
|
||||
}
|
||||
|
||||
private void setDownlinkFrequency() {
|
||||
switch (mNetworkType) {
|
||||
case TelephonyManager.NETWORK_TYPE_NR:
|
||||
mDownlinkFrequency = AccessNetworkUtils.getFrequencyFromNrArfcn(
|
||||
mDownlinkChannelNumber);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_LTE:
|
||||
mDownlinkFrequency = AccessNetworkUtils.getFrequencyFromEarfcn(
|
||||
mBand, mDownlinkChannelNumber, false);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_HSPAP:
|
||||
case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
case TelephonyManager.NETWORK_TYPE_HSDPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSUPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPA:
|
||||
mDownlinkFrequency = AccessNetworkUtils.getFrequencyFromUarfcn(
|
||||
mBand, mDownlinkChannelNumber, false);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
case TelephonyManager.NETWORK_TYPE_GSM:
|
||||
mDownlinkFrequency = AccessNetworkUtils.getFrequencyFromArfcn(
|
||||
mBand, mDownlinkChannelNumber, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setUplinkFrequency() {
|
||||
switch (mNetworkType){
|
||||
case TelephonyManager.NETWORK_TYPE_NR:
|
||||
mUplinkFrequency = mDownlinkFrequency;
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_LTE:
|
||||
mUplinkFrequency = AccessNetworkUtils.getFrequencyFromEarfcn(
|
||||
mBand, mUplinkChannelNumber, true);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_HSPAP:
|
||||
case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
case TelephonyManager.NETWORK_TYPE_HSDPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSUPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPA:
|
||||
mUplinkFrequency = AccessNetworkUtils.getFrequencyFromUarfcn(
|
||||
mBand, mUplinkChannelNumber, true);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
case TelephonyManager.NETWORK_TYPE_GSM:
|
||||
mUplinkFrequency = AccessNetworkUtils.getFrequencyFromArfcn(
|
||||
mBand, mUplinkChannelNumber, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setFrequencyRange() {
|
||||
if (mFrequencyRange != ServiceState.FREQUENCY_RANGE_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mNetworkType) {
|
||||
case TelephonyManager.NETWORK_TYPE_NR:
|
||||
mFrequencyRange = AccessNetworkUtils.getFrequencyRangeGroupFromNrBand(mBand);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_LTE:
|
||||
mFrequencyRange = AccessNetworkUtils.getFrequencyRangeGroupFromEutranBand(mBand);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_HSPAP:
|
||||
case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
case TelephonyManager.NETWORK_TYPE_HSDPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSUPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPA:
|
||||
mFrequencyRange = AccessNetworkUtils.getFrequencyRangeGroupFromUtranBand(mBand);
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
case TelephonyManager.NETWORK_TYPE_GSM:
|
||||
mFrequencyRange = AccessNetworkUtils.getFrequencyRangeGroupFromGeranBand(mBand);
|
||||
break;
|
||||
default:
|
||||
mFrequencyRange = ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (mFrequencyRange == ServiceState.FREQUENCY_RANGE_UNKNOWN) {
|
||||
mFrequencyRange = AccessNetworkUtils.getFrequencyRangeFromArfcn(
|
||||
mDownlinkFrequency);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -223,30 +413,37 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
PhysicalChannelConfig config = (PhysicalChannelConfig) o;
|
||||
return mCellConnectionStatus == config.mCellConnectionStatus
|
||||
&& mCellBandwidthDownlinkKhz == config.mCellBandwidthDownlinkKhz
|
||||
&& mRat == config.mRat
|
||||
&& mCellBandwidthUplinkKhz == config.mCellBandwidthUplinkKhz
|
||||
&& mNetworkType == config.mNetworkType
|
||||
&& mFrequencyRange == config.mFrequencyRange
|
||||
&& mChannelNumber == config.mChannelNumber
|
||||
&& mDownlinkChannelNumber == config.mDownlinkChannelNumber
|
||||
&& mUplinkChannelNumber == config.mUplinkChannelNumber
|
||||
&& mPhysicalCellId == config.mPhysicalCellId
|
||||
&& Arrays.equals(mContextIds, config.mContextIds);
|
||||
&& Arrays.equals(mContextIds, config.mContextIds)
|
||||
&& mBand == config.mBand
|
||||
&& mDownlinkFrequency == config.mDownlinkFrequency
|
||||
&& mUplinkFrequency == config.mUplinkFrequency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
mCellConnectionStatus, mCellBandwidthDownlinkKhz, mRat, mFrequencyRange,
|
||||
mChannelNumber, mPhysicalCellId, mContextIds);
|
||||
mCellConnectionStatus, mCellBandwidthDownlinkKhz, mCellBandwidthUplinkKhz,
|
||||
mNetworkType, mFrequencyRange, mDownlinkChannelNumber, mUplinkChannelNumber,
|
||||
mContextIds, mPhysicalCellId, mBand, mDownlinkFrequency, mUplinkFrequency);
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Parcelable.Creator<PhysicalChannelConfig> CREATOR =
|
||||
new Parcelable.Creator<PhysicalChannelConfig>() {
|
||||
public PhysicalChannelConfig createFromParcel(Parcel in) {
|
||||
return new PhysicalChannelConfig(in);
|
||||
}
|
||||
public static final
|
||||
@android.annotation.NonNull Parcelable.Creator<PhysicalChannelConfig> CREATOR =
|
||||
new Parcelable.Creator<PhysicalChannelConfig>() {
|
||||
public PhysicalChannelConfig createFromParcel(Parcel in) {
|
||||
return new PhysicalChannelConfig(in);
|
||||
}
|
||||
|
||||
public PhysicalChannelConfig[] newArray(int size) {
|
||||
return new PhysicalChannelConfig[size];
|
||||
}
|
||||
};
|
||||
public PhysicalChannelConfig[] newArray(int size) {
|
||||
return new PhysicalChannelConfig[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -255,44 +452,64 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
.append(getConnectionStatusString())
|
||||
.append(",mCellBandwidthDownlinkKhz=")
|
||||
.append(mCellBandwidthDownlinkKhz)
|
||||
.append(",mRat=")
|
||||
.append(TelephonyManager.getNetworkTypeName(mRat))
|
||||
.append(",mCellBandwidthUplinkKhz=")
|
||||
.append(mCellBandwidthUplinkKhz)
|
||||
.append(",mNetworkType=")
|
||||
.append(TelephonyManager.getNetworkTypeName(mNetworkType))
|
||||
.append(",mFrequencyRange=")
|
||||
.append(ServiceState.frequencyRangeToString(mFrequencyRange))
|
||||
.append(",mChannelNumber=")
|
||||
.append(mChannelNumber)
|
||||
.append(",mDownlinkChannelNumber=")
|
||||
.append(mDownlinkChannelNumber)
|
||||
.append(",mUplinkChannelNumber=")
|
||||
.append(mUplinkChannelNumber)
|
||||
.append(",mContextIds=")
|
||||
.append(Arrays.toString(mContextIds))
|
||||
.append(",mPhysicalCellId=")
|
||||
.append(mPhysicalCellId)
|
||||
.append(",mBand=")
|
||||
.append(mBand)
|
||||
.append(",mDownlinkFrequency=")
|
||||
.append(mDownlinkFrequency)
|
||||
.append(",mUplinkFrequency=")
|
||||
.append(mUplinkFrequency)
|
||||
.append("}")
|
||||
.toString();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public PhysicalChannelConfig(int status, int bandwidth) {
|
||||
mCellConnectionStatus = status;
|
||||
mCellBandwidthDownlinkKhz = bandwidth;
|
||||
}
|
||||
|
||||
private PhysicalChannelConfig(Parcel in) {
|
||||
mCellConnectionStatus = in.readInt();
|
||||
mCellBandwidthDownlinkKhz = in.readInt();
|
||||
mRat = in.readInt();
|
||||
mChannelNumber = in.readInt();
|
||||
mCellBandwidthUplinkKhz = in.readInt();
|
||||
mNetworkType = in.readInt();
|
||||
mDownlinkChannelNumber = in.readInt();
|
||||
mUplinkChannelNumber = in.readInt();
|
||||
mFrequencyRange = in.readInt();
|
||||
mContextIds = in.createIntArray();
|
||||
mPhysicalCellId = in.readInt();
|
||||
mBand = in.readInt();
|
||||
if (mBand > BAND_UNKNOWN) {
|
||||
setDownlinkFrequency();
|
||||
setUplinkFrequency();
|
||||
setFrequencyRange();
|
||||
}
|
||||
}
|
||||
|
||||
private PhysicalChannelConfig(Builder builder) {
|
||||
mCellConnectionStatus = builder.mCellConnectionStatus;
|
||||
mCellBandwidthDownlinkKhz = builder.mCellBandwidthDownlinkKhz;
|
||||
mRat = builder.mRat;
|
||||
mChannelNumber = builder.mChannelNumber;
|
||||
mCellBandwidthUplinkKhz = builder.mCellBandwidthUplinkKhz;
|
||||
mNetworkType = builder.mNetworkType;
|
||||
mDownlinkChannelNumber = builder.mDownlinkChannelNumber;
|
||||
mUplinkChannelNumber = builder.mUplinkChannelNumber;
|
||||
mFrequencyRange = builder.mFrequencyRange;
|
||||
mContextIds = builder.mContextIds;
|
||||
mPhysicalCellId = builder.mPhysicalCellId;
|
||||
mBand = builder.mBand;
|
||||
if (mBand > BAND_UNKNOWN) {
|
||||
setDownlinkFrequency();
|
||||
setUplinkFrequency();
|
||||
setFrequencyRange();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,61 +517,105 @@ public final class PhysicalChannelConfig implements Parcelable {
|
||||
* @hide
|
||||
*/
|
||||
public static final class Builder {
|
||||
private int mRat;
|
||||
private int mNetworkType;
|
||||
private int mFrequencyRange;
|
||||
private int mChannelNumber;
|
||||
private int mDownlinkChannelNumber;
|
||||
private int mUplinkChannelNumber;
|
||||
private int mCellBandwidthDownlinkKhz;
|
||||
private int mCellBandwidthUplinkKhz;
|
||||
private int mCellConnectionStatus;
|
||||
private int[] mContextIds;
|
||||
private int mPhysicalCellId;
|
||||
private int mBand;
|
||||
|
||||
public Builder() {
|
||||
mRat = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
|
||||
mNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
|
||||
mFrequencyRange = ServiceState.FREQUENCY_RANGE_UNKNOWN;
|
||||
mChannelNumber = CHANNEL_NUMBER_UNKNOWN;
|
||||
mCellBandwidthDownlinkKhz = 0;
|
||||
mDownlinkChannelNumber = CHANNEL_NUMBER_UNKNOWN;
|
||||
mUplinkChannelNumber = CHANNEL_NUMBER_UNKNOWN;
|
||||
mCellBandwidthDownlinkKhz = CELL_BANDWIDTH_UNKNOWN;
|
||||
mCellBandwidthUplinkKhz = CELL_BANDWIDTH_UNKNOWN;
|
||||
mCellConnectionStatus = CONNECTION_UNKNOWN;
|
||||
mContextIds = new int[0];
|
||||
mPhysicalCellId = PHYSICAL_CELL_ID_UNKNOWN;
|
||||
mBand = BAND_UNKNOWN;
|
||||
}
|
||||
|
||||
public PhysicalChannelConfig build() {
|
||||
return new PhysicalChannelConfig(this);
|
||||
}
|
||||
|
||||
public Builder setRat(int rat) {
|
||||
this.mRat = rat;
|
||||
public @NonNull Builder setNetworkType(@NetworkType int networkType) {
|
||||
if (!TelephonyManager.isNetworkTypeValid(networkType)) {
|
||||
throw new IllegalArgumentException("Network type: " + networkType + " is invalid.");
|
||||
}
|
||||
mNetworkType = networkType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFrequencyRange(int frequencyRange) {
|
||||
this.mFrequencyRange = frequencyRange;
|
||||
public @NonNull Builder setFrequencyRange(int frequencyRange) {
|
||||
if (!ServiceState.isFrequencyRangeValid(frequencyRange)) {
|
||||
throw new IllegalArgumentException("Frequency range: " + frequencyRange +
|
||||
" is invalid.");
|
||||
}
|
||||
mFrequencyRange = frequencyRange;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setChannelNumber(int channelNumber) {
|
||||
this.mChannelNumber = channelNumber;
|
||||
public @NonNull Builder setDownlinkChannelNumber(int downlinkChannelNumber) {
|
||||
mDownlinkChannelNumber = downlinkChannelNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCellBandwidthDownlinkKhz(int cellBandwidthDownlinkKhz) {
|
||||
this.mCellBandwidthDownlinkKhz = cellBandwidthDownlinkKhz;
|
||||
public @NonNull Builder setUplinkChannelNumber(int uplinkChannelNumber) {
|
||||
mUplinkChannelNumber = uplinkChannelNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCellConnectionStatus(int connectionStatus) {
|
||||
this.mCellConnectionStatus = connectionStatus;
|
||||
public @NonNull Builder setCellBandwidthDownlinkKhz(int cellBandwidthDownlinkKhz) {
|
||||
if (cellBandwidthDownlinkKhz < CELL_BANDWIDTH_UNKNOWN) {
|
||||
throw new IllegalArgumentException("Cell downlink bandwidth(kHz): " +
|
||||
cellBandwidthDownlinkKhz + " is invalid.");
|
||||
}
|
||||
mCellBandwidthDownlinkKhz = cellBandwidthDownlinkKhz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setContextIds(int[] contextIds) {
|
||||
public @NonNull Builder setCellBandwidthUplinkKhz(int cellBandwidthUplinkKhz) {
|
||||
if (cellBandwidthUplinkKhz < CELL_BANDWIDTH_UNKNOWN) {
|
||||
throw new IllegalArgumentException("Cell uplink bandwidth(kHz): "+
|
||||
cellBandwidthUplinkKhz +" is invalid.");
|
||||
}
|
||||
mCellBandwidthUplinkKhz = cellBandwidthUplinkKhz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public @NonNull Builder setCellConnectionStatus(int connectionStatus) {
|
||||
mCellConnectionStatus = connectionStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public @NonNull Builder setContextIds(int[] contextIds) {
|
||||
if (contextIds != null) Arrays.sort(contextIds);
|
||||
this.mContextIds = contextIds;
|
||||
mContextIds = contextIds;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPhysicalCellId(int physicalCellId) {
|
||||
this.mPhysicalCellId = physicalCellId;
|
||||
public @NonNull Builder setPhysicalCellId(int physicalCellId) {
|
||||
if (physicalCellId > PHYSICAL_CELL_ID_MAXIMUM_VALUE) {
|
||||
throw new IllegalArgumentException("Physical cell Id: " + physicalCellId +
|
||||
" is over limit.");
|
||||
}
|
||||
mPhysicalCellId = physicalCellId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public @NonNull Builder setBand(int band) {
|
||||
if (band <= BAND_UNKNOWN) {
|
||||
throw new IllegalArgumentException("Band: " + band +
|
||||
" is invalid.");
|
||||
}
|
||||
mBand = band;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2111,4 +2111,23 @@ public class ServiceState implements Parcelable {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The frequency range is valid or not.
|
||||
*
|
||||
* @param frequencyRange The frequency range {@link FrequencyRange}.
|
||||
* @return {@code true} if valid, {@code false} otherwise.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isFrequencyRangeValid(int frequencyRange) {
|
||||
if (frequencyRange == FREQUENCY_RANGE_LOW
|
||||
|| frequencyRange == FREQUENCY_RANGE_MID
|
||||
|| frequencyRange == FREQUENCY_RANGE_HIGH
|
||||
|| frequencyRange == FREQUENCY_RANGE_MMWAVE) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,10 +131,12 @@ import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
@@ -15185,4 +15187,17 @@ public class TelephonyManager {
|
||||
e.execute(() -> callback.onAuthenticationFailure(GBA_FAILURE_REASON_FEATURE_NOT_READY));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The network type is valid or not.
|
||||
*
|
||||
* @param networkType The network type {@link NetworkType}.
|
||||
* @return {@code true} if valid, {@code false} otherwise.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isNetworkTypeValid(@NetworkType int networkType) {
|
||||
return networkType >= TelephonyManager.NETWORK_TYPE_UNKNOWN &&
|
||||
networkType <= TelephonyManager.NETWORK_TYPE_NR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user