当前位置: 首页>>代码示例>>Java>>正文


Java Sms.STATUS_PENDING属性代码示例

本文整理汇总了Java中android.provider.Telephony.Sms.STATUS_PENDING属性的典型用法代码示例。如果您正苦于以下问题:Java Sms.STATUS_PENDING属性的具体用法?Java Sms.STATUS_PENDING怎么用?Java Sms.STATUS_PENDING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.Telephony.Sms的用法示例。


在下文中一共展示了Sms.STATUS_PENDING属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onHandleIntent

@Override
protected void onHandleIntent(Intent intent) {
    // This method is called on a worker thread.

    Uri messageUri = intent.getData();
    byte[] pdu = intent.getByteArrayExtra("pdu");
    String format = intent.getStringExtra("format");

    SmsMessage message = updateMessageStatus(this, messageUri, pdu, format);

    // Called on a background thread, so it's OK to block.
    if (message != null && message.getStatus() < Sms.STATUS_PENDING) {
        MessagingNotification.blockingUpdateNewMessageIndicator(this,
                MessagingNotification.THREAD_NONE, message.isStatusReportMessage());
    }
}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:16,代码来源:MessageStatusService.java

示例2: getSmsStatusText

private String getSmsStatusText(int status) {
    if (status == Sms.STATUS_NONE) {
        // No delivery report requested
        return mContext.getString(R.string.status_none);
    } else if (status >= Sms.STATUS_FAILED) {
        // Failure
        return mContext.getString(R.string.status_failed);
    } else if (status >= Sms.STATUS_PENDING) {
        // Pending
        return mContext.getString(R.string.status_pending);
    } else {
        // Success
        return mContext.getString(R.string.status_received);
    }
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:15,代码来源:DeliveryReportHelper.java

示例3: getSmsStatusText

private String getSmsStatusText(int status) {
    if (status == Sms.STATUS_NONE) {
        // No delivery report requested
        return getString(R.string.status_none);
    } else if (status >= Sms.STATUS_FAILED) {
        // Failure
        return getString(R.string.status_failed);
    } else if (status >= Sms.STATUS_PENDING) {
        // Pending
        return getString(R.string.status_pending);
    } else {
        // Success
        return getString(R.string.status_received);
    }
}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:15,代码来源:DeliveryReportActivity.java

示例4: sendFirstQueuedMessage

public synchronized void sendFirstQueuedMessage() {
    boolean success = true;
    // get all the queued messages from the database
    final Uri uri = Uri.parse("content://sms/queued");
    ContentResolver resolver = getContentResolver();
    Cursor c = SqliteWrapper.query(this, resolver, uri,
                    SEND_PROJECTION, null, null, "date ASC");   // date ASC so we send out in
                                                                // same order the user tried
                                                                // to send messages.
    if (c != null) {
        try {
            if (c.moveToFirst()) {
                String msgText = c.getString(SEND_COLUMN_BODY);
                String address = c.getString(SEND_COLUMN_ADDRESS);
                int threadId = c.getInt(SEND_COLUMN_THREAD_ID);
                int status = c.getInt(SEND_COLUMN_STATUS);

                int msgId = c.getInt(SEND_COLUMN_ID);
                Uri msgUri = ContentUris.withAppendedId(Sms.CONTENT_URI, msgId);
                SmsMessageSender sender;

                sender = new SmsSingleRecipientSender(this,
                        address, msgText, threadId, status == Sms.STATUS_PENDING,
                        msgUri, MSimSmsManager.getDefault().getPreferredSmsSubscription());

                if (LogTag.DEBUG_SEND ||
                        LogTag.VERBOSE ||
                        Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
                    Log.v(TAG, "sendFirstQueuedMessage " + msgUri +
                            ", address: " + address +
                            ", threadId: " + threadId);
                }

                try {
                    sender.sendMessage(SendingProgressTokenManager.NO_TOKEN);;
                    mSending = true;
                } catch (MmsException e) {
                    Log.e(TAG, "sendFirstQueuedMessage: failed to send message " + msgUri
                            + ", caught ", e);
                    mSending = false;
                    messageFailedToSend(msgUri, SmsManager.RESULT_ERROR_GENERIC_FAILURE);
                    success = false;
                }
            }
        } finally {
            c.close();
        }
    }
    if (success) {
        // We successfully sent all the messages in the queue. We don't need to
        // be notified of any service changes any longer.
        unRegisterForServiceStateChanges();
    }
}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:54,代码来源:SmsReceiverService.java

示例5: sendFirstQueuedMessage

public synchronized void sendFirstQueuedMessage() {
    boolean success = true;
    // get all the queued messages from the database
    final Uri uri = Uri.parse("content://sms/queued");
    ContentResolver resolver = getContentResolver();
    Cursor c = SqliteWrapper.query(this, resolver, uri,
                    SEND_PROJECTION, null, null, "date ASC");   // date ASC so we send out in
                                                                // same order the user tried
                                                                // to send messages.
    if (c != null) {
        try {
            if (c.moveToFirst()) {
                String msgText = c.getString(SEND_COLUMN_BODY);
                String address = c.getString(SEND_COLUMN_ADDRESS);
                int threadId = c.getInt(SEND_COLUMN_THREAD_ID);
                int status = c.getInt(SEND_COLUMN_STATUS);

                int msgId = c.getInt(SEND_COLUMN_ID);
                Uri msgUri = ContentUris.withAppendedId(Sms.CONTENT_URI, msgId);

                SmsMessageSender sender = new SmsSingleRecipientSender(this,
                        address, msgText, threadId, status == Sms.STATUS_PENDING,
                        msgUri);

                if (LogTag.DEBUG_SEND ||
                        LogTag.VERBOSE ||
                        Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
                    Log.v(TAG, "sendFirstQueuedMessage " + msgUri +
                            ", address: " + address +
                            ", threadId: " + threadId);
                }

                try {
                    sender.sendMessage(SendingProgressTokenManager.NO_TOKEN);;
                    mSending = true;
                } catch (MmsException e) {
                    Log.e(TAG, "sendFirstQueuedMessage: failed to send message " + msgUri
                            + ", caught ", e);
                    mSending = false;
                    messageFailedToSend(msgUri, SmsManager.RESULT_ERROR_GENERIC_FAILURE);
                    success = false;
                    // Sending current message fails. Try to send more pending messages
                    // if there is any.
                    sendBroadcast(new Intent(SmsReceiverService.ACTION_SEND_MESSAGE,
                            null,
                            this,
                            SmsReceiver.class));
                }
            }
        } finally {
            c.close();
        }
    }
    if (success) {
        // We successfully sent all the messages in the queue. We don't need to
        // be notified of any service changes any longer.
        unRegisterForServiceStateChanges();
    }
}
 
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:59,代码来源:SmsReceiverService.java


注:本文中的android.provider.Telephony.Sms.STATUS_PENDING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。