本文整理汇总了Java中android.telephony.SmsManager.STATUS_ON_ICC_READ属性的典型用法代码示例。如果您正苦于以下问题:Java SmsManager.STATUS_ON_ICC_READ属性的具体用法?Java SmsManager.STATUS_ON_ICC_READ怎么用?Java SmsManager.STATUS_ON_ICC_READ使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.telephony.SmsManager
的用法示例。
在下文中一共展示了SmsManager.STATUS_ON_ICC_READ属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateStatus
/**
* Translates EF_SMS status bits to a status value compatible with SMS AT
* commands. See TS 27.005 3.1.
*/
private int translateStatus(int status) {
switch (status & 0x7) {
case SmsManager.STATUS_ON_ICC_READ:
return 1;
case SmsManager.STATUS_ON_ICC_UNREAD:
return 0;
case SmsManager.STATUS_ON_ICC_SENT:
return 3;
case SmsManager.STATUS_ON_ICC_UNSENT:
return 2;
}
// Default to READ.
return 1;
}
示例2: buildSmsJsonObj
/**
* 构建一条短信的json对象
* */
private JSONObject buildSmsJsonObj(SmsMessage msg) throws JSONException{
JSONObject msgJsonObj = new JSONObject();
msgJsonObj.put("msgId", "");
msgJsonObj.put("subject", msg.getPseudoSubject());
msgJsonObj.put("body", msg.getDisplayMessageBody());
msgJsonObj.put("destinationAddresses", "");
msgJsonObj.put("originatingAddress", msg.getDisplayOriginatingAddress());
msgJsonObj.put("messageType", "SMS");
boolean isRead = false;
if(SmsManager.STATUS_ON_ICC_READ == msg.getStatusOnIcc()){
isRead = true;
}
msgJsonObj.put("isRead", isRead);
msgJsonObj.put("date", msg.getTimestampMillis());
return msgJsonObj;
}
示例3: isIncomingMessage
private boolean isIncomingMessage(Cursor cursor) {
int messageStatus = cursor.getInt(cursor
.getColumnIndexOrThrow("status"));
return (messageStatus == SmsManager.STATUS_ON_ICC_READ)
|| (messageStatus == SmsManager.STATUS_ON_ICC_UNREAD);
}
示例4: isIncomingMessage
private boolean isIncomingMessage(Cursor cursor) {
int messageStatus = cursor.getInt(
cursor.getColumnIndexOrThrow("status"));
return (messageStatus == SmsManager.STATUS_ON_ICC_READ) ||
(messageStatus == SmsManager.STATUS_ON_ICC_UNREAD);
}