diff options
author | Wink Saville <wink@google.com> | 2014-12-19 18:33:20 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-19 18:33:20 +0000 |
commit | 700b8f080ae39345b7174deea3c8acf6e1b51972 (patch) | |
tree | 00e3daaff0a4813403bf010aac3a70d0e55fcaf9 | |
parent | 7b727e2e0aedef50aba8e3d4081a643b79329497 (diff) | |
parent | 57859d704ef2bc61798c172c4524596393f0beef (diff) | |
download | frameworks_base-700b8f080ae39345b7174deea3c8acf6e1b51972.zip frameworks_base-700b8f080ae39345b7174deea3c8acf6e1b51972.tar.gz frameworks_base-700b8f080ae39345b7174deea3c8acf6e1b51972.tar.bz2 |
am 57859d70: am f73c2d1f: Update mapping between RAF and Network Type.
* commit '57859d704ef2bc61798c172c4524596393f0beef':
Update mapping between RAF and Network Type.
-rw-r--r-- | telephony/java/android/telephony/RadioAccessFamily.java | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java index 0820bfa..2c0ae8b 100644 --- a/telephony/java/android/telephony/RadioAccessFamily.java +++ b/telephony/java/android/telephony/RadioAccessFamily.java @@ -136,38 +136,57 @@ public class RadioAccessFamily implements Parcelable { }; public static int getRafFromNetworkType(int type) { + final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE; + final int HS = RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + final int CDMA = RAF_IS95A | RAF_IS95B | RAF_1xRTT; + final int EVDO = RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B; + final int WCDMA = HS | RAF_UMTS; + + int raf; + switch (type) { case RILConstants.NETWORK_MODE_WCDMA_PREF: - return RAF_GSM | RAF_UMTS | RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + raf = GSM | WCDMA; + break; case RILConstants.NETWORK_MODE_GSM_ONLY: - return RAF_GSM; + raf = GSM; + break; case RILConstants.NETWORK_MODE_WCDMA_ONLY: - return RAF_UMTS | RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + raf = WCDMA; + break; case RILConstants.NETWORK_MODE_GSM_UMTS: - return RAF_GSM | RAF_UMTS | RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + raf = GSM | WCDMA; + break; case RILConstants.NETWORK_MODE_CDMA: - return RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B | RAF_IS95A | RAF_IS95B | RAF_1xRTT; + raf = CDMA; + break; case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO: - return RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B | RAF_IS95A | RAF_IS95B | RAF_1xRTT - | RAF_EHRPD; + raf = RAF_LTE | CDMA | EVDO; + break; case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA: - return RAF_GSM | RAF_UMTS | RAF_LTE | RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + raf = RAF_LTE | GSM | WCDMA; + break; case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: - return RAF_GSM | RAF_UMTS | RAF_LTE | RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B - | RAF_IS95A | RAF_IS95B | RAF_1xRTT | RAF_EHRPD | RAF_HSUPA | RAF_HSDPA - | RAF_HSPA | RAF_HSPAP; + raf = RAF_LTE | CDMA | EVDO | GSM | WCDMA; + break; case RILConstants.NETWORK_MODE_LTE_ONLY: - return RAF_LTE; + raf = RAF_LTE; + break; case RILConstants.NETWORK_MODE_LTE_WCDMA: - return RAF_LTE | RAF_UMTS | RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP; + raf = RAF_LTE | WCDMA; + break; case RILConstants.NETWORK_MODE_CDMA_NO_EVDO: - return RAF_UNKNOWN; + raf = CDMA; + break; case RILConstants.NETWORK_MODE_EVDO_NO_CDMA: - return RAF_UNKNOWN; + raf = EVDO; + break; case RILConstants.NETWORK_MODE_GLOBAL: - return RAF_UNKNOWN; + raf = GSM | WCDMA | CDMA | EVDO; + break; default: - return RAF_UNKNOWN; + raf = RAF_UNKNOWN; + break; } } } |