Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
am 4fbc794: Merge "Use name and number for SMS delivery reports"
Browse files Browse the repository at this point in the history
* commit '4fbc794dc817c67b90fa6fe69d2ca335f99b8986':
  Use name and number for SMS delivery reports
  • Loading branch information
Jean-Baptiste Queru authored and Android Git Automerger committed Feb 23, 2012
2 parents 15bd398 + 4fbc794 commit ffede8f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/com/android/mms/transaction/MessagingNotification.java
Expand Up @@ -340,18 +340,22 @@ private static final MmsSmsDeliveryInfo getSmsNewDeliveryInfo(Context context) {
SMS_STATUS_PROJECTION, NEW_DELIVERY_SM_CONSTRAINT,
null, Sms.DATE);

if (cursor == null)
if (cursor == null) {
return null;
}

try {
if (!cursor.moveToLast())
return null;
if (!cursor.moveToLast()) {
return null;
}

String address = cursor.getString(COLUMN_SMS_ADDRESS);
long timeMillis = 3000;

return new MmsSmsDeliveryInfo(String.format(
context.getString(R.string.delivery_toast_body), address),
Contact contact = Contact.get(address, false);
String name = contact.getNameAndNumber();

return new MmsSmsDeliveryInfo(context.getString(R.string.delivery_toast_body, name),
timeMillis);

} finally {
Expand Down

0 comments on commit ffede8f

Please sign in to comment.