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

Commit 549493cc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS: UT error code and error String"

parents 5647a4cb e6dfcaaf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ public class CommandException extends RuntimeException {
        mError = e;
    }

    public CommandException(Error e, String errString) {
        super(errString);
        mError = e;
    }

    public static CommandException
    fromRilErrno(int ril_errno) {
        switch(ril_errno) {
+8 −9
Original line number Diff line number Diff line
@@ -918,7 +918,12 @@ public class ImsPhone extends ImsPhoneBase {

    /* package */
    CommandException getCommandException(int code) {
        Rlog.d(LOG_TAG, "getCommandException code=" + code);
        return getCommandException(code, null);
    }

    CommandException getCommandException(int code, String errorString) {
        Rlog.d(LOG_TAG, "getCommandException code= " + code
                + ", errorString= " + errorString);
        CommandException.Error error = CommandException.Error.GENERIC_FAILURE;

        switch(code) {
@@ -932,7 +937,7 @@ public class ImsPhone extends ImsPhoneBase {
                break;
        }

        return new CommandException(error);
        return new CommandException(error, errorString);
    }

    /* package */
@@ -940,7 +945,7 @@ public class ImsPhone extends ImsPhoneBase {
        CommandException ex = null;

        if (e instanceof ImsException) {
            ex = getCommandException(((ImsException)e).getCode());
            ex = getCommandException(((ImsException)e).getCode(), e.getMessage());
        } else {
            Rlog.d(LOG_TAG, "getCommandException generic failure");
            ex = new CommandException(CommandException.Error.GENERIC_FAILURE);
@@ -1154,15 +1159,9 @@ public class ImsPhone extends ImsPhoneBase {
    sendResponse(Message onComplete, Object result, Throwable e) {
        if (onComplete != null) {
            CommandException ex = null;
            ImsException imsEx = null;
            if (e != null) {
                if (e instanceof ImsException) {
                    imsEx = (ImsException) e;
                    AsyncResult.forMessage(onComplete, result, imsEx);
                } else {
                    ex = getCommandException(e);
                    AsyncResult.forMessage(onComplete, result, ex);
                }
            } else {
                AsyncResult.forMessage(onComplete, result, null);
            }