summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorStuart Scott <stuartscott@google.com>2014-12-04 15:01:31 -0800
committerStuart Scott <stuartscott@google.com>2014-12-05 20:28:14 +0000
commit997ddc8e3e4b9d4daa65294dbd5cc3ecfb79c101 (patch)
treed2053fc55ad5986901519c964464fabb68116ff9 /telephony/java
parent04c022f4c12a778027957a266dd9fce2b70a1cb0 (diff)
downloadframeworks_base-997ddc8e3e4b9d4daa65294dbd5cc3ecfb79c101.zip
frameworks_base-997ddc8e3e4b9d4daa65294dbd5cc3ecfb79c101.tar.gz
frameworks_base-997ddc8e3e4b9d4daa65294dbd5cc3ecfb79c101.tar.bz2
Add mapping between RAT and Network Mode
bug:18416275 bug:18415493 Change-Id: I0b29ec953ec9eb29248a22d582013127ee0fea41
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/RadioAccessFamily.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java
index dd4c45d..734fc68 100644
--- a/telephony/java/android/telephony/RadioAccessFamily.java
+++ b/telephony/java/android/telephony/RadioAccessFamily.java
@@ -19,6 +19,8 @@ package android.telephony;
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.internal.telephony.RILConstants;
+
/**
* Object to indicate the phone radio type and access technology.
*
@@ -107,6 +109,7 @@ public class RadioAccessFamily implements Parcelable {
* @param outParcel The Parcel in which the object should be written.
* @param flags Additional flags about how the object should be written.
*/
+ @Override
public void writeToParcel(Parcel outParcel, int flags) {
outParcel.writeInt(mPhoneId);
outParcel.writeInt(mRadioAccessFamily);
@@ -131,5 +134,18 @@ public class RadioAccessFamily implements Parcelable {
return new RadioAccessFamily[size];
}
};
+
+ public static int getRafFromNetworkType(int type) {
+ // TODO map from RILConstants.NETWORK_TYPE_* to RAF_*
+ switch (type) {
+ case RILConstants.NETWORK_MODE_WCDMA_PREF:
+ case RILConstants.NETWORK_MODE_GSM_UMTS:
+ return RAF_UMTS | RAF_GSM;
+ case RILConstants.NETWORK_MODE_GSM_ONLY:
+ return RAF_GSM;
+ default:
+ return RAF_UNKNOWN;
+ }
+ }
}