1 /*
2  * Copyright (C) 2007 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 
17 package com.android.internal.telephony;
18 
19 import android.compat.annotation.UnsupportedAppUsage;
20 
21 /**
22  * Object returned by the RIL upon successful completion of sendSMS.
23  * Contains message reference and ackPdu.
24  *
25  */
26 public class SmsResponse {
27     public static final int NO_ERROR_CODE = -1;
28 
29     /** Message reference of the just-sent SMS. */
30     @UnsupportedAppUsage
31     int mMessageRef;
32     /** ackPdu for the just-sent SMS. */
33     @UnsupportedAppUsage
34     String mAckPdu;
35     /**
36      * errorCode: See 3GPP 27.005, 3.2.5 for GSM/UMTS,
37      * 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA, -1 if unknown or not applicable.
38      */
39     @UnsupportedAppUsage
40     public int mErrorCode;
41 
42     @UnsupportedAppUsage
SmsResponse(int messageRef, String ackPdu, int errorCode)43     public SmsResponse(int messageRef, String ackPdu, int errorCode) {
44         mMessageRef = messageRef;
45         mAckPdu = ackPdu;
46         mErrorCode = errorCode;
47     }
48 
49     @Override
toString()50     public String toString() {
51         String ret = "{ mMessageRef = " + mMessageRef
52                         + ", mErrorCode = " + mErrorCode
53                         + ", mAckPdu = " + mAckPdu
54                         + "}";
55         return ret;
56     }
57 }
58