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

Commit 6208d3be authored by Tom Taylor's avatar Tom Taylor Committed by Android (Google) Code Review
Browse files

Merge "Use a consistent logging string for the xms message id"

parents 2589325c 9b13df29
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -538,7 +538,7 @@ public class IccSmsInterfaceManager {
                    + " text='" + text + "' sentIntent=" + sentIntent + " deliveryIntent="
                    + deliveryIntent + " priority=" + priority + " expectMore=" + expectMore
                    + " validityPeriod=" + validityPeriod + " isForVVM=" + isForVvm
                    + " id= " +  messageId);
                    + " " + SmsController.formatCrossStackMessageId(messageId));
        }
        notifyIfOutgoingEmergencySms(destAddr);
        destAddr = filterDestAddress(destAddr);
@@ -744,7 +744,7 @@ public class IccSmsInterfaceManager {
            for (String part : parts) {
                log("sendMultipartTextWithOptions: destAddr=" + destAddr + ", srAddr=" + scAddr
                        + ", part[" + (i++) + "]=" + part
                        + " id: " + messageId);
                        + " " + SmsController.formatCrossStackMessageId(messageId));
            }
        }
        notifyIfOutgoingEmergencySms(destAddr);
+10 −10
Original line number Diff line number Diff line
@@ -989,8 +989,8 @@ public abstract class InboundSmsHandler extends StateMachine {
                log("processMessagePart: all " + messageCount + " segments "
                        + " received. refNumber: " + refNumber, tracker.getMessageId());
            } catch (SQLException e) {
                loge("processMessagePart: Can't access multipart SMS database, id: "
                        + tracker.getMessageId(), e);
                loge("processMessagePart: Can't access multipart SMS database, "
                        + SmsController.formatCrossStackMessageId(tracker.getMessageId()), e);
                return false;
            } finally {
                if (cursor != null) {
@@ -1564,8 +1564,8 @@ public abstract class InboundSmsHandler extends StateMachine {
                    return Intents.RESULT_SMS_DUPLICATED;   // reject message
                }
            } catch (SQLException e) {
                loge("addTrackerToRawTable: Can't access SMS database, id: "
                        + tracker.getMessageId(), e);
                loge("addTrackerToRawTable: Can't access SMS database, "
                        + SmsController.formatCrossStackMessageId(tracker.getMessageId()), e);
                return RESULT_SMS_DATABASE_ERROR;    // reject message
            }
        } else {
@@ -1596,8 +1596,8 @@ public abstract class InboundSmsHandler extends StateMachine {
            }
            return Intents.RESULT_SMS_HANDLED;
        } catch (Exception e) {
            loge("addTrackerToRawTable: error parsing URI for new row: " + newUri + " id: "
                    + tracker.getMessageId(), e);
            loge("addTrackerToRawTable: error parsing URI for new row: " + newUri
                    + " " + SmsController.formatCrossStackMessageId(tracker.getMessageId()), e);
            return RESULT_SMS_INVALID_URI;
        }
    }
@@ -1812,7 +1812,7 @@ public abstract class InboundSmsHandler extends StateMachine {
     */
    protected void logWithLocalLog(String logMsg, long id) {
        log(logMsg, id);
        mLocalLog.log(logMsg + ", id: " + id);
        mLocalLog.log(logMsg + ", " + SmsController.formatCrossStackMessageId(id));
    }

    /**
@@ -1831,7 +1831,7 @@ public abstract class InboundSmsHandler extends StateMachine {
     */
    protected void logeWithLocalLog(String logMsg, long id) {
        loge(logMsg, id);
        mLocalLog.log(logMsg + ", id: " + id);
        mLocalLog.log(logMsg + ", " + SmsController.formatCrossStackMessageId(id));
    }

    /**
@@ -1850,7 +1850,7 @@ public abstract class InboundSmsHandler extends StateMachine {
     * @param id unique message id
     */
    protected void log(String s, long id) {
        log(s + ", id: " + id);
        log(s + ", " + SmsController.formatCrossStackMessageId(id));
    }

    /**
@@ -1869,7 +1869,7 @@ public abstract class InboundSmsHandler extends StateMachine {
     * @param id unique message id
     */
    protected void loge(String s, long id) {
        loge(s + ", id: " + id);
        loge(s + ", " + SmsController.formatCrossStackMessageId(id));
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -326,9 +326,9 @@ public class InboundSmsTracker {
            builder.append(") deleteArgs=(").append(Arrays.toString(mDeleteWhereArgs));
            builder.append(')');
        }
        builder.append(" id=");
        builder.append(mMessageId);
        builder.append('}');
        builder.append(" ");
        builder.append(SmsController.formatCrossStackMessageId(mMessageId));
        builder.append("}");
        return builder.toString();
    }

+2 −1
Original line number Diff line number Diff line
@@ -1759,7 +1759,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
        long messageId = ((SMSDispatcher.SmsTracker) result.obj).mMessageId;
        if (RILJ_LOGV) {
            Rlog.d(RILJ_LOG_TAG, "getOutgoingSmsMessageId messageId: " + messageId);
            Rlog.d(RILJ_LOG_TAG, "getOutgoingSmsMessageId "
                    + SmsController.formatCrossStackMessageId(messageId));
        }
        return messageId;
    }
+22 −15
Original line number Diff line number Diff line
@@ -447,7 +447,7 @@ public abstract class SMSDispatcher extends Handler {
                            mSenderCallback);
                } catch (RuntimeException e) {
                    Rlog.e(TAG, "Exception sending the SMS: " + e
                            + " id: " + mTracker.mMessageId);
                            + " " + SmsController.formatCrossStackMessageId(mTracker.mMessageId));
                    mSenderCallback.onSendSmsComplete(
                            CarrierMessagingService.SEND_STATUS_RETRY_ON_CARRIER_NETWORK,
                            0 /* messageRef */);
@@ -520,7 +520,8 @@ public abstract class SMSDispatcher extends Handler {
        switch (result) {
            case CarrierMessagingService.SEND_STATUS_OK:
                Rlog.d(TAG, "processSendSmsResponse: Sending SMS by CarrierMessagingService "
                        + "succeeded. id: " + tracker.mMessageId);
                        + "succeeded. "
                        + SmsController.formatCrossStackMessageId(tracker.mMessageId));
                sendMessage(obtainMessage(EVENT_SEND_SMS_COMPLETE,
                                          new AsyncResult(tracker,
                                                          smsResponse,
@@ -528,19 +529,21 @@ public abstract class SMSDispatcher extends Handler {
                break;
            case CarrierMessagingService.SEND_STATUS_ERROR:
                Rlog.d(TAG, "processSendSmsResponse: Sending SMS by CarrierMessagingService failed."
                        + " id: " + tracker.mMessageId);
                        + " " + SmsController.formatCrossStackMessageId(tracker.mMessageId));
                sendMessage(obtainMessage(EVENT_SEND_SMS_COMPLETE,
                        new AsyncResult(tracker, smsResponse,
                                new CommandException(CommandException.Error.GENERIC_FAILURE))));
                break;
            case CarrierMessagingService.SEND_STATUS_RETRY_ON_CARRIER_NETWORK:
                Rlog.d(TAG, "processSendSmsResponse: Sending SMS by CarrierMessagingService failed."
                        + " Retry on carrier network. id: " + tracker.mMessageId);
                        + " Retry on carrier network. "
                        + SmsController.formatCrossStackMessageId(tracker.mMessageId));
                sendSubmitPdu(tracker);
                break;
            default:
                Rlog.d(TAG, "processSendSmsResponse: Unknown result " + result + " Retry on carrier"
                        + " network. id: " + tracker.mMessageId);
                        + " network. "
                        + SmsController.formatCrossStackMessageId(tracker.mMessageId));
                sendSubmitPdu(tracker);
        }
    }
@@ -668,7 +671,8 @@ public abstract class SMSDispatcher extends Handler {
        switch (result) {
            case CarrierMessagingService.SEND_STATUS_OK:
                Rlog.d(TAG, "processSendMultipartSmsResponse: Sending SMS by "
                        + "CarrierMessagingService succeeded. id: " + trackers[0].mMessageId);
                        + "CarrierMessagingService succeeded. "
                        + SmsController.formatCrossStackMessageId(trackers[0].mMessageId));
                // Sending a multi-part SMS by CarrierMessagingService successfully completed.
                // Send EVENT_SEND_SMS_COMPLETE for all the parts one by one.
                for (int i = 0; i < trackers.length; i++) {
@@ -688,7 +692,8 @@ public abstract class SMSDispatcher extends Handler {
                break;
            case CarrierMessagingService.SEND_STATUS_ERROR:
                Rlog.d(TAG, "processSendMultipartSmsResponse: Sending SMS by "
                        + "CarrierMessagingService failed. id: " + trackers[0].mMessageId);
                        + "CarrierMessagingService failed. "
                        + SmsController.formatCrossStackMessageId(trackers[0].mMessageId));
                // Sending a multi-part SMS by CarrierMessagingService failed.
                // Send EVENT_SEND_SMS_COMPLETE with GENERIC_FAILURE for all the parts one by one.
                for (int i = 0; i < trackers.length; i++) {
@@ -709,15 +714,16 @@ public abstract class SMSDispatcher extends Handler {
                break;
            case CarrierMessagingService.SEND_STATUS_RETRY_ON_CARRIER_NETWORK:
                Rlog.d(TAG, "processSendMultipartSmsResponse: Sending SMS by "
                        + "CarrierMessagingService failed. Retry on carrier network. id: "
                        + trackers[0].mMessageId);
                        + "CarrierMessagingService failed. Retry on carrier network. "
                        + SmsController.formatCrossStackMessageId(trackers[0].mMessageId));
                // All the parts for a multi-part SMS are handled together for retry. It helps to
                // check user confirmation once also if needed.
                sendSubmitPdu(trackers);
                break;
            default:
                Rlog.d(TAG, "processSendMultipartSmsResponse: Unknown result " + result
                        + ". Retry on carrier network. id: " + trackers[0].mMessageId);
                        + ". Retry on carrier network. "
                        + SmsController.formatCrossStackMessageId(trackers[0].mMessageId));
                sendSubmitPdu(trackers);
        }
    }
@@ -767,7 +773,7 @@ public abstract class SMSDispatcher extends Handler {
        if (ar.exception == null) {
            if (DBG) {
                Rlog.d(TAG, "SMS send complete. Broadcasting intent: " + sentIntent
                        + " id: " + tracker.mMessageId);
                        + " " + SmsController.formatCrossStackMessageId(tracker.mMessageId));
            }

            if (tracker.mDeliveryIntent != null) {
@@ -786,7 +792,8 @@ public abstract class SMSDispatcher extends Handler {
                    tracker.isFromDefaultSmsApplication(mContext));
        } else {
            if (DBG) {
                Rlog.d(TAG, "SMS send failed id: " + tracker.mMessageId);
                Rlog.d(TAG, "SMS send failed "
                        + SmsController.formatCrossStackMessageId(tracker.mMessageId));
            }

            int ss = mPhone.getServiceState().getState();
@@ -803,7 +810,7 @@ public abstract class SMSDispatcher extends Handler {
                        + " mImsRetry=" + tracker.mImsRetry
                        + " mMessageRef=" + tracker.mMessageRef
                        + " SS= " + mPhone.getServiceState().getState()
                        + " id=" + tracker.mMessageId);
                        + " " + SmsController.formatCrossStackMessageId(tracker.mMessageId));
            }

            // if sms over IMS is not supported on data and voice is not available...
@@ -1642,7 +1649,7 @@ public abstract class SMSDispatcher extends Handler {
            mSmsDispatchersController.sendRetrySms(tracker);
        } else {
            Rlog.e(TAG, mSmsDispatchersController + " is null. Retry failed"
                    + " id: " + tracker.mMessageId);
                    + " " + SmsController.formatCrossStackMessageId(tracker.mMessageId));
        }
    }

@@ -1938,7 +1945,7 @@ public abstract class SMSDispatcher extends Handler {
                    mSentIntent.send(context, error, fillIn);
                } catch (CanceledException ex) {
                    Rlog.e(TAG, "Failed to send result"
                            + " id: " + mMessageId);
                            + " " + SmsController.formatCrossStackMessageId(mMessageId));
                }
            }
            reportAnomaly(error, errorCode);
Loading