You could attach an extra to the Intent
used to create the Delivered PendingIntent
with the addressee's number, then retrieve it in your BroadcastReceiver
.
Intent delivered = new Intent(ACTION_SMS_DELIVERED);
delivered.putExtra("addressee", number);
PendingIntent pendingDelivered = PendingIntent.getBroadcast(context, 0, delivered, 0);
In onReceive()
:
String number = intent.getStringExtra("addressee");