Limit UniversalTransport to SMS for now.

This commit is contained in:
Moxie Marlinspike 2013-05-07 18:25:36 -07:00
parent 5d910a2997
commit 5c8fa148ca

View File

@ -24,20 +24,21 @@ public class UniversalTransport {
}
public void deliver(SmsMessageRecord message) throws UndeliverableMessageException {
Recipient recipient = message.getIndividualRecipient();
String number = PhoneNumberFormatter.formatNumber(context, recipient.getNumber());
if (NumberFilter.getInstance(context).containsNumber(number)) {
try {
Log.w("UniversalTransport", "Delivering with GCM...");
gcmTransport.deliver(message);
} catch (IOException ioe) {
Log.w("UniversalTransport", ioe);
smsTransport.deliver(message);
}
} else {
Log.w("UniversalTransport", "Delivering with SMS...");
smsTransport.deliver(message);
}
smsTransport.deliver(message);
// Recipient recipient = message.getIndividualRecipient();
// String number = PhoneNumberFormatter.formatNumber(context, recipient.getNumber());
//
// if (NumberFilter.getInstance(context).containsNumber(number)) {
// try {
// Log.w("UniversalTransport", "Delivering with GCM...");
// gcmTransport.deliver(message);
// } catch (IOException ioe) {
// Log.w("UniversalTransport", ioe);
// smsTransport.deliver(message);
// }
// } else {
// Log.w("UniversalTransport", "Delivering with SMS...");
// smsTransport.deliver(message);
// }
}
}