- change #define to const char* for consistency
- change int to bool for bool flags
- make debug log messages more concise, multi-line messages (that could be one-line) make watching the debug log difficult
Performing proper ICC_IO operations depends on the type of the SIM card.
For example, the Desire Z will work with FCP Template, so we need to
follow TS 102.221 table 11.2 to perform the proper request and get a FCP
Template. This is done when we write the ICC_IO command: we need to set
the p2/p3 fields depending on the SIM card type (SIM or USIM) so that
the proper behavior is triggered.
|MainThreadTask| performs different operations on the main thread,
depending on a given command flag. There is only one command, CLOSE_SCO,
in use.
This patch removes the command infrastructure and replaces |MainThreadTask|
by |CloseScoRunnable|, which implements only this single operation.
A number of notifications dispatch runnables to the main thread for
invoking actions. This is not requireed, as notifications already
run on the main thread. This patch merges the runnable's code into
the respective notifications.
This patch replaces Handsfree callbacks by notifications. One
important change is that the first call to |BluetoothHandsfreeManager::Get|
now happens during initialization. Hence the Handsfree manager is now setup
immediately, instead of later at use.
The patch adds notifications support to the Handsfree manager. Each
notification's method is taken from the respective callback code, with
changes to the arguments' data types.
The notification interface consists of virtual methods that are
invoked form the Bluetooth backend on certain events. The Handsfree
manager can implement the methods to handle these events.
All interfaces for Bluetooth profiles are now always available, so we
don't have to check for specific versions of Bluedroid. Instead, we
try to call the methods, and check their results.
The methods of |BluetoothAVRCPInterface| are now always available. On
Android versions before 18, which don't support AVRCP, they always
fail with STATUS_UNSUPPORTED.
This patch removes unsued code from |BluetoothServiceBluedroid|, related
functions, and cleans up the file. It
* removes callbacks,
* removes callback helper tasks,
* removes helper functions, and
* cleans up global variables.
Bluedroid callbacks were usually called on a separate thread that
was specific to this task. So Gecko's Bluetooth Core contained a
number of runnables for executing callback operations on the main
thread.
Since all notifications always run on the main thread, the extra
runnables are not required any longer. This patch integrates them
into the notification methods where possible.