本文整理汇总了Java中android.telephony.SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE属性的典型用法代码示例。如果您正苦于以下问题:Java SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE属性的具体用法?Java SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE怎么用?Java SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.telephony.SmsManager
的用法示例。
在下文中一共展示了SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateResultCode
private static String translateResultCode(int resultCode) {
switch (resultCode) {
case Activity.RESULT_OK:
return "Activity.RESULT_OK";
case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
return "SmsManager.RESULT_ERROR_GENERIC_FAILURE";
case SmsManager.RESULT_ERROR_RADIO_OFF:
return "SmsManager.RESULT_ERROR_RADIO_OFF";
case SmsManager.RESULT_ERROR_NULL_PDU:
return "SmsManager.RESULT_ERROR_NULL_PDU";
case SmsManager.RESULT_ERROR_NO_SERVICE:
return "SmsManager.RESULT_ERROR_NO_SERVICE";
case SmsManager.RESULT_ERROR_LIMIT_EXCEEDED:
return "SmsManager.RESULT_ERROR_LIMIT_EXCEEDED";
case SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE:
return "SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE";
default:
return "Unknown error code";
}
}
示例2: handleSmsSent
private void handleSmsSent(Intent intent, int error) {
Uri uri = intent.getData();
mSending = false;
boolean sendNextMsg = intent.getBooleanExtra(EXTRA_MESSAGE_SENT_SEND_NEXT, false);
if (LogTag.DEBUG_SEND) {
Log.v(TAG, "handleSmsSent uri: " + uri + " sendNextMsg: " + sendNextMsg +
" mResultCode: " + mResultCode +
" = " + translateResultCode(mResultCode) + " error: " + error);
}
if (mResultCode == Activity.RESULT_OK) {
if (LogTag.DEBUG_SEND || Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "handleSmsSent move message to sent folder uri: " + uri);
}
if (!Sms.moveMessageToFolder(this, uri, Sms.MESSAGE_TYPE_SENT, error)) {
Log.e(TAG, "handleSmsSent: failed to move message " + uri + " to sent folder");
}
if (sendNextMsg) {
sendFirstQueuedMessage();
}
// Update the notification for failed messages since they may be deleted.
MessagingNotification.nonBlockingUpdateSendFailedNotification(this);
} else if ((mResultCode == SmsManager.RESULT_ERROR_RADIO_OFF) ||
(mResultCode == SmsManager.RESULT_ERROR_NO_SERVICE)) {
if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "handleSmsSent: no service, queuing message w/ uri: " + uri);
}
// We got an error with no service or no radio. Register for state changes so
// when the status of the connection/radio changes, we can try to send the
// queued up messages.
registerForServiceStateChanges();
// We couldn't send the message, put in the queue to retry later.
Sms.moveMessageToFolder(this, uri, Sms.MESSAGE_TYPE_QUEUED, error);
mToastHandler.post(new Runnable() {
public void run() {
Toast.makeText(SmsReceiverService.this, getString(R.string.message_queued),
Toast.LENGTH_SHORT).show();
}
});
} else if (mResultCode == SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE) {
mToastHandler.post(new Runnable() {
public void run() {
Toast.makeText(SmsReceiverService.this, getString(R.string.fdn_check_failure),
Toast.LENGTH_SHORT).show();
}
});
} else {
messageFailedToSend(uri, error);
if (sendNextMsg) {
sendFirstQueuedMessage();
}
}
}
示例3: handleSmsSent
private void handleSmsSent(Intent intent, int error) {
Uri uri = intent.getData();
mSending = false;
boolean sendNextMsg = intent.getBooleanExtra(EXTRA_MESSAGE_SENT_SEND_NEXT, false);
if (LogTag.DEBUG_SEND) {
Log.v(TAG, "handleSmsSent uri: " + uri + " sendNextMsg: " + sendNextMsg +
" mResultCode: " + mResultCode +
" = " + translateResultCode(mResultCode) + " error: " + error);
}
if (mResultCode == Activity.RESULT_OK) {
if (LogTag.DEBUG_SEND || Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "handleSmsSent move message to sent folder uri: " + uri);
}
if (!Sms.moveMessageToFolder(this, uri, Sms.MESSAGE_TYPE_SENT, error)) {
Log.e(TAG, "handleSmsSent: failed to move message " + uri + " to sent folder");
}
if (sendNextMsg) {
sendFirstQueuedMessage();
}
// Update the notification for failed messages since they may be deleted.
MessagingNotification.nonBlockingUpdateSendFailedNotification(this);
} else if ((mResultCode == SmsManager.RESULT_ERROR_RADIO_OFF) ||
(mResultCode == SmsManager.RESULT_ERROR_NO_SERVICE)) {
if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "handleSmsSent: no service, queuing message w/ uri: " + uri);
}
// We got an error with no service or no radio. Register for state changes so
// when the status of the connection/radio changes, we can try to send the
// queued up messages.
registerForServiceStateChanges();
// We couldn't send the message, put in the queue to retry later.
Sms.moveMessageToFolder(this, uri, Sms.MESSAGE_TYPE_QUEUED, error);
mToastHandler.post(new Runnable() {
public void run() {
Toast.makeText(SmsReceiverService.this, getString(R.string.message_queued),
Toast.LENGTH_SHORT).show();
}
});
} else if (mResultCode == SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE) {
messageFailedToSend(uri, mResultCode);
mToastHandler.post(new Runnable() {
public void run() {
Toast.makeText(SmsReceiverService.this, getString(R.string.fdn_check_failure),
Toast.LENGTH_SHORT).show();
}
});
} else {
messageFailedToSend(uri, error);
if (sendNextMsg) {
sendFirstQueuedMessage();
}
}
}