Merge "Have SmsMessage use getCurrentPhoneType" into honeycomb
This commit is contained in:
@@ -124,7 +124,7 @@ public class SmsMessage {
|
|||||||
*/
|
*/
|
||||||
public static SmsMessage createFromPdu(byte[] pdu) {
|
public static SmsMessage createFromPdu(byte[] pdu) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
|
||||||
@@ -146,7 +146,7 @@ public class SmsMessage {
|
|||||||
*/
|
*/
|
||||||
public static SmsMessage newFromCMT(String[] lines){
|
public static SmsMessage newFromCMT(String[] lines){
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
|
||||||
@@ -160,7 +160,7 @@ public class SmsMessage {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
protected static SmsMessage newFromCMTI(String line) {
|
protected static SmsMessage newFromCMTI(String line) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
|
||||||
@@ -174,7 +174,7 @@ public class SmsMessage {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
public static SmsMessage newFromCDS(String line) {
|
public static SmsMessage newFromCDS(String line) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
|
||||||
@@ -188,7 +188,7 @@ public class SmsMessage {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
public static SmsMessage newFromParcel(Parcel p) {
|
public static SmsMessage newFromParcel(Parcel p) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
|
||||||
@@ -211,7 +211,7 @@ public class SmsMessage {
|
|||||||
*/
|
*/
|
||||||
public static SmsMessage createFromEfRecord(int index, byte[] data) {
|
public static SmsMessage createFromEfRecord(int index, byte[] data) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
|
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
|
* length in bytes (not hex chars) less the SMSC header
|
||||||
*/
|
*/
|
||||||
public static int getTPLayerLengthForPDU(String pdu) {
|
public static int getTPLayerLengthForPDU(String pdu) {
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
|
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
|
||||||
@@ -265,7 +265,7 @@ public class SmsMessage {
|
|||||||
* class).
|
* class).
|
||||||
*/
|
*/
|
||||||
public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) {
|
public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) {
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
|
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
|
||||||
com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly) :
|
com.android.internal.telephony.cdma.SmsMessage.calculateLength(msgBody, use7bitOnly) :
|
||||||
com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly);
|
com.android.internal.telephony.gsm.SmsMessage.calculateLength(msgBody, use7bitOnly);
|
||||||
@@ -288,7 +288,7 @@ public class SmsMessage {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static ArrayList<String> fragmentText(String text) {
|
public static ArrayList<String> fragmentText(String text) {
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
|
TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
|
||||||
com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false) :
|
com.android.internal.telephony.cdma.SmsMessage.calculateLength(text, false) :
|
||||||
com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false);
|
com.android.internal.telephony.gsm.SmsMessage.calculateLength(text, false);
|
||||||
@@ -385,7 +385,7 @@ public class SmsMessage {
|
|||||||
String destinationAddress, String message,
|
String destinationAddress, String message,
|
||||||
boolean statusReportRequested, byte[] header) {
|
boolean statusReportRequested, byte[] header) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -410,7 +410,7 @@ public class SmsMessage {
|
|||||||
public static SubmitPdu getSubmitPdu(String scAddress,
|
public static SubmitPdu getSubmitPdu(String scAddress,
|
||||||
String destinationAddress, String message, boolean statusReportRequested) {
|
String destinationAddress, String message, boolean statusReportRequested) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -439,7 +439,7 @@ public class SmsMessage {
|
|||||||
String destinationAddress, short destinationPort, byte[] data,
|
String destinationAddress, short destinationPort, byte[] data,
|
||||||
boolean statusReportRequested) {
|
boolean statusReportRequested) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -708,7 +708,7 @@ public class SmsMessage {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
private static final SmsMessageBase getSmsFacility(){
|
private static final SmsMessageBase getSmsFacility(){
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
return new com.android.internal.telephony.cdma.SmsMessage();
|
return new com.android.internal.telephony.cdma.SmsMessage();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static SmsMessage createFromPdu(byte[] pdu) {
|
public static SmsMessage createFromPdu(byte[] pdu) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
|
||||||
@@ -177,7 +177,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static SmsMessage newFromCMT(String[] lines){
|
public static SmsMessage newFromCMT(String[] lines){
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
|
||||||
@@ -193,7 +193,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
protected static SmsMessage newFromCMTI(String line) {
|
protected static SmsMessage newFromCMTI(String line) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
|
||||||
@@ -209,7 +209,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static SmsMessage newFromCDS(String line) {
|
public static SmsMessage newFromCDS(String line) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
|
||||||
@@ -225,7 +225,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static SmsMessage newFromParcel(Parcel p) {
|
public static SmsMessage newFromParcel(Parcel p) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
|
||||||
@@ -250,7 +250,7 @@ public class SmsMessage {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static SmsMessage createFromEfRecord(int index, byte[] data) {
|
public static SmsMessage createFromEfRecord(int index, byte[] data) {
|
||||||
SmsMessageBase wrappedMessage;
|
SmsMessageBase wrappedMessage;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
|
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
|
||||||
@@ -270,7 +270,7 @@ public class SmsMessage {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static int getTPLayerLengthForPDU(String pdu) {
|
public static int getTPLayerLengthForPDU(String pdu) {
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
|
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
|
||||||
@@ -367,7 +367,7 @@ public class SmsMessage {
|
|||||||
String destinationAddress, String message,
|
String destinationAddress, String message,
|
||||||
boolean statusReportRequested, byte[] header) {
|
boolean statusReportRequested, byte[] header) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -394,7 +394,7 @@ public class SmsMessage {
|
|||||||
public static SubmitPdu getSubmitPdu(String scAddress,
|
public static SubmitPdu getSubmitPdu(String scAddress,
|
||||||
String destinationAddress, String message, boolean statusReportRequested) {
|
String destinationAddress, String message, boolean statusReportRequested) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -425,7 +425,7 @@ public class SmsMessage {
|
|||||||
String destinationAddress, short destinationPort, byte[] data,
|
String destinationAddress, short destinationPort, byte[] data,
|
||||||
boolean statusReportRequested) {
|
boolean statusReportRequested) {
|
||||||
SubmitPduBase spb;
|
SubmitPduBase spb;
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
|
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
|
||||||
@@ -739,7 +739,7 @@ public class SmsMessage {
|
|||||||
* @deprecated Use android.telephony.SmsMessage.
|
* @deprecated Use android.telephony.SmsMessage.
|
||||||
*/
|
*/
|
||||||
private static final SmsMessageBase getSmsFacility(){
|
private static final SmsMessageBase getSmsFacility(){
|
||||||
int activePhone = TelephonyManager.getDefault().getPhoneType();
|
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
|
||||||
if (PHONE_TYPE_CDMA == activePhone) {
|
if (PHONE_TYPE_CDMA == activePhone) {
|
||||||
return new com.android.internal.telephony.cdma.SmsMessage();
|
return new com.android.internal.telephony.cdma.SmsMessage();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user