Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a9d38fb authored by Mohamed Abdalkader's avatar Mohamed Abdalkader Committed by android-build-merger
Browse files

Merge "Add more sms error codes"

am: c16da498

Change-Id: Id19bb14ebea3b0124af3a5990613a15d8c2fa44c
parents 1d2ddbb9 c16da498
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5250,7 +5250,9 @@ package android.telephony.ims.stub {
    method public final void onSmsReceived(int, java.lang.String, byte[]) throws java.lang.RuntimeException;
    method public final void onSmsStatusReportReceived(int, int, java.lang.String, byte[]) throws java.lang.RuntimeException;
    method public void sendSms(int, int, java.lang.String, java.lang.String, boolean, byte[]);
    field public static final int DELIVER_STATUS_ERROR = 2; // 0x2
    field public static final int DELIVER_STATUS_ERROR_GENERIC = 2; // 0x2
    field public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; // 0x3
    field public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; // 0x4
    field public static final int DELIVER_STATUS_OK = 1; // 0x1
    field public static final int SEND_STATUS_ERROR = 2; // 0x2
    field public static final int SEND_STATUS_ERROR_FALLBACK = 4; // 0x4
+18 −5
Original line number Diff line number Diff line
@@ -74,7 +74,9 @@ public class ImsSmsImplBase {
    /** @hide */
    @IntDef({
            DELIVER_STATUS_OK,
            DELIVER_STATUS_ERROR
            DELIVER_STATUS_ERROR_GENERIC,
            DELIVER_STATUS_ERROR_NO_MEMORY,
            DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED
        })
    @Retention(RetentionPolicy.SOURCE)
    public @interface DeliverStatusResult {}
@@ -86,7 +88,17 @@ public class ImsSmsImplBase {
    /**
     * Message was not delivered.
     */
    public static final int DELIVER_STATUS_ERROR = 2;
    public static final int DELIVER_STATUS_ERROR_GENERIC = 2;

    /**
     * Message was not delivered due to lack of memory.
     */
    public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3;

    /**
     * Message was not delivered as the request is not supported.
     */
    public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4;

    /** @hide */
    @IntDef({
@@ -106,7 +118,6 @@ public class ImsSmsImplBase {
     */
    public static final int STATUS_REPORT_STATUS_ERROR = 2;


    // Lock for feature synchronization
    private final Object mLock = new Object();
    private IImsSmsListener mListener;
@@ -157,7 +168,9 @@ public class ImsSmsImplBase {
     * @param token token provided in {@link #onSmsReceived(int, String, byte[])}
     * @param result result of delivering the message. Valid values are:
     *  {@link #DELIVER_STATUS_OK},
     *  {@link #DELIVER_STATUS_ERROR}
     *  {@link #DELIVER_STATUS_ERROR_GENERIC},
     *  {@link #DELIVER_STATUS_ERROR_NO_MEMORY},
     *  {@link #DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED}
     * @param messageRef the message reference
     */
    public void acknowledgeSms(int token, @DeliverStatusResult int messageRef, int result) {
@@ -202,7 +215,7 @@ public class ImsSmsImplBase {
                mListener.onSmsReceived(token, format, pdu);
            } catch (RemoteException e) {
                Log.e(LOG_TAG, "Can not deliver sms: " + e.getMessage());
                acknowledgeSms(token, 0, DELIVER_STATUS_ERROR);
                acknowledgeSms(token, 0, DELIVER_STATUS_ERROR_GENERIC);
            }
        }
    }