/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.bluetooth.client.map; import android.bluetooth.client.map.utils.ObexTime; import org.json.JSONException; import org.json.JSONObject; import java.math.BigInteger; import java.util.Date; import java.util.HashMap; /** * Object representation of message received in messages listing *
* This object will be received in
* {@link BluetoothMasClient#EVENT_GET_MESSAGES_LISTING} callback message.
*/
public class BluetoothMapMessage {
private final String mHandle;
private final String mSubject;
private final Date mDateTime;
private final String mSenderName;
private final String mSenderAddressing;
private final String mReplytoAddressing;
private final String mRecipientName;
private final String mRecipientAddressing;
private final Type mType;
private final int mSize;
private final boolean mText;
private final ReceptionStatus mReceptionStatus;
private final int mAttachmentSize;
private final boolean mPriority;
private final boolean mRead;
private final boolean mSent;
private final boolean mProtected;
public enum Type {
UNKNOWN, EMAIL, SMS_GSM, SMS_CDMA, MMS
};
public enum ReceptionStatus {
UNKNOWN, COMPLETE, FRACTIONED, NOTIFICATION
}
BluetoothMapMessage(HashMaphandle
parameter in MAP
* specification
*/
public String getHandle() {
return mHandle;
}
/**
* @return value corresponding to subject
parameter in MAP
* specification
*/
public String getSubject() {
return mSubject;
}
/**
* @return Date
object corresponding to datetime
* parameter in MAP specification
*/
public Date getDateTime() {
return mDateTime;
}
/**
* @return value corresponding to sender_name
parameter in MAP
* specification
*/
public String getSenderName() {
return mSenderName;
}
/**
* @return value corresponding to sender_addressing
parameter
* in MAP specification
*/
public String getSenderAddressing() {
return mSenderAddressing;
}
/**
* @return value corresponding to replyto_addressing
parameter
* in MAP specification
*/
public String getReplytoAddressing() {
return mReplytoAddressing;
}
/**
* @return value corresponding to recipient_name
parameter in
* MAP specification
*/
public String getRecipientName() {
return mRecipientName;
}
/**
* @return value corresponding to recipient_addressing
* parameter in MAP specification
*/
public String getRecipientAddressing() {
return mRecipientAddressing;
}
/**
* @return {@link Type} object corresponding to type
parameter
* in MAP specification
*/
public Type getType() {
return mType;
}
/**
* @return value corresponding to size
parameter in MAP
* specification
*/
public int getSize() {
return mSize;
}
/**
* @return {@link .ReceptionStatus} object corresponding to
* reception_status
parameter in MAP specification
*/
public ReceptionStatus getReceptionStatus() {
return mReceptionStatus;
}
/**
* @return value corresponding to attachment_size
parameter in
* MAP specification
*/
public int getAttachmentSize() {
return mAttachmentSize;
}
/**
* @return value corresponding to text
parameter in MAP
* specification
*/
public boolean isText() {
return mText;
}
/**
* @return value corresponding to priority
parameter in MAP
* specification
*/
public boolean isPriority() {
return mPriority;
}
/**
* @return value corresponding to read
parameter in MAP
* specification
*/
public boolean isRead() {
return mRead;
}
/**
* @return value corresponding to sent
parameter in MAP
* specification
*/
public boolean isSent() {
return mSent;
}
/**
* @return value corresponding to protected
parameter in MAP
* specification
*/
public boolean isProtected() {
return mProtected;
}
}