diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2009-07-28 11:17:24 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2009-07-30 12:37:43 -0700 |
commit | 0da3bdb476086db02a1076780676b21e239c79d6 (patch) | |
tree | f658147f459c12abbf3976c7e02a187677df5b89 /telephony | |
parent | 6af2552d244ff933dfd54570121db455cc7c3cda (diff) | |
download | frameworks_base-0da3bdb476086db02a1076780676b21e239c79d6.zip frameworks_base-0da3bdb476086db02a1076780676b21e239c79d6.tar.gz frameworks_base-0da3bdb476086db02a1076780676b21e239c79d6.tar.bz2 |
Fix public API caused due to CDMA changes.
Diffstat (limited to 'telephony')
4 files changed, 44 insertions, 44 deletions
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 890f930..82539fb 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -40,7 +40,6 @@ import java.util.List; /** * Manages SMS operations such as sending data, text, and pdu SMS messages. * Get this object by calling the static method SmsManager.getDefault(). - * @hide */ public final class SmsManager { private static SmsManager sInstance; @@ -202,6 +201,8 @@ public final class SmsManager { /** * Send a raw SMS PDU. + * A PDU is a protocol data unit. It contains the message and the + * associated meta information. * * @param smsc the SMSC to send the message through, or NULL for the * default SMSC @@ -219,8 +220,6 @@ public final class SmsManager { * @param deliveryIntent if not NULL this <code>PendingIntent</code> 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 <code>ArrayList</code> of <code>SmsMessage</code> objects * @@ -359,12 +366,12 @@ public final class SmsManager { * <code>getAllMessagesFromIcc</code> * @return <code>ArrayList</code> of <code>SmsMessage</code> objects. */ - private ArrayList<SmsMessage> createMessageListFromRawRecords(List records) { + private ArrayList<SmsMessage> createMessageListFromRawRecords(List<SmsRawData> records) { ArrayList<SmsMessage> messages = new ArrayList<SmsMessage>(); 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 fc491d7..0617dad 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; @@ -71,24 +59,9 @@ public class SmsMessage { 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 <code>ArrayList</code> of strings that, in order, * comprise the original msg text + * + * @hide */ public static ArrayList<String> 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 cdd707e..241c485 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 3c7dd45..8b9ccb4 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; |