當前位置: 首頁>>代碼示例>>Java>>正文


Java SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE屬性代碼示例

本文整理匯總了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";
    }
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:20,代碼來源:SmsReceiverService.java

示例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();
        }
    }
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:55,代碼來源:SmsReceiverService.java

示例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();
        }
    }
}
 
開發者ID:slvn,項目名稱:android-aosp-mms,代碼行數:56,代碼來源:SmsReceiverService.java


注:本文中的android.telephony.SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。