Signal-Android/src/org/thoughtcrime/securesms/transport/BaseTransport.java

37 lines
1.3 KiB
Java
Raw Normal View History

2013-07-12 17:40:41 -07:00
package org.thoughtcrime.securesms.transport;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import org.thoughtcrime.securesms.service.SendReceiveService;
2014-01-06 18:52:18 -08:00
import org.thoughtcrime.securesms.service.SmsDeliveryListener;
2013-07-12 17:40:41 -07:00
public abstract class BaseTransport {
protected Intent constructSentIntent(Context context, long messageId, long type,
boolean upgraded, boolean push)
{
2013-07-12 17:40:41 -07:00
Intent pending = new Intent(SendReceiveService.SENT_SMS_ACTION,
Uri.parse("custom://" + messageId + System.currentTimeMillis()),
2014-01-06 18:52:18 -08:00
context, SmsDeliveryListener.class);
2013-07-12 17:40:41 -07:00
pending.putExtra("type", type);
pending.putExtra("message_id", messageId);
pending.putExtra("upgraded", upgraded);
pending.putExtra("push", push);
2013-07-12 17:40:41 -07:00
return pending;
}
protected Intent constructDeliveredIntent(Context context, long messageId, long type) {
Intent pending = new Intent(SendReceiveService.DELIVERED_SMS_ACTION,
Uri.parse("custom://" + messageId + System.currentTimeMillis()),
2014-01-06 18:52:18 -08:00
context, SmsDeliveryListener.class);
2013-07-12 17:40:41 -07:00
pending.putExtra("type", type);
pending.putExtra("message_id", messageId);
return pending;
}
}