当前位置: 首页>>代码示例>>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;未经允许,请勿转载。