Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a4ad4e5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "MAP : Add support for MAP 1.4"

parents fe84f1ae 89dbf567
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -63,16 +63,16 @@ public class BluetoothMapAppParams {
    private static final int PRESENCE_AVAILABLE = 0x1C;
    private static final int PRESENCE_TEXT = 0x1D;
    private static final int LAST_ACTIVITY = 0x1E;
    private static final int CHAT_STATE = 0x1F;
    private static final int FILTER_CONVO_ID = 0x20;
    private static final int CONVO_LISTING_SIZE = 0x21;
    private static final int FILTER_PRESENCE = 0x22;
    private static final int FILTER_UID_PRESENT = 0x23;
    private static final int CHAT_STATE_CONVO_ID = 0x24;
    private static final int FOLDER_VER_COUNTER = 0x25;
    private static final int FILTER_MESSAGE_HANDLE = 0x26;
    private static final int NOTIFICATION_FILTER = 0x27;
    private static final int CONVO_PARAMETER_MASK = 0x28;
    private static final int CHAT_STATE = 0x21;
    private static final int FILTER_CONVO_ID = 0x22;
    private static final int CONVO_LISTING_SIZE = 0x36;
    private static final int FILTER_PRESENCE = 0x37;
    private static final int FILTER_UID_PRESENT = 0x38;
    private static final int CHAT_STATE_CONVO_ID = 0x39;
    private static final int FOLDER_VER_COUNTER = 0x23;
    private static final int FILTER_MESSAGE_HANDLE = 0x24;
    private static final int NOTIFICATION_FILTER = 0x25;
    private static final int CONVO_PARAMETER_MASK = 0x26;

    // Length defined for Application Parameters
    private static final int MAX_LIST_COUNT_LEN = 0x02; //, 0x0000, 0xFFFF),
@@ -104,8 +104,8 @@ public class BluetoothMapAppParams {
    private static final int CONVO_LISTING_SIZE_LEN = 0x02;
    private static final int FILTER_PRESENCE_LEN = 0x01;
    private static final int FILTER_UID_PRESENT_LEN = 0x01;
    private static final int FOLDER_VER_COUNTER_LEN = 0x10;
    private static final int FILTER_MESSAGE_HANDLE_LEN = 0x10;
    private static final int FOLDER_VER_COUNTER_LEN = 0x20;
    private static final int FILTER_MESSAGE_HANDLE_LEN = 0x08;
    private static final int NOTIFICATION_FILTER_LEN = 0x04;
    private static final int CONVO_PARAMETER_MASK_LEN = 0x04;

@@ -1046,7 +1046,7 @@ public class BluetoothMapAppParams {
    public void setFilterMsgHandle(String handle) {
        try {
            mFilterMsgHandle = BluetoothMapUtils.getLongFromString(handle);
        } catch (UnsupportedEncodingException e) {
        } catch (UnsupportedEncodingException | NumberFormatException e) {
            Log.w(TAG, "Error creating long from handle string", e);
        }
    }
@@ -1100,7 +1100,7 @@ public class BluetoothMapAppParams {
    public void setFilterConvoId(String id) {
        try {
            mFilterConvoId = SignedLongLong.fromString(id);
        } catch (UnsupportedEncodingException e) {
        } catch (UnsupportedEncodingException | NumberFormatException e) {
            Log.w(TAG, "Error creating long from id string", e);
        }
    }
+4 −5
Original line number Diff line number Diff line
@@ -86,13 +86,13 @@ public class BluetoothMapContent {
    private static final int MASK_REPLYTO_ADDRESSING = 0x00008000;
    // TODO: Duplicate in proposed spec
    // private static final int MASK_RECEPTION_STATE       = 0x00010000;
    private static final int MASK_DELIVERY_STATUS = 0x00020000;
    private static final int MASK_CONVERSATION_ID = 0x00040000;
    private static final int MASK_CONVERSATION_NAME = 0x00080000;
    private static final int MASK_DELIVERY_STATUS = 0x00010000;
    private static final int MASK_CONVERSATION_ID = 0x00020000;
    private static final int MASK_CONVERSATION_NAME = 0x00040000;
    private static final int MASK_FOLDER_TYPE = 0x00100000;
    // TODO: about to be removed from proposed spec
    // private static final int MASK_SEQUENCE_NUMBER       = 0x00200000;
    private static final int MASK_ATTACHMENT_MIME = 0x00400000;
    private static final int MASK_ATTACHMENT_MIME = 0x00100000;

    private static final int CONVO_PARAM_MASK_CONVO_NAME = 0x00000001;
    private static final int CONVO_PARAM_MASK_CONVO_LAST_ACTIVITY = 0x00000002;
@@ -2454,7 +2454,6 @@ public class BluetoothMapContent {
                        setDeliveryStatus(ele, tmpCursor, fi, ap);
                        setThreadId(ele, tmpCursor, fi, ap);
                        setThreadName(ele, tmpCursor, fi, ap);
                        setFolderType(ele, tmpCursor, fi, ap);
                    }
                }
            }
+7 −3
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ public class BluetoothMapContentObserver {
    private static final long EVENT_FILTER_CONVERSATION_CHANGED = 1L << 10;
    private static final long EVENT_FILTER_PARTICIPANT_PRESENCE_CHANGED = 1L << 11;
    private static final long EVENT_FILTER_PARTICIPANT_CHATSTATE_CHANGED = 1L << 12;
    private static final long EVENT_FILTER_MESSAGE_REMOVED = 1L << 13;
    private static final long EVENT_FILTER_MESSAGE_REMOVED = 1L << 14;

    // TODO: If we are requesting a large message from the network, on a slow connection
    //       20 seconds might not be enough... But then again 20 seconds is long for other
@@ -1534,10 +1534,14 @@ public class BluetoothMapContentObserver {
                    c.close();
                }
            }

            String eventType = EVENT_TYPE_DELETE;
            for (Msg msg : getMsgListSms().values()) {
                // "old_folder" used only for MessageShift event
                Event evt = new Event(EVENT_TYPE_DELETE, msg.id, getSmsFolderName(msg.type), null,
                if (mMapEventReportVersion >= BluetoothMapUtils.MAP_EVENT_REPORT_V12) {
                    eventType = EVENT_TYPE_REMOVED;
                    if (V) Log.v(TAG," sent EVENT_TYPE_REMOVED");
                }
                Event evt = new Event(eventType, msg.id, getSmsFolderName(msg.type), null,
                        mSmsType);
                sendEvent(evt);
                listChanged = true;
+8 −7
Original line number Diff line number Diff line
@@ -51,10 +51,10 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
    private static final int SDP_MAP_MSG_TYPE_MMS = 0x08;
    private static final int SDP_MAP_MSG_TYPE_IM = 0x10;

    private static final int SDP_MAP_MAS_VERSION = 0x0102;
    private static final int SDP_MAP_MAS_VERSION = 0x0104;

    /* TODO: Should these be adaptive for each MAS? - e.g. read from app? */
    static final int SDP_MAP_MAS_FEATURES = 0x0000007F;
    static final int SDP_MAP_MAS_FEATURES = 0x603ff;

    private ServerSession mServerSession = null;
    // The handle to the socket registration with SDP
@@ -80,7 +80,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
    private int mMasInstanceId = -1;
    private boolean mEnableSmsMms = false;
    BluetoothMapContentObserver mObserver;

    private BluetoothMapObexServer mMapServer;
    private AtomicLong mDbIndetifier = new AtomicLong();
    private AtomicLong mFolderVersionCounter = new AtomicLong(0);
    private AtomicLong mSmsMmsConvoListVersionCounter = new AtomicLong(0);
@@ -360,17 +360,16 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
            }

            mMnsClient = mnsClient;
            BluetoothMapObexServer mapServer;
            mObserver = new BluetoothMapContentObserver(mContext, mMnsClient, this, mAccount,
                    mEnableSmsMms);
            mObserver.init();
            mapServer =
            mMapServer =
                    new BluetoothMapObexServer(mServiceHandler, mContext, mObserver, this, mAccount,
                            mEnableSmsMms);

            mMapServer.setRemoteFeatureMask(mRemoteFeatureMask);
            // setup transport
            BluetoothObexTransport transport = new BluetoothObexTransport(mConnSocket);
            mServerSession = new ServerSession(transport, mapServer, null);
            mServerSession = new ServerSession(transport, mMapServer, null);
            if (D) {
                Log.d(mTag, "    ServerSession started.");
            }
@@ -457,8 +456,10 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
            Log.v(mTag, "setRemoteFeatureMask : Curr: " + mRemoteFeatureMask);
        }
        mRemoteFeatureMask = supportedFeatures & SDP_MAP_MAS_FEATURES;
        BluetoothMapUtils.savePeerSupportUtcTimeStamp(mRemoteFeatureMask);
        if (mObserver != null) {
            mObserver.setObserverRemoteFeatureMask(mRemoteFeatureMask);
            mMapServer.setRemoteFeatureMask(mRemoteFeatureMask);
            if (V) {
                Log.v(mTag, "setRemoteFeatureMask : set: " + mRemoteFeatureMask);
            }
+2 −1
Original line number Diff line number Diff line
@@ -288,7 +288,8 @@ public class BluetoothMapMessageListingElement
        }

        if (mDateTime != 0) {
            xmlMsgElement.attribute(null, "datetime", this.getDateTimeString());
            xmlMsgElement.attribute(null, "datetime",
                    BluetoothMapUtils.getDateTimeString(this.getDateTime()));
        }
        if (mSenderName != null) {
            xmlMsgElement.attribute(null, "sender_name",
Loading