summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2011-02-02 14:19:55 -0800
committerWink Saville <wink@google.com>2011-02-02 14:19:55 -0800
commit1938e314e34fb11ec5398716dfe9704cea66e31e (patch)
treeacce2ccf3b45cfdb115d71831e08b087a1742f0c /telephony/java/android
parent2c507b92c242951e4fb2e807431c10d73e4bf778 (diff)
downloadframeworks_base-1938e314e34fb11ec5398716dfe9704cea66e31e.zip
frameworks_base-1938e314e34fb11ec5398716dfe9704cea66e31e.tar.gz
frameworks_base-1938e314e34fb11ec5398716dfe9704cea66e31e.tar.bz2
Have SmsMessage use getCurrentPhoneType
Although our first tablet doesn't support SMS messages there are testing scenarios where they can be used. To preserve proper behavior now that getPhoneType can return PHONE_TYPE_NONE use getCurrentPhoneType. bug: 3198435 Change-Id: I48ef294f563351c66971b4e89e6dcb3326b0ae92
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/SmsMessage.java26
-rw-r--r--telephony/java/android/telephony/gsm/SmsMessage.java22
2 files changed, 24 insertions, 24 deletions
diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java
index 0746562..93d89a7 100644
--- a/telephony/java/android/telephony/SmsMessage.java
+++ b/telephony/java/android/telephony/SmsMessage.java
@@ -124,7 +124,7 @@ public class SmsMessage {
*/
public static SmsMessage createFromPdu(byte[] pdu) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
@@ -146,7 +146,7 @@ public class SmsMessage {
*/
public static SmsMessage newFromCMT(String[] lines){
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
@@ -160,7 +160,7 @@ public class SmsMessage {
/** @hide */
protected static SmsMessage newFromCMTI(String line) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
@@ -174,7 +174,7 @@ public class SmsMessage {
/** @hide */
public static SmsMessage newFromCDS(String line) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
@@ -188,7 +188,7 @@ public class SmsMessage {
/** @hide */
public static SmsMessage newFromParcel(Parcel p) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
@@ -211,7 +211,7 @@ public class SmsMessage {
*/
public static SmsMessage createFromEfRecord(int index, byte[] data) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
@@ -229,7 +229,7 @@ public class SmsMessage {
* length in bytes (not hex chars) less the SMSC header
*/
public static int getTPLayerLengthForPDU(String pdu) {
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
@@ -265,7 +265,7 @@ public class SmsMessage {
* class).
*/
public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) {
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly) :
com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly);
@@ -288,7 +288,7 @@ public class SmsMessage {
* @hide
*/
public static ArrayList<String> fragmentText(String text) {
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false) :
com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false);
@@ -385,7 +385,7 @@ public class SmsMessage {
String destinationAddress, String message,
boolean statusReportRequested, byte[] header) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -410,7 +410,7 @@ public class SmsMessage {
public static SubmitPdu getSubmitPdu(String scAddress,
String destinationAddress, String message, boolean statusReportRequested) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -439,7 +439,7 @@ public class SmsMessage {
String destinationAddress, short destinationPort, byte[] data,
boolean statusReportRequested) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -708,7 +708,7 @@ public class SmsMessage {
* @hide
*/
private static final SmsMessageBase getSmsFacility(){
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return new com.android.internal.telephony.cdma.SmsMessage();
} else {
diff --git a/telephony/java/android/telephony/gsm/SmsMessage.java b/telephony/java/android/telephony/gsm/SmsMessage.java
index 0c63c37..6880175 100644
--- a/telephony/java/android/telephony/gsm/SmsMessage.java
+++ b/telephony/java/android/telephony/gsm/SmsMessage.java
@@ -154,7 +154,7 @@ public class SmsMessage {
@Deprecated
public static SmsMessage createFromPdu(byte[] pdu) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
@@ -177,7 +177,7 @@ public class SmsMessage {
@Deprecated
public static SmsMessage newFromCMT(String[] lines){
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
@@ -193,7 +193,7 @@ public class SmsMessage {
@Deprecated
protected static SmsMessage newFromCMTI(String line) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
@@ -209,7 +209,7 @@ public class SmsMessage {
@Deprecated
public static SmsMessage newFromCDS(String line) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
@@ -225,7 +225,7 @@ public class SmsMessage {
@Deprecated
public static SmsMessage newFromParcel(Parcel p) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
@@ -250,7 +250,7 @@ public class SmsMessage {
@Deprecated
public static SmsMessage createFromEfRecord(int index, byte[] data) {
SmsMessageBase wrappedMessage;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
@@ -270,7 +270,7 @@ public class SmsMessage {
*/
@Deprecated
public static int getTPLayerLengthForPDU(String pdu) {
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
@@ -367,7 +367,7 @@ public class SmsMessage {
String destinationAddress, String message,
boolean statusReportRequested, byte[] header) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -394,7 +394,7 @@ public class SmsMessage {
public static SubmitPdu getSubmitPdu(String scAddress,
String destinationAddress, String message, boolean statusReportRequested) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -425,7 +425,7 @@ public class SmsMessage {
String destinationAddress, short destinationPort, byte[] data,
boolean statusReportRequested) {
SubmitPduBase spb;
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
@@ -739,7 +739,7 @@ public class SmsMessage {
* @deprecated Use android.telephony.SmsMessage.
*/
private static final SmsMessageBase getSmsFacility(){
- int activePhone = TelephonyManager.getDefault().getPhoneType();
+ int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return new com.android.internal.telephony.cdma.SmsMessage();
} else {