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

34 lines
1.2 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;
import org.thoughtcrime.securesms.service.SmsListener;
public abstract class BaseTransport {
protected Intent constructSentIntent(Context context, long messageId, long type, boolean upgraded) {
2013-07-12 17:40:41 -07:00
Intent pending = new Intent(SendReceiveService.SENT_SMS_ACTION,
Uri.parse("custom://" + messageId + System.currentTimeMillis()),
context, SmsListener.class);
pending.putExtra("type", type);
pending.putExtra("message_id", messageId);
pending.putExtra("upgraded", upgraded);
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()),
context, SmsListener.class);
pending.putExtra("type", type);
pending.putExtra("message_id", messageId);
return pending;
}
}