History log of /packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
aed51b5e1151240567d990bacff01b66572fd45b 10-Feb-2017 Marie Janssen <jamuraa@google.com> Use resources for pairing ui package

The pairing package is set to "com.android.settings" which means
overlays can't change the package that's responsible for UI interaction
when pairing and access request events happen. Move it to a resource.

Test: pair a device, initiate pair from remote
Change-Id: I5731bcdcfed58b72b4e15e3e60035c7e8144b7d4
Bug: 35163738
Fix: 35219650
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
fbdf4f223574f48f8f3db83ea88e063a7551f799 20-Jan-2017 Marie Janssen <jamuraa@google.com> Broadcast pairing intents to settings package

Intent broadcasts intended directly for pairing dialogs should only be
specifically targetted to those packages.

Bug: 34395439
Test: pair a device, pair a device remotely, and connect devices
Change-Id: Ieb1354d534d4dc0457279aa3f1d3020b3a3ee37b
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
86c29fe88456bdcfbd4334647b04ef81ff384a06 22-Dec-2016 Sanket Agarwal <sanketa@google.com> Separate Phone Policy from mechanism

Create a new policy file which interacts using either public APIs (such
as Intents) or uses equivalent functions which are exposed by the
binder. This is an attempt to be able to separate policy such that
different devices can have different policies.

Bug: b/33079907
Test: JUnit tests
Change-Id: I6c5a7ee9eb4e10f5f649794546acde5ec4b297aa
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
49dbf0e8616c517d0338b0fb08f610f25a84eb10 15-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash
am: 983e5e14f9

Change-Id: I6b94817118b438ee0643c5f35fee761512f8a9bc
983e5e14f9d4ef8e42876f67227777f1b6510ba0 06-Jun-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash

Usecase:
Perform BT off/on repeatedly.

Issue:
Bluetooth crashes.

Fix:
Remove redundant call to sendShutdownMessage() from stop API to prevent
MapServiceMessageHandler becoming null and being dereferenced.

Bug: 29149190
Change-Id: I739664975043c4a1895fd2113869c87cdb704338
(cherry picked from commit 5847ca3c7068500b1f2a4cd4cf5ff373347f8fbf)
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
7ce25a8991140da037def93d72318cb80afef448 10-Jun-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround
am: 4786e5ffff

Change-Id: If94acb83525f10cc1868c1f5620a68c40677c11e
4786e5fffff14d92b795084b4470b785de66dfd0 27-May-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround

Use case:
Sync MAP message to Benz NTG 4.5

Precondition:
1. One of SMS message contains any special characters not ASCII

Steps:
1. Connect with Benz NTG 4.5.
2. Sync SMS message from carkit.

Failure:
Carkit always shows "No Message".

Root Cause:
When this carkit requests the message listing, and any message subject has
non-ASCII special characters in it, the carkit will stop all MAP activity
and stay idle.

Fix:
Strip special characters in the subject tline in message listing
for this carkit.

This change also introduces a Java bases interop database for future
use/expansion.

Bug: 29025011
Change-Id: I4255cbeb068c82f32a68b1022285dfa723e199ec
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
94c3a2bffa5f6c0979e95bca7eee95f0d92ae632 25-May-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported am: 4d2c98fcf1
am: cd42dafa7b

* commit 'cd42dafa7b46ed7add0705862632fdf70e9e19a9':
Only allow access to MAP if SMS is not supported

Change-Id: I56704c020b97401e63876ca303c7879dcd9e5b58
4d2c98fcf1abc4b07dc2d4601952f30f5d008470 07-Dec-2015 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported

Bluetooth MAP shows SMS/MMS instance and when SMS is not supported.
Don't create SMS/MMS instance if device does not support SMS.

Fixes: 28803983
Change-Id: I807fe7e10bf51316729fe56ff6181a9161a410ef
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
60e306ba5c132d5408ccae3a290e7cace020a49f 06-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection

Bug: 25138326
Change-Id: I9f418370b8725d49e3734406b6f435107bcff021
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
1ff5a0a6b42eff4c5728f0327440c127f8d3bb1c 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix ANR for blocking operations on UI thread

UseCase:
Stability Testing steps followed:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
ANR(s) reported for long running operations perfromed on main thread.

Fix:
- Attach MAPService session handler to looper from a
worker thread to avoid long running tasks handling
for messages posted from UI thread.

- Move AppObserver Account onChange() handling
to worker thread instead of UI thread.

- Avoid running contentobserver for SMS/MMS instance on
main thread looper to fix ANR reported while handling
content changes for SMS and MMS listing. Add NPE checks
hit during stability testing.

Change-Id: Ie146cd284fd191f7c7be7f0c1e7ed4877b36ae76
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
5cd7c89d0e17a9176337a36a27792bab3dd76fe9 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Track ProfileState, register and unregister of BroadcastReceivers

Use Case:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
BT Crashed, failed to start MAP services after BT reset.

RootCause:
BT Crash for not handling following exceptions:

- java.lang.IllegalArgumentException: Receiver not registered
at: android.app.IntentReceiverLeaked: Service
com.android.bluetooth.map.BluetoothMapService
has leaked IntentReceiver com.android.bluetooth.map.BluetoothMapAppObserver:
Are you missing a call to unregisterReceiver()?

Fix:
- This issue is hit when onStop() for MAPService is triggered without onStart()
being triggered by the time shutdown process gets invoked.
- Track registration and unregistration for BluetoothMapAppObserver BroadcastReceiver
to fix IntentReceiver leaks and also added validation for the AppObserver Data.

Change-Id: Ia1c2160fef369bbff42e8da3ea7d925c483e0a12
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
0f67816e838489474a0c3c57a8d856f6d51ba45f 07-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.

Handle cleanup for timeout Intent and pending Intent
in cancelUserTimeoutAlarm API.

Change-Id: I4f4184785675b2deffa3be8c9dd70b2673020b51
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
1682d51711c917a440be14a600eb8ab89ad36f61 27-Oct-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Handle possible NPE while disconnect map.

Precondition:
Verified with IOT: MecApp in MCE role

UseCase:
1. Connect MAS
2. Register Mas Instance via MNS
3. Disconnect MAS

Failure:
Bluetooth App crash sometimes when disconnect map profile.

Root Cause:
The issue is hit when MAS disconnect is finished before MNS unregister.
In this case NullpointerException is happening because of clearing
BluetoothMapContentObserver already as a part of cleanup.

Fix:
Handle Null pointer exception while last
MAS instance disconnect is handled before MNS
unregistration.

Change-Id: I4e72038a5ddc6c3ac8c515def57cb4f98fe87675
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
fc8dfd1e037cda063919d9160c9cdb604b9adfef 10-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Add MNS SDP Search during setNotificationRegistration.

Precondition:
Verified with remote MCE device that starts MNS server
only before issuing setNotification Registration to MSE.

Use Case:
1. Discover and Pair with MSE from MCE.
2. Connect to MSE on Mas insance 0.
3. Enable Notification Registration for MAS Instance 0

Failure:
MNS connection happens over RFCOMM
and MAS Instance is connected over L2CAP.

Root Cause:
Current design performs MNS SDP search only at the time
of successful MAS Instance Connect. MNS connect implementation
tries connection over insecure RFCOMM channel based on UUID
when MNS Server record is not available.

Fix:
Add implementation to check and perform MNS SDP search
if this info is not available when MCE requests
setNotificationRegistration. This fix is required to
handle MCE implementation that start MNS Sever and
expose SDP only before sending setNotificationRegistration.

Change-Id: If1e8d33dcac078f04d13b8bacf8e1d1513c119e1
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
b6fdf260e28b4eb6b5cdb19f53710c0470ffcad2 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix ANR for blocking operations on UI thread

UseCase:
Stability Testing steps followed:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
ANR(s) reported for long running operations perfromed on main thread.

Fix:
- Attach MAPService session handler to looper from a
worker thread to avoid long running tasks handling
for messages posted from UI thread.

- Move AppObserver Account onChange() handling
to worker thread instead of UI thread.

- Avoid running contentobserver for SMS/MMS instance on
main thread looper to fix ANR reported while handling
content changes for SMS and MMS listing. Add NPE checks
hit during stability testing.

Change-Id: Ie146cd284fd191f7c7be7f0c1e7ed4877b36ae76
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
19a1a8259c6352b1afe4f86034708221a87594e5 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Track ProfileState, register and unregister of BroadcastReceivers

Use Case:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
BT Crashed, failed to start MAP services after BT reset.

RootCause:
BT Crash for not handling following exceptions:

- java.lang.IllegalArgumentException: Receiver not registered
at: android.app.IntentReceiverLeaked: Service
com.android.bluetooth.map.BluetoothMapService
has leaked IntentReceiver com.android.bluetooth.map.BluetoothMapAppObserver:
Are you missing a call to unregisterReceiver()?

Fix:
- This issue is hit when onStop() for MAPService is triggered without onStart()
being triggered by the time shutdown process gets invoked.
- Track registration and unregistration for BluetoothMapAppObserver BroadcastReceiver
to fix IntentReceiver leaks and also added validation for the AppObserver Data.

Change-Id: Ia1c2160fef369bbff42e8da3ea7d925c483e0a12
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
8458fc313d1e9f072efc03a331dce151d476c596 07-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.

Handle cleanup for timeout Intent and pending Intent
in cancelUserTimeoutAlarm API.

Change-Id: I4f4184785675b2deffa3be8c9dd70b2673020b51
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
ce52d7f87eaac401d7d3db75db6b505098989295 27-Oct-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Handle possible NPE while disconnect map.

Precondition:
Verified with IOT: MecApp in MCE role

UseCase:
1. Connect MAS
2. Register Mas Instance via MNS
3. Disconnect MAS

Failure:
Bluetooth App crash sometimes when disconnect map profile.

Root Cause:
The issue is hit when MAS disconnect is finished before MNS unregister.
In this case NullpointerException is happening because of clearing
BluetoothMapContentObserver already as a part of cleanup.

Fix:
Handle Null pointer exception while last
MAS instance disconnect is handled before MNS
unregistration.

Change-Id: I4e72038a5ddc6c3ac8c515def57cb4f98fe87675
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
e6564029f132077c8a4877431a95899db201e506 10-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Add MNS SDP Search during setNotificationRegistration.

Precondition:
Verified with remote MCE device that starts MNS server
only before issuing setNotification Registration to MSE.

Use Case:
1. Discover and Pair with MSE from MCE.
2. Connect to MSE on Mas insance 0.
3. Enable Notification Registration for MAS Instance 0

Failure:
MNS connection happens over RFCOMM
and MAS Instance is connected over L2CAP.

Root Cause:
Current design performs MNS SDP search only at the time
of successful MAS Instance Connect. MNS connect implementation
tries connection over insecure RFCOMM channel based on UUID
when MNS Server record is not available.

Fix:
Add implementation to check and perform MNS SDP search
if this info is not available when MCE requests
setNotificationRegistration. This fix is required to
handle MCE implementation that start MNS Sever and
expose SDP only before sending setNotificationRegistration.

Change-Id: If1e8d33dcac078f04d13b8bacf8e1d1513c119e1
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
f48c0b98b5d1823fbb0fc3e4eba7d5054d9385fa 27-Apr-2015 Casper Bonde <c.bonde@samsung.com> MAP: Restart MAS servers after ACL disconnect

Code was introduced to remove MAP Access Request early at
ACL disconnect. By removing the notification as wall as the
UserTimeout timer caused the MAS instances not to be restarted,
to be able to accept a new conection. Hence if this occured
no connection to MAP was possible untill the phone or Bluetooth
was power cycled.

This fix causes the MAS instances to be restarted in
the event of a ACL disconnect before user accepts MAP req.

Also, applied some updates to the log messages:
- Changed the VERBOSE flag to false
- Changed some DEBUG messages to VERBOSE (for privacy reason)
- Updated the message priorities to match their purpose. E.g.,
"if (VERBOSE) Log.i(...)" -> "if (VERBOSE) Log.v(...)"

Bug: 19239028

Change-Id: Icf6d065a7a48c70a9bbc1593267f6a3605433af2
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
5a60e47497f21f64e6d79420dc4c56c1907df22a 17-Mar-2015 kschulz <k.schulz@samsung.com> Update to Bluetooth MAP 1.2 (server)

- Change folder name lookup to a map
Replaced the arrays used to convert mailbox ID/msg type to a folder name with a static map.
This is to avoid null pointer exception for unknown values, and to catch any changes in
the ID/type values at compile time in stead of runtime.
Bug-id:16874441
- Added Instance Information support and Extended Event support.
Still missing integration wiht SDP MAP feature bit mask support
- Adding Abstract implementation to support conversations
- added IM account handling, IM type definition, Application paramenters.
- addedgetConversactionList functionality
- added method to strip encoding in headers
- Fixed messagelist showing both email address and name in the name fields.
- Fixed Index out of bounds exception was hit when the subject contained invalid chars.
- Added functionality to support the getConversationListReq
Works for SMS/MMS, Email and IM
For Email/IM it depends on the convoContact table in the contract.
For SMS/MMS it uses the contact number+ name if available in contact database.
- Added new parameters to msgListing also in contract class
- Added Test framework for "near system level" tests
Currently only includes an entry point for single device tests.
- Added support for setOwnerStatus
- Added support for vcard type X-BT-UID
- Introduced type SignedLongLong to handle 128 bit values which needs to be handled as hex-strings.
- Added convocontact notification events for IM
- Added support for IM getMessage
- Added setEventFilter function.
- Added event filtering before enquing an event to be send.
- Added selective observers, depending on the active filter.
- Fixed timestamp to be from seconds to seconds (not from milisec)
- Fixed version number in bMessage if remote featurebit is set for v 1.1
- Added content encoding to QP for text that are not USACII
- Corrected the addresses in to/from for IM messages
- Added btuid and btuci to vcard
- Fixed (some) longlines
- Added extendedData support (empty when sending, just logging when receiving)
- Fixed Email folderName compairison changed to ignore case
- Fixed problem with names containing "null"
- BluetoothMapbMessageMms changed to BluetoothMapbMessageMime
- Fixrf addOriginator in getMessage request
- Add missing subjects in events for SMS
- Don't send ReadStatusChanged when pushing a message
- Temp way of adding names/uci to IM msg listing
- Added messageHandle filtering in msgListing
- Convolisting parameter mask support
- Added support for using handle when filtering in root folder during msgLising
- Added subject to event in sms
- Fixed so attribute_mime_type is only sent when parameter is requested
- Fixed feature bit check to messageListing version
- Fixed leaking cursors
- Added support for database identifier
- Added folder and conversation version counters

Change-Id: I4d2954b795aa7ed2a41dd034384da30f240b518f
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
bbb4110b455b3aa29106d5b4f0a37e1be8e09475 09-Apr-2015 Casper Bonde <c.bonde@samsung.com> Obex over L2CAP + SDP search API

Each profile had its own implementation of ObexTransport.
These implementations were implemented very similar, and
could easily be merged into a common implementation.

Additionally it will make it easier to adopt the transport
to support L2CAP.

The SDP functionality is implemented in a way that is scalable,
hence adding new record types is easy.
Intents are currently used to distribute the SDP search results,
as we have observed that the new client side profiles have been
located outside the Bluetooth package.
We strongly recommend to keep all bluetooth profiles within the
Bluetooth package, to acoid the need for exposing all bluetooth
interfaces through the Android framework. For instance this new
SDP create API is internal to Bluetooth, hence cannot be used by
the external profiles - hence they cannot use OBEX over L2CAP.

The SDP search currently supports:
- MAP both sides
- OPP server (only the server needs an SDP record)
- PBAP server (only the server needs SDP record)

The SDP create record currently supports:
- MAP both sides
- OPP server
- PBAP server
The new l2cap sockets introduces a new wrapper class for a rfcomm
and an l2cap socket.
The wrapper design:
- Creates two accept threads running while bluetooth is
turned on.
- When a connection is accepted the owner is asked wether or not
to accept the connection if rejected, the connection will be
rejected at obex level, else it will be accepted and the state
is changed to busy.
- Any further connections will be rejected at Obex level, until
the state is changed back to idle.

Notes tor executing the test cases:
Test OBEX using local pipes(no BT) or two bluetooth enabled
devices.

Test SDP using two Bluetooth enabled devices

Start server testcase first on one device, then start
the matching client test on the other device.

You cannot run all tests in one go, as they need to run
on multiple devices.

Edit the test sequesce to add/remove/modify the sequence
of OBEX operations to perform.

Use the new SDP record create interface.

Change-Id: I3941793f9843abf4afa5ffbee40d1d01c118b29b
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
ec8c0726bf056f79c1ad070ea1db2ed2910f2ef0 01-Dec-2014 Matthew Xie <mattx@google.com> Turn off map debug verbose messages

Still leave the debug messages on to provide some basic debug info
Bug: 18486776

Change-Id: I08fc5c69d9a128ec5ddc97203d02b82ced255262
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
838949d46a4cc054985a8cfd682004f8dd6d3bbb 28-Oct-2014 Mike Lockwood <lockwood@google.com> Add dumpsys support for bluetooth

Bug: 18159457
Change-Id: I807a7d921b6e5baf111d0f0e3e182c6633a93b7c
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
335b2b8f6f17c93a4c2b192c8e1b629e48b230b3 29-Sep-2014 PauloftheWest <paulofthewest@google.com> Fixed a Bluetooth MAP bug.

+ Beforehand, if a user disabled MAP and then unpaired the device, then
Settings would automatically deny future MAP requests from the device.

Bug: 17391677
Change-Id: I068f37426ed6a044ed2b5e9391cd9dd00908f867
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
fc9bed1b79edf77082f5baa21aa68d791a102ea4 05-Sep-2014 Edward Jee <edjee@google.com> Migrates PBAP and MAP access permission data from Settings to Bluetooth.

Currently, users' preference in phonebook and call history or message
access per each Bluetooth-paired device is stored in Settings application's
shared preferences.

However, some privileged applications other than Settings need to access
such data. So we decided to migrate the data from Settings application's
shared preferences to Bluetooth application's.

Bug: 17158953
Change-Id: I3808891cdcce84aa0d4df31f998c9f1240159d95
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
beb0497605ef61062d0565d85897f4c842845a8f 09-Sep-2014 Ang Li <angli@google.com> Change broadcast ACTION_CONNECTION_ACCESS_REQUEST to be ordered.

Making this broadcast ordered makes it possible to be intercepted
before Settings get it. This is cruicial to Android Audo's use case
and test automation.

The previous change we put in:
https://googleplex-android-review.git.corp.google.com/#/c/499135
was accidentally overwritten by
https://googleplex-android-review.git.corp.google.com/#/c/503267

We are putting this change back in, and making similar changes for
PBAP and HFP.

Change-Id: Ia9b4c22a05d0c9beb1485b53ddf04c45fa210526
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
326b5e610063ac24c0ba467ac585bd4c7f618a67 24-Jul-2014 Casper Bonde <c.bonde@samsung.com> BT MAP: added support for email sharing over BT

- added support for Emails
- added activity to do setup of the email accounts to share
- added improved handling of MMS, SMS and Email
- Many optimizations to speed (especially getMessageListing)
- fixed wakelock problem
- fixed user timeout problem when user do not react to msg access request
- added missing privileges
- support for Quoted Printable format
- added accountId in test case URIs
- fixed problem with service numbers being strings
- fixed problem with read flag in getMessage
- added support for transparent flag in Email Push
- added missing send-event for non-imap accounts
- set attachment size to 0 if text-only message
- fixed double send for sms messages with retry
- removed secondary phone numbers from recipient/originator
- removed insert-address-token in MMS messages
- fixed null-pointer exception in settings (missing extra in intent)
- send text-only mms as sms (workaround to make it cheaper)
- fixed rejection of native and fraction requests
- better handling of unknown message types in push
- fixed problem with possible illigal xml chars in message listing
- added missing WRITE_APN_SETTINGS permission to manifest
- fixed problem with notifications when pushing to folders other than OUTBOX
- removed debugging code
- added support for threadId
- fixed permission problems
- changed to use ContentProviderClients for Email app access
- fixed names for member vars

UPDATE: Moved the MAP E-mail API to the bluetooth package.

UPDATE: Added check for the presense of MMS parts.
This is needed due to a change in the MMS app/subsystem,
where deleted messages gets corrupted.

Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Change-Id: Ib5dbe7c2d5c0ba8d978ae843d840028592e3cab4
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
e3ee0a6264913deb28c160f5c32cb3367e97ee45 09-Jul-2014 Ang Li <angli@google.com> Make ACTION_CONNECTION_ACCESS_REQUEST to be sent in ordered fashion.

The purpose of this change is to enable automated testing
to confirm incoming connection without involving human.
Remove .setClass so the intent is no longer only sent to Settings.
This is ok because the intent is still hidden and protected.
Remove unused imports.

Change-Id: I3be5df4ab440b299a75ec41d566f9eecb0ab3f31
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
43b941ed67f10876a3d730cc095ddb6589e9c1b6 26-Nov-2013 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove pending MAP authorization pop up

- If USER turn off BT on DUT before accepting incoming
authorization request for MAP connection, then MAP
authorization pop up should be removed. Thsi was failing
as user time-out scenario was not handled currently,
where MAP OBEX session is stopped. So MAP OBEX session will
not get cleared till BT OFF. So MAP OBEX connection was failing
from next iteration onward. Queuing User time-out(30 seconds)
to disconnect MAP OBEX session to solve this issue.

-If ACL is disconnected by remote device before accepting
incoming authorization request for MAP connection, then MAP
authorization pop up should be removed.

Change-Id: Ib8068f793eb1b55a155d3ff657efefc40728233c
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
c09b531ba47eee740485b0c6022981fc38ef1587 27-Nov-2013 Zhihai Xu <zhihaixu@google.com> release wakelock if no activity in Bluetooth MAP profile to avoid waste power.

bug:11138488
Change-Id: Ie7d8903cc917aee51711fa47f275863e4046f3d8
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
824929471ee80476e6d6774eedac9f30c5623eb2 23-Oct-2013 Zhihai Xu <zhihaixu@google.com> MAP: fix problem with MNS not disconnecting correctly

MNS is needed to disconnect with the MSE but did not.
This patch fixes that by re-adding a disconnect() that was wrongfully removed during review.
Patch set 2:
-----------
- Split disconnect and shutdown for MNS connection
bug: 11161674
Change-Id: Idd09fc774584dfdb171b0d00be0f7711ae57b853
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
98df3e8ff33a6137d4ea13845b583aaee2670613 11-Oct-2013 Casper Bonde <c.bonde@samsung.com> Fix for MAP/PBAP: Race-condition when requesting authorization from Settings app

When MAP and PBAP requests authorization from the Settings app via Intents,
it also sets a state isWaitingForAuthorization to indicate
that it should handle incoming replies.
This is however done in the code after the intent have been sent
and in some cases the reply for the intent is returned
before the state has been update = no handling of the reply.
This only happens on the second connect with a paired device and
only when the user have selected the "do not ask again" checkmark
in the popup requesting access.

FIX:
Move the update of isWaitingAuthorization to before sending the intent to settings

bug: 11179645
Change-Id: I25b019e32a01caa8509c8f97195712120823afa9
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
70bfe3280ce158c39dbb25fe18386f0d10b490d3 24-Sep-2013 Zhihai Xu <zhihaixu@google.com> Unable to receive Text Message to CAR Kit(nuvi3580LM)

The problem is when we receive the SetNotificationRegistration,
the MNS thread is not ready yet.so the notification is not enabled.
so we won't send new message notification to Carkit.

bug:10898884

Change-Id: Ibaa4a92694bcbb1ea2fb4e8a3de0ff30acdafeb1
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
70be005a18a35ec5fcb46152f0dfbe82156efa3a 22-Aug-2013 Kim Schulz <k.schulz@samsung.com> Fixes to the google review comments + spec 1.1

- updated code to comply with MAP spec 1.1
- removed activity + strings.xml
- removed unused notification code
- fixed TODOs
- added more string validation and case insensitivity
- fixed internal+google review comments
- Added dump of incoming bMessages to /sdcard/bluetooth/log when verbose debug in enabled. Only the latest received message will be stored
- Fix functions msgListingSize and msgListingHasUnread to also consider mms filter message type
- Fix wrong tag length define for notification status parameter
- Re-added shutdown code to interupt the MNS
- removed map activity
- Added initial bluetooth map unit tests
- Fix map event report xml start tag to uppercase 'MAP'
- added support for using ProfileService class
- changed the way the Broadcast Receiver was implemented
- Fixed minor bugs found during Automotive Test Event
- FilterPeriod application parameters can be present, but with zero length
- For MMS the end-boundary were added too early
- The FOLDER entry in bMessage can be empty for a message push
- Wrong error value returned for a set status operation with a wrong handle
- In getMessage() exclude all binary content and smil.xml if the appParam attachment is set to "no".
- Set correct content id and content location for mms. Fix mms mime parser bug.
- moved disconnect to Handler thread
- fixed multipart-message split bug.
- added a few Unit tests for multi-part messages
- MMS parser optimized
- fixed exception in MNS obex Client
- fixed problem with Native PDUs not getting correct timestamp
- corrected mixup in ordinator/recipient for MMS

Change-Id: I3875762822a7f8ce0132065e0da5d0257e3850a1
Bug:10692365
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java
fd6603b8bf9ed72dcc8bd59aaef3209251b6e17c 19-Jul-2013 Matthew Xie <mattx@google.com> Bluetooth MAP profile - sms and mms support initial check-in

bug:10116530

Change-Id: If9ce878d71c1e1b12416014c433da03b3033e158
/packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapService.java