1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.telephony.gsm;
18
19import android.os.Parcel;
20import android.telephony.TelephonyManager;
21
22import com.android.internal.telephony.GsmAlphabet;
23import com.android.internal.telephony.EncodeException;
24import com.android.internal.telephony.SmsHeader;
25import com.android.internal.telephony.SmsMessageBase;
26import com.android.internal.telephony.SmsMessageBase.SubmitPduBase;
27
28import java.util.Arrays;
29
30import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;
31
32
33/**
34 * A Short Message Service message.
35 * @deprecated Replaced by android.telephony.SmsMessage that supports both GSM and CDMA.
36 */
37@Deprecated
38public class SmsMessage {
39    private static final boolean LOCAL_DEBUG = true;
40    private static final String LOG_TAG = "SMS";
41
42    /**
43     * SMS Class enumeration.
44     * See TS 23.038.
45     * @deprecated Use android.telephony.SmsMessage.
46     */
47    @Deprecated
48    public enum MessageClass{
49        UNKNOWN, CLASS_0, CLASS_1, CLASS_2, CLASS_3;
50    }
51
52    /** Unknown encoding scheme (see TS 23.038)
53     * @deprecated Use android.telephony.SmsMessage.
54     */
55    @Deprecated public static final int ENCODING_UNKNOWN = 0;
56
57    /** 7-bit encoding scheme (see TS 23.038)
58     * @deprecated Use android.telephony.SmsMessage.
59     */
60    @Deprecated public static final int ENCODING_7BIT = 1;
61
62    /** 8-bit encoding scheme (see TS 23.038)
63     * @deprecated Use android.telephony.SmsMessage.
64     */
65    @Deprecated public static final int ENCODING_8BIT = 2;
66
67    /** 16-bit encoding scheme (see TS 23.038)
68     * @deprecated Use android.telephony.SmsMessage.
69     */
70    @Deprecated public static final int ENCODING_16BIT = 3;
71
72    /** The maximum number of payload bytes per message
73     * @deprecated Use android.telephony.SmsMessage.
74     */
75    @Deprecated public static final int MAX_USER_DATA_BYTES = 140;
76
77    /**
78     * The maximum number of payload bytes per message if a user data header
79     * is present.  This assumes the header only contains the
80     * CONCATENATED_8_BIT_REFERENCE element.
81     *
82     * @deprecated Use android.telephony.SmsMessage.
83     * @hide pending API Council approval to extend the public API
84     */
85    @Deprecated public static final int MAX_USER_DATA_BYTES_WITH_HEADER = 134;
86
87    /** The maximum number of payload septets per message
88     * @deprecated Use android.telephony.SmsMessage.
89     */
90    @Deprecated public static final int MAX_USER_DATA_SEPTETS = 160;
91
92    /**
93     * The maximum number of payload septets per message if a user data header
94     * is present.  This assumes the header only contains the
95     * CONCATENATED_8_BIT_REFERENCE element.
96     * @deprecated Use android.telephony.SmsMessage.
97     */
98    @Deprecated public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153;
99
100    /** Contains actual SmsMessage. Only public for debugging and for framework layer.
101     * @deprecated Use android.telephony.SmsMessage.
102     * {@hide}
103     */
104    @Deprecated public SmsMessageBase mWrappedSmsMessage;
105
106    /** @deprecated Use android.telephony.SmsMessage. */
107    @Deprecated
108    public static class SubmitPdu {
109        /** @deprecated Use android.telephony.SmsMessage. */
110        @Deprecated public byte[] encodedScAddress; // Null if not applicable.
111        /** @deprecated Use android.telephony.SmsMessage. */
112        @Deprecated public byte[] encodedMessage;
113
114        //Constructor
115        /** @deprecated Use android.telephony.SmsMessage. */
116        @Deprecated
117        public SubmitPdu() {
118        }
119
120        /** @deprecated Use android.telephony.SmsMessage.
121         * {@hide}
122         */
123        @Deprecated
124        protected SubmitPdu(SubmitPduBase spb) {
125            this.encodedMessage = spb.encodedMessage;
126            this.encodedScAddress = spb.encodedScAddress;
127        }
128
129        /** @deprecated Use android.telephony.SmsMessage. */
130        @Deprecated
131        public String toString() {
132            return "SubmitPdu: encodedScAddress = "
133                    + Arrays.toString(encodedScAddress)
134                    + ", encodedMessage = "
135                    + Arrays.toString(encodedMessage);
136        }
137    }
138
139    // Constructor
140    /** @deprecated Use android.telephony.SmsMessage. */
141    @Deprecated
142    public SmsMessage() {
143        this(getSmsFacility());
144    }
145
146    private SmsMessage(SmsMessageBase smb) {
147        mWrappedSmsMessage = smb;
148    }
149
150    /**
151     * Create an SmsMessage from a raw PDU.
152     * @deprecated Use android.telephony.SmsMessage.
153     */
154    @Deprecated
155    public static SmsMessage createFromPdu(byte[] pdu) {
156        SmsMessageBase wrappedMessage;
157        int activePhone = TelephonyManager.getDefault().getPhoneType();
158
159        if (PHONE_TYPE_CDMA == activePhone) {
160            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
161        } else {
162            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pdu);
163        }
164
165        return new SmsMessage(wrappedMessage);
166    }
167
168    /**
169     * TS 27.005 3.4.1 lines[0] and lines[1] are the two lines read from the
170     * +CMT unsolicited response (PDU mode, of course)
171     *  +CMT: [&lt;alpha>],<length><CR><LF><pdu>
172     *
173     * Only public for debugging and for RIL
174     * @deprecated Use android.telephony.SmsMessage.
175     * {@hide}
176     */
177    @Deprecated
178    public static SmsMessage newFromCMT(String[] lines){
179        SmsMessageBase wrappedMessage;
180        int activePhone = TelephonyManager.getDefault().getPhoneType();
181
182        if (PHONE_TYPE_CDMA == activePhone) {
183            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMT(lines);
184        } else {
185            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.newFromCMT(lines);
186        }
187
188        return new SmsMessage(wrappedMessage);
189    }
190
191    /** @deprecated Use android.telephony.SmsMessage.
192     *  @hide */
193    @Deprecated
194    protected static SmsMessage newFromCMTI(String line) {
195        SmsMessageBase wrappedMessage;
196        int activePhone = TelephonyManager.getDefault().getPhoneType();
197
198        if (PHONE_TYPE_CDMA == activePhone) {
199            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCMTI(line);
200        } else {
201            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.newFromCMTI(line);
202        }
203
204        return new SmsMessage(wrappedMessage);
205    }
206
207    /** @deprecated Use android.telephony.SmsMessage.
208     *  @hide */
209    @Deprecated
210    public static SmsMessage newFromCDS(String line) {
211        SmsMessageBase wrappedMessage;
212        int activePhone = TelephonyManager.getDefault().getPhoneType();
213
214        if (PHONE_TYPE_CDMA == activePhone) {
215            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromCDS(line);
216        } else {
217            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.newFromCDS(line);
218        }
219
220        return new SmsMessage(wrappedMessage);
221    }
222
223    /** @deprecated Use android.telephony.SmsMessage.
224     *  @hide */
225    @Deprecated
226    public static SmsMessage newFromParcel(Parcel p) {
227        SmsMessageBase wrappedMessage;
228        int activePhone = TelephonyManager.getDefault().getPhoneType();
229
230        if (PHONE_TYPE_CDMA == activePhone) {
231            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.newFromParcel(p);
232        } else {
233            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.newFromParcel(p);
234        }
235
236        return new SmsMessage(wrappedMessage);
237    }
238
239    /**
240     * Create an SmsMessage from an SMS EF record.
241     *
242     * @param index Index of SMS record. This should be index in ArrayList
243     *              returned by SmsManager.getAllMessagesFromSim + 1.
244     * @param data Record data.
245     * @return An SmsMessage representing the record.
246     *
247     * @deprecated Use android.telephony.SmsMessage.
248     * @hide
249     */
250    @Deprecated
251    public static SmsMessage createFromEfRecord(int index, byte[] data) {
252        SmsMessageBase wrappedMessage;
253        int activePhone = TelephonyManager.getDefault().getPhoneType();
254
255        if (PHONE_TYPE_CDMA == activePhone) {
256            wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromEfRecord(
257                    index, data);
258        } else {
259            wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.createFromEfRecord(
260                    index, data);
261        }
262
263        return new SmsMessage(wrappedMessage);
264    }
265
266    /**
267     * Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the
268     * length in bytes (not hex chars) less the SMSC header
269     * @deprecated Use android.telephony.SmsMessage.
270     */
271    @Deprecated
272    public static int getTPLayerLengthForPDU(String pdu) {
273        int activePhone = TelephonyManager.getDefault().getPhoneType();
274
275        if (PHONE_TYPE_CDMA == activePhone) {
276            return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
277        } else {
278            return com.android.internal.telephony.gsm.SmsMessage.getTPLayerLengthForPDU(pdu);
279        }
280    }
281
282    /**
283     * Calculates the number of SMS's required to encode the message body and
284     * the number of characters remaining until the next message, given the
285     * current encoding.
286     *
287     * @param messageBody the message to encode
288     * @param use7bitOnly if true, characters that are not part of the GSM
289     *         alphabet are counted as a single space char.  If false, a
290     *         messageBody containing non-GSM alphabet characters is calculated
291     *         for 16-bit encoding.
292     * @return an int[4] with int[0] being the number of SMS's required, int[1]
293     *         the number of code units used, and int[2] is the number of code
294     *         units remaining until the next message. int[3] is the encoding
295     *         type that should be used for the message.
296     * @deprecated Use android.telephony.SmsMessage.
297     */
298    @Deprecated
299    public static int[] calculateLength(CharSequence messageBody, boolean use7bitOnly) {
300        SmsMessageBase.TextEncodingDetails ted =
301                com.android.internal.telephony.gsm.SmsMessage
302                        .calculateLength(messageBody, use7bitOnly);
303        int ret[] = new int[4];
304        ret[0] = ted.msgCount;
305        ret[1] = ted.codeUnitCount;
306        ret[2] = ted.codeUnitsRemaining;
307        ret[3] = ted.codeUnitSize;
308        return ret;
309    }
310
311    /**
312     * Calculates the number of SMS's required to encode the message body and
313     * the number of characters remaining until the next message, given the
314     * current encoding.
315     *
316     * @param messageBody the message to encode
317     * @param use7bitOnly if true, characters that are not part of the GSM
318     *         alphabet are counted as a single space char.  If false, a
319     *         messageBody containing non-GSM alphabet characters is calculated
320     *         for 16-bit encoding.
321     * @return an int[4] with int[0] being the number of SMS's required, int[1]
322     *         the number of code units used, and int[2] is the number of code
323     *         units remaining until the next message. int[3] is the encoding
324     *         type that should be used for the message.
325     * @deprecated Use android.telephony.SmsMessage.
326     */
327    @Deprecated
328    public static int[] calculateLength(String messageBody, boolean use7bitOnly) {
329        return calculateLength((CharSequence)messageBody, use7bitOnly);
330    }
331
332    /**
333     * Get an SMS-SUBMIT PDU for a destination address and a message
334     *
335     * @param scAddress Service Centre address.  Null means use default.
336     * @return a <code>SubmitPdu</code> containing the encoded SC
337     *         address, if applicable, and the encoded message.
338     *         Returns null on encode error.
339     * @deprecated Use android.telephony.SmsMessage.
340     * @hide
341     */
342    @Deprecated
343    public static SubmitPdu getSubmitPdu(String scAddress,
344            String destinationAddress, String message,
345            boolean statusReportRequested, byte[] header) {
346        SubmitPduBase spb;
347        int activePhone = TelephonyManager.getDefault().getPhoneType();
348
349        if (PHONE_TYPE_CDMA == activePhone) {
350            spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
351                    destinationAddress, message, statusReportRequested,
352                    SmsHeader.fromByteArray(header));
353        } else {
354            spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
355                    destinationAddress, message, statusReportRequested, header);
356        }
357
358        return new SubmitPdu(spb);
359    }
360
361    /**
362     * Get an SMS-SUBMIT PDU for a destination address and a message
363     *
364     * @param scAddress Service Centre address.  Null means use default.
365     * @return a <code>SubmitPdu</code> containing the encoded SC
366     *         address, if applicable, and the encoded message.
367     *         Returns null on encode error.
368     * @deprecated Use android.telephony.SmsMessage.
369     */
370    @Deprecated
371    public static SubmitPdu getSubmitPdu(String scAddress,
372            String destinationAddress, String message, boolean statusReportRequested) {
373        SubmitPduBase spb;
374        int activePhone = TelephonyManager.getDefault().getPhoneType();
375
376        if (PHONE_TYPE_CDMA == activePhone) {
377            spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
378                    destinationAddress, message, statusReportRequested, null);
379        } else {
380            spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
381                    destinationAddress, message, statusReportRequested);
382        }
383
384        return new SubmitPdu(spb);
385    }
386
387    /**
388     * Get an SMS-SUBMIT PDU for a data message to a destination address &amp; port
389     *
390     * @param scAddress Service Centre address. null == use default
391     * @param destinationAddress the address of the destination for the message
392     * @param destinationPort the port to deliver the message to at the
393     *        destination
394     * @param data the dat for the message
395     * @return a <code>SubmitPdu</code> containing the encoded SC
396     *         address, if applicable, and the encoded message.
397     *         Returns null on encode error.
398     * @deprecated Use android.telephony.SmsMessage.
399     */
400    @Deprecated
401    public static SubmitPdu getSubmitPdu(String scAddress,
402            String destinationAddress, short destinationPort, byte[] data,
403            boolean statusReportRequested) {
404        SubmitPduBase spb;
405        int activePhone = TelephonyManager.getDefault().getPhoneType();
406
407        if (PHONE_TYPE_CDMA == activePhone) {
408            spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
409                    destinationAddress, destinationPort, data, statusReportRequested);
410        } else {
411            spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
412                    destinationAddress, destinationPort, data, statusReportRequested);
413        }
414
415        return new SubmitPdu(spb);
416    }
417
418    /**
419     * Returns the address of the SMS service center that relayed this message
420     * or null if there is none.
421     * @deprecated Use android.telephony.SmsMessage.
422     */
423    @Deprecated
424    public String getServiceCenterAddress() {
425        return mWrappedSmsMessage.getServiceCenterAddress();
426    }
427
428    /**
429     * Returns the originating address (sender) of this SMS message in String
430     * form or null if unavailable
431     * @deprecated Use android.telephony.SmsMessage.
432     */
433    @Deprecated
434    public String getOriginatingAddress() {
435        return mWrappedSmsMessage.getOriginatingAddress();
436    }
437
438    /**
439     * Returns the originating address, or email from address if this message
440     * was from an email gateway. Returns null if originating address
441     * unavailable.
442     * @deprecated Use android.telephony.SmsMessage.
443     */
444    @Deprecated
445    public String getDisplayOriginatingAddress() {
446        return mWrappedSmsMessage.getDisplayOriginatingAddress();
447    }
448
449    /**
450     * Returns the message body as a String, if it exists and is text based.
451     * @return message body is there is one, otherwise null
452     * @deprecated Use android.telephony.SmsMessage.
453     */
454    @Deprecated
455    public String getMessageBody() {
456        return mWrappedSmsMessage.getMessageBody();
457    }
458
459    /**
460     * Returns the class of this message.
461     * @deprecated Use android.telephony.SmsMessage.
462     */
463    @Deprecated
464    public MessageClass getMessageClass() {
465        int index = mWrappedSmsMessage.getMessageClass().ordinal();
466
467        return MessageClass.values()[index];
468    }
469
470    /**
471     * Returns the message body, or email message body if this message was from
472     * an email gateway. Returns null if message body unavailable.
473     * @deprecated Use android.telephony.SmsMessage.
474     */
475    @Deprecated
476    public String getDisplayMessageBody() {
477        return mWrappedSmsMessage.getDisplayMessageBody();
478    }
479
480    /**
481     * Unofficial convention of a subject line enclosed in parens empty string
482     * if not present
483     * @deprecated Use android.telephony.SmsMessage.
484     */
485    @Deprecated
486    public String getPseudoSubject() {
487        return mWrappedSmsMessage.getPseudoSubject();
488    }
489
490    /**
491     * Returns the service centre timestamp in currentTimeMillis() format
492     * @deprecated Use android.telephony.SmsMessage.
493     */
494    @Deprecated
495    public long getTimestampMillis() {
496        return mWrappedSmsMessage.getTimestampMillis();
497    }
498
499    /**
500     * Returns true if message is an email.
501     *
502     * @return true if this message came through an email gateway and email
503     *         sender / subject / parsed body are available
504     * @deprecated Use android.telephony.SmsMessage.
505     */
506    @Deprecated
507    public boolean isEmail() {
508        return mWrappedSmsMessage.isEmail();
509    }
510
511     /**
512     * @return if isEmail() is true, body of the email sent through the gateway.
513     *         null otherwise
514     * @deprecated Use android.telephony.SmsMessage.
515     */
516    @Deprecated
517    public String getEmailBody() {
518        return mWrappedSmsMessage.getEmailBody();
519    }
520
521    /**
522     * @return if isEmail() is true, email from address of email sent through
523     *         the gateway. null otherwise
524     * @deprecated Use android.telephony.SmsMessage.
525     */
526    @Deprecated
527    public String getEmailFrom() {
528        return mWrappedSmsMessage.getEmailFrom();
529    }
530
531    /**
532     * Get protocol identifier.
533     * @deprecated Use android.telephony.SmsMessage.
534     */
535    @Deprecated
536    public int getProtocolIdentifier() {
537        return mWrappedSmsMessage.getProtocolIdentifier();
538    }
539
540    /**
541     * See TS 23.040 9.2.3.9 returns true if this is a "replace short message" SMS
542     * @deprecated Use android.telephony.SmsMessage.
543     */
544    @Deprecated
545    public boolean isReplace() {
546        return mWrappedSmsMessage.isReplace();
547    }
548
549    /**
550     * Returns true for CPHS MWI toggle message.
551     *
552     * @return true if this is a CPHS MWI toggle message See CPHS 4.2 section B.4.2
553     * @deprecated Use android.telephony.SmsMessage.
554     */
555    @Deprecated
556    public boolean isCphsMwiMessage() {
557        return mWrappedSmsMessage.isCphsMwiMessage();
558    }
559
560    /**
561     * returns true if this message is a CPHS voicemail / message waiting
562     * indicator (MWI) clear message
563     * @deprecated Use android.telephony.SmsMessage.
564     */
565    @Deprecated
566    public boolean isMWIClearMessage() {
567        return mWrappedSmsMessage.isMWIClearMessage();
568    }
569
570    /**
571     * returns true if this message is a CPHS voicemail / message waiting
572     * indicator (MWI) set message
573     * @deprecated Use android.telephony.SmsMessage.
574     */
575    @Deprecated
576    public boolean isMWISetMessage() {
577        return mWrappedSmsMessage.isMWISetMessage();
578    }
579
580    /**
581     * returns true if this message is a "Message Waiting Indication Group:
582     * Discard Message" notification and should not be stored.
583     * @deprecated Use android.telephony.SmsMessage.
584     */
585    @Deprecated
586    public boolean isMwiDontStore() {
587        return mWrappedSmsMessage.isMwiDontStore();
588    }
589
590    /**
591     * returns the user data section minus the user data header if one was present.
592     * @deprecated Use android.telephony.SmsMessage.
593     */
594    @Deprecated
595    public byte[] getUserData() {
596        return mWrappedSmsMessage.getUserData();
597    }
598
599    /* Not part of the SDK interface and only needed by specific classes:
600       protected SmsHeader getUserDataHeader()
601    */
602
603    /**
604     * Returns the raw PDU for the message.
605     *
606     * @return the raw PDU for the message.
607     * @deprecated Use android.telephony.SmsMessage.
608     */
609    @Deprecated
610    public byte[] getPdu() {
611        return mWrappedSmsMessage.getPdu();
612    }
613
614    /**
615     * Returns the status of the message on the SIM (read, unread, sent, unsent).
616     *
617     * @return the status of the message on the SIM.  These are:
618     *         SmsManager.STATUS_ON_SIM_FREE
619     *         SmsManager.STATUS_ON_SIM_READ
620     *         SmsManager.STATUS_ON_SIM_UNREAD
621     *         SmsManager.STATUS_ON_SIM_SEND
622     *         SmsManager.STATUS_ON_SIM_UNSENT
623     * @deprecated Use android.telephony.SmsMessage and getStatusOnIcc instead.
624     */
625    @Deprecated
626    public int getStatusOnSim() {
627        return mWrappedSmsMessage.getStatusOnIcc();
628    }
629
630    /**
631     * Returns the status of the message on the ICC (read, unread, sent, unsent).
632     *
633     * @return the status of the message on the ICC.  These are:
634     *         SmsManager.STATUS_ON_ICC_FREE
635     *         SmsManager.STATUS_ON_ICC_READ
636     *         SmsManager.STATUS_ON_ICC_UNREAD
637     *         SmsManager.STATUS_ON_ICC_SEND
638     *         SmsManager.STATUS_ON_ICC_UNSENT
639     * @deprecated Use android.telephony.SmsMessage.
640     * @hide
641     */
642    @Deprecated
643    public int getStatusOnIcc() {
644
645        return mWrappedSmsMessage.getStatusOnIcc();
646    }
647
648    /**
649     * Returns the record index of the message on the SIM (1-based index).
650     * @return the record index of the message on the SIM, or -1 if this
651     *         SmsMessage was not created from a SIM SMS EF record.
652     * @deprecated Use android.telephony.SmsMessage and getIndexOnIcc instead.
653     */
654    @Deprecated
655    public int getIndexOnSim() {
656        return mWrappedSmsMessage.getIndexOnIcc();
657    }
658
659    /**
660     * Returns the record index of the message on the ICC (1-based index).
661     * @return the record index of the message on the ICC, or -1 if this
662     *         SmsMessage was not created from a ICC SMS EF record.
663     * @deprecated Use android.telephony.SmsMessage.
664     * @hide
665     */
666    @Deprecated
667    public int getIndexOnIcc() {
668
669        return mWrappedSmsMessage.getIndexOnIcc();
670    }
671
672    /**
673     * GSM:
674     * For an SMS-STATUS-REPORT message, this returns the status field from
675     * the status report.  This field indicates the status of a previously
676     * submitted SMS, if requested.  See TS 23.040, 9.2.3.15 TP-Status for a
677     * description of values.
678     * CDMA:
679     * For not interfering with status codes from GSM, the value is
680     * shifted to the bits 31-16.
681     * The value is composed of an error class (bits 25-24) and a status code (bits 23-16).
682     * Possible codes are described in C.S0015-B, v2.0, 4.5.21.
683     *
684     * @return 0 indicates the previously sent message was received.
685     *         See TS 23.040, 9.9.2.3.15 and C.S0015-B, v2.0, 4.5.21
686     *         for a description of other possible values.
687     * @deprecated Use android.telephony.SmsMessage.
688     */
689    @Deprecated
690    public int getStatus() {
691        return mWrappedSmsMessage.getStatus();
692    }
693
694    /**
695     * Return true iff the message is a SMS-STATUS-REPORT message.
696     * @deprecated Use android.telephony.SmsMessage.
697     */
698    @Deprecated
699    public boolean isStatusReportMessage() {
700        return mWrappedSmsMessage.isStatusReportMessage();
701    }
702
703    /**
704     * Returns true iff the <code>TP-Reply-Path</code> bit is set in
705     * this message.
706     * @deprecated Use android.telephony.SmsMessage.
707     */
708    @Deprecated
709    public boolean isReplyPathPresent() {
710        return mWrappedSmsMessage.isReplyPathPresent();
711    }
712
713    /** This method returns the reference to a specific
714     *  SmsMessage object, which is used for accessing its static methods.
715     * @return Specific SmsMessage.
716     * @deprecated Use android.telephony.SmsMessage.
717     */
718    private static final SmsMessageBase getSmsFacility(){
719        int activePhone = TelephonyManager.getDefault().getPhoneType();
720        if (PHONE_TYPE_CDMA == activePhone) {
721            return new com.android.internal.telephony.cdma.SmsMessage();
722        } else {
723            return new com.android.internal.telephony.gsm.SmsMessage();
724        }
725    }
726}
727