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

Commit 85118e91 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12098010 from e40676f1 to 24Q4-release

Change-Id: I13a2ba61911610fab36522f02e71037e82784784
parents 3a7f3685 e40676f1
Loading
Loading
Loading
Loading
+60 −23
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ class MceStateMachine extends StateMachine {
    private static final boolean MESSAGE_SEEN = true;
    private static final boolean MESSAGE_NOT_SEEN = false;

    // Do we download attachments, e.g., if a MMS contains an image.
    private static final boolean DOWNLOAD_ATTACHMENTS = false;

    // Folder names as defined in Bluetooth.org MAP spec V10
    private static final String FOLDER_TELECOM = "telecom";
    private static final String FOLDER_MSG = "msg";
@@ -713,7 +716,9 @@ class MceStateMachine extends StateMachine {
                case MSG_INBOUND_MESSAGE:
                    mMasClient.makeRequest(
                            new RequestGetMessage(
                                    (String) message.obj, MasClient.CharsetType.UTF_8, false));
                                    (String) message.obj,
                                    MasClient.CharsetType.UTF_8,
                                    DOWNLOAD_ATTACHMENTS));
                    break;

                case MSG_NOTIFICATION:
@@ -770,6 +775,20 @@ class MceStateMachine extends StateMachine {
                                Utils.getLoggableAddress(mDevice)
                                        + " [Connected]: Message Sent, handle="
                                        + messageHandle);
                        if (Flags.useEntireMessageHandle()) {
                            // some test devices don't populate messageHandle field.
                            // in such cases, no need to wait up for response for such messages.
                            if (messageHandle != null) {
                                if (SAVE_OUTBOUND_MESSAGES) {
                                    mDatabase.storeMessage(
                                            requestPushMessage.getBMsg(),
                                            messageHandle,
                                            System.currentTimeMillis(),
                                            MESSAGE_SEEN);
                                }
                                mSentMessageLog.put(messageHandle, requestPushMessage.getBMsg());
                            }
                        } else {
                            // ignore the top-order byte (converted to string) in the handle for now
                            // some test devices don't populate messageHandle field.
                            // in such cases, no need to wait up for response for such messages.
@@ -784,6 +803,7 @@ class MceStateMachine extends StateMachine {
                                mSentMessageLog.put(
                                        messageHandle.substring(2), requestPushMessage.getBMsg());
                            }
                        }
                    } else if (message.obj instanceof RequestGetMessagesListing) {
                        processMessageListing((RequestGetMessagesListing) message.obj);
                    } else if (message.obj instanceof RequestSetMessageStatus) {
@@ -879,7 +899,9 @@ class MceStateMachine extends StateMachine {
                    }
                    mMasClient.makeRequest(
                            new RequestGetMessage(
                                    event.getHandle(), MasClient.CharsetType.UTF_8, false));
                                    event.getHandle(),
                                    MasClient.CharsetType.UTF_8,
                                    DOWNLOAD_ATTACHMENTS));
                    break;
                case DELIVERY_FAILURE:
                    // fall through
@@ -1177,8 +1199,21 @@ class MceStateMachine extends StateMachine {
            Log.d(TAG, "got a status for " + handle + " Status = " + status);
            // some test devices don't populate messageHandle field.
            // in such cases, ignore such messages.
            if (Flags.useEntireMessageHandle()) {
                if (handle == null) return;
            } else {
                if (handle == null || handle.length() <= 2) return;
            }
            PendingIntent intentToSend = null;
            if (Flags.useEntireMessageHandle()) {
                if (status == EventReport.Type.SENDING_FAILURE
                        || status == EventReport.Type.SENDING_SUCCESS) {
                    intentToSend = mSentReceiptRequested.remove(mSentMessageLog.get(handle));
                } else if (status == EventReport.Type.DELIVERY_SUCCESS
                        || status == EventReport.Type.DELIVERY_FAILURE) {
                    intentToSend = mDeliveryReceiptRequested.remove(mSentMessageLog.get(handle));
                }
            } else {
                // ignore the top-order byte (converted to string) in the handle for now
                String shortHandle = handle.substring(2);
                if (status == EventReport.Type.SENDING_FAILURE
@@ -1186,7 +1221,9 @@ class MceStateMachine extends StateMachine {
                    intentToSend = mSentReceiptRequested.remove(mSentMessageLog.get(shortHandle));
                } else if (status == EventReport.Type.DELIVERY_SUCCESS
                        || status == EventReport.Type.DELIVERY_FAILURE) {
                intentToSend = mDeliveryReceiptRequested.remove(mSentMessageLog.get(shortHandle));
                    intentToSend =
                            mDeliveryReceiptRequested.remove(mSentMessageLog.get(shortHandle));
                }
            }

            if (intentToSend != null) {
+2 −1
Original line number Diff line number Diff line
@@ -193,7 +193,8 @@ public class MapClientStateMachineTest {
    @Parameters(name = "{0}")
    public static List<FlagsParameterization> getParams() {
        return FlagsParameterization.progressionOf(
                Flags.FLAG_HANDLE_DELIVERY_SENDING_FAILURE_EVENTS);
                Flags.FLAG_HANDLE_DELIVERY_SENDING_FAILURE_EVENTS,
                Flags.FLAG_USE_ENTIRE_MESSAGE_HANDLE);
    }

    public MapClientStateMachineTest(FlagsParameterization flags) {
+7 −0
Original line number Diff line number Diff line
@@ -14,3 +14,10 @@ flag {
    description: "Use entire message handle of messages pushed from MCE to MSE."
    bug: "323382399"
}

flag {
    name: "refactor_saving_messages_and_metadata"
    namespace: "bluetooth"
    description: "Refactor how MAP Client collects and saves a message and its metadata."
    bug: "331478849"
}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
#include <sstream>
#include <vector>

#include "a2dp_error_codes.h"
#include "a2dp_constants.h"
#include "avdt_api.h"
#include "common/message_loop_thread.h"
#include "hardware/bt_av.h"
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#include "internal_include/bt_target.h"
#include "macros.h"
#include "osi/include/list.h"
#include "stack/include/a2dp_error_codes.h"
#include "stack/include/a2dp_constants.h"
#include "stack/include/avdt_api.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/hci_error_code.h"
Loading