From 0da3bdb476086db02a1076780676b21e239c79d6 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Tue, 28 Jul 2009 11:17:24 -0700 Subject: [PATCH] Fix public API caused due to CDMA changes. --- api/current.xml | 753 ++++++++++++++++++ .../java/android/telephony/SmsManager.java | 17 +- .../java/android/telephony/SmsMessage.java | 69 +- .../android/telephony/gsm/SmsManager.java | 1 + .../internal/telephony/SmsMessageBase.java | 1 + 5 files changed, 797 insertions(+), 44 deletions(-) diff --git a/api/current.xml b/api/current.xml index 4df50bc7cfc3a..abbc02fc7429c 100644 --- a/api/current.xml +++ b/api/current.xml @@ -113269,6 +113269,759 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PendingIntent is * broadcast when the message is delivered to the recipient. The * raw pdu of the status report is in the extended data ("pdu"). - * - * @hide */ private void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent, PendingIntent deliveryIntent) { @@ -252,6 +251,8 @@ public final class SmsManager { /** * Copy a raw SMS PDU to the ICC. + * ICC (Integrated Circuit Card) is the card of the device. + * For example, this can be the SIM or USIM for GSM. * * @param smsc the SMSC for this message, or NULL for the default SMSC * @param pdu the raw PDU to store @@ -278,6 +279,8 @@ public final class SmsManager { /** * Delete the specified message from the ICC. + * ICC (Integrated Circuit Card) is the card of the device. + * For example, this can be the SIM or USIM for GSM. * * @param messageIndex is the record index of the message on ICC * @return true for success @@ -304,6 +307,8 @@ public final class SmsManager { /** * Update the specified message on the ICC. + * ICC (Integrated Circuit Card) is the card of the device. + * For example, this can be the SIM or USIM for GSM. * * @param messageIndex record index of message to update * @param newStatus new message status (STATUS_ON_ICC_READ, @@ -331,6 +336,8 @@ public final class SmsManager { /** * Retrieves all messages currently stored on ICC. + * ICC (Integrated Circuit Card) is the card of the device. + * For example, this can be the SIM or USIM for GSM. * * @return ArrayList of SmsMessage objects * @@ -359,12 +366,12 @@ public final class SmsManager { * getAllMessagesFromIcc * @return ArrayList of SmsMessage objects. */ - private ArrayList createMessageListFromRawRecords(List records) { + private ArrayList createMessageListFromRawRecords(List records) { ArrayList messages = new ArrayList(); if (records != null) { int count = records.size(); for (int i = 0; i < count; i++) { - SmsRawData data = (SmsRawData)records.get(i); + SmsRawData data = records.get(i); // List contains all records, including "free" records (null) if (data != null) { SmsMessage sms = SmsMessage.createFromEfRecord(i+1, data.getBytes()); diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java index fc491d76b962e..0617dada43e61 100644 --- a/telephony/java/android/telephony/SmsMessage.java +++ b/telephony/java/android/telephony/SmsMessage.java @@ -28,13 +28,13 @@ import com.android.internal.telephony.SmsMessageBase.TextEncodingDetails; import java.lang.Math; import java.util.ArrayList; +import java.util.Arrays; import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA; /** * A Short Message Service message. - * @hide */ public class SmsMessage { private static final boolean LOCAL_DEBUG = true; @@ -49,18 +49,6 @@ public class SmsMessage { UNKNOWN, CLASS_0, CLASS_1, CLASS_2, CLASS_3; } - /** - * TODO(cleanup): given that we now have more than one possible - * 7bit encoding, this result starts to look rather vague and - * maybe confusing... If this is just an indication of code unit - * size, maybe that is no problem. Otherwise, should we try to - * create an aggregate collection of GSM and CDMA encodings? CDMA - * contains a superset of the encodings we use (it does not - * support 8-bit GSM, but we also do not use that encoding - * currently)... We could get rid of these and directly reference - * the CDMA encoding definitions... - */ - /** User data text encoding code unit size */ public static final int ENCODING_UNKNOWN = 0; public static final int ENCODING_7BIT = 1; @@ -70,25 +58,10 @@ public class SmsMessage { /** The maximum number of payload bytes per message */ public static final int MAX_USER_DATA_BYTES = 140; - /** - * TODO(cleanup): It would be more flexible and less fragile to - * rewrite this (meaning get rid of the following constant) such - * that an actual UDH is taken into consideration (meaning its - * length is measured), allowing for messages that actually - * contain other UDH fields... Hence it is actually a shame to - * extend the API with this constant. If necessary, maybe define - * the size of such a header and let the math for calculating - * max_octets/septets be done elsewhere. And, while I am griping, - * if we use the word septet, we should use the word octet in - * corresponding places, not byte... - */ - /** * The maximum number of payload bytes per message if a user data header * is present. This assumes the header only contains the * CONCATENATED_8_BIT_REFERENCE element. - * - * @hide pending API Council approval to extend the public API */ public static final int MAX_USER_DATA_BYTES_WITH_HEADER = 134; @@ -103,17 +76,26 @@ public class SmsMessage { public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153; /** Contains actual SmsMessage. Only public for debugging and for framework layer. - * {@hide} - */ + * + * @hide + */ public SmsMessageBase mWrappedSmsMessage; - public static class SubmitPdu extends SubmitPduBase { + public static class SubmitPdu { - //Constructor - public SubmitPdu() { + public byte[] encodedScAddress; // Null if not applicable. + public byte[] encodedMessage; + + public String toString() { + return "SubmitPdu: encodedScAddress = " + + Arrays.toString(encodedScAddress) + + ", encodedMessage = " + + Arrays.toString(encodedMessage); } - /* {@hide} */ + /** + * @hide + */ protected SubmitPdu(SubmitPduBase spb) { this.encodedMessage = spb.encodedMessage; this.encodedScAddress = spb.encodedScAddress; @@ -121,7 +103,11 @@ public class SmsMessage { } - // Constructor + /** + * Constructor + * + * @hide + */ public SmsMessage() { this(getSmsFacility()); } @@ -295,6 +281,8 @@ public class SmsMessage { * @param text text, must not be null. * @return an ArrayList of strings that, in order, * comprise the original msg text + * + * @hide */ public static ArrayList fragmentText(String text) { int activePhone = TelephonyManager.getDefault().getPhoneType(); @@ -343,10 +331,11 @@ public class SmsMessage { * current encoding. * * @param messageBody the message to encode - * @param use7bitOnly if true, characters that are not part of the GSM - * alphabet are counted as a single space char. If false, a - * messageBody containing non-GSM alphabet characters is calculated - * for 16-bit encoding. + * @param use7bitOnly if true, characters that are not part of the radio + * specific (GSM / CDMA) alphabet encoding are converted to as a + * single space characters. If false, a messageBody containing + * non-GSM or non-CDMA alphabet characters are encoded using + * 16-bit encoding. * @return an int[4] with int[0] being the number of SMS's required, int[1] * the number of code units used, and int[2] is the number of code * units remaining until the next message. int[3] is the encoding @@ -688,6 +677,8 @@ public class SmsMessage { /** This method returns the reference to a specific * SmsMessage object, which is used for accessing its static methods. * @return Specific SmsMessage. + * + * @hide */ private static final SmsMessageBase getSmsFacility(){ int activePhone = TelephonyManager.getDefault().getPhoneType(); diff --git a/telephony/java/android/telephony/gsm/SmsManager.java b/telephony/java/android/telephony/gsm/SmsManager.java index cdd707e629a22..241c4852c4eb1 100644 --- a/telephony/java/android/telephony/gsm/SmsManager.java +++ b/telephony/java/android/telephony/gsm/SmsManager.java @@ -43,6 +43,7 @@ import java.util.ArrayList; return sInstance; } + @Deprecated private SmsManager() { mSmsMgrProxy = android.telephony.SmsManager.getDefault(); } diff --git a/telephony/java/com/android/internal/telephony/SmsMessageBase.java b/telephony/java/com/android/internal/telephony/SmsMessageBase.java index 3c7dd458f94bf..8b9ccb4c636d8 100644 --- a/telephony/java/com/android/internal/telephony/SmsMessageBase.java +++ b/telephony/java/com/android/internal/telephony/SmsMessageBase.java @@ -118,6 +118,7 @@ public abstract class SmsMessageBase { public int codeUnitSize; } + // TODO(): This class is duplicated in SmsMessage.java. Refactor accordingly. public static abstract class SubmitPduBase { public byte[] encodedScAddress; // Null if not applicable. public byte[] encodedMessage;