Loading android/app/src/com/android/bluetooth/mapclient/MceStateMachine.java +60 −23 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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: Loading Loading @@ -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. Loading @@ -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) { Loading Loading @@ -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 Loading Loading @@ -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 Loading @@ -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) { Loading android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading flags/mapclient.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -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" } system/audio_hal_interface/a2dp_encoding.h +1 −1 Original line number Diff line number Diff line Loading @@ -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" Loading system/bta/av/bta_av_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
android/app/src/com/android/bluetooth/mapclient/MceStateMachine.java +60 −23 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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: Loading Loading @@ -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. Loading @@ -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) { Loading Loading @@ -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 Loading Loading @@ -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 Loading @@ -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) { Loading
android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
flags/mapclient.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -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" }
system/audio_hal_interface/a2dp_encoding.h +1 −1 Original line number Diff line number Diff line Loading @@ -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" Loading
system/bta/av/bta_av_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -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