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

Commit 1befe1a2 authored by Tom Taylor's avatar Tom Taylor
Browse files

Use a consistent logging string for the xms message id

Test: Manually tested sending/receiving SMSs and MMSs

Change-Id: I1da954eaeb482bca3d1b5168118fe57c592927e6
parent d2d9390f
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -638,7 +638,7 @@ public final class SmsManager {
                                persistMessage, messageId);
                                persistMessage, messageId);
                    } catch (RemoteException e) {
                    } catch (RemoteException e) {
                        Log.e(TAG, "sendTextMessageInternal: Couldn't send SMS, exception - "
                        Log.e(TAG, "sendTextMessageInternal: Couldn't send SMS, exception - "
                                + e.getMessage() + " id: " + messageId);
                                + e.getMessage() + " " + formatCrossStackMessageId(messageId));
                        notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
                        notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
                    }
                    }
                }
                }
@@ -658,7 +658,7 @@ public final class SmsManager {
                        persistMessage, messageId);
                        persistMessage, messageId);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, "sendTextMessageInternal (no persist): Couldn't send SMS, exception - "
                Log.e(TAG, "sendTextMessageInternal (no persist): Couldn't send SMS, exception - "
                        + e.getMessage() + " id: " + messageId);
                        + e.getMessage() + " " + formatCrossStackMessageId(messageId));
                notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
                notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
            }
            }
        }
        }
@@ -1072,8 +1072,7 @@ public final class SmsManager {
                                    deliveryIntents, persistMessage, messageId);
                                    deliveryIntents, persistMessage, messageId);
                        } catch (RemoteException e) {
                        } catch (RemoteException e) {
                            Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
                            Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
                                    + e.getMessage() + " id: "
                                    + e.getMessage() + " " + formatCrossStackMessageId(messageId));
                                    + messageId);
                            notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
                            notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
                        }
                        }
                    }
                    }
@@ -1094,7 +1093,7 @@ public final class SmsManager {
                    }
                    }
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
                    Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
                            + e.getMessage() + " id: " + messageId);
                            + e.getMessage() + " " + formatCrossStackMessageId(messageId));
                    notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
                    notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
                }
                }
            }
            }
@@ -3150,4 +3149,8 @@ public final class SmsManager {
            ex.rethrowFromSystemServer();
            ex.rethrowFromSystemServer();
        }
        }
    }
    }

    private static String formatCrossStackMessageId(long id) {
        return "{x-message-id:" + id + "}";
    }
}
}