Bug 933654 - 1/3: refactor amodem_send.

The original amodem_send returns the reply string of a AT command,
and then ModemDriver determines whether the modem is now waiting for
SMS by comparing that string to '> '.  However, as we're to enable
unsolicited responses after the reply, such method is no longer
effective and could be error prone.

This patch moves all reply handling into android_modem.c and returns
and modem->waiting_sms in the end of amodem_send().
Bug 933654 - 2/3: allow extra unsolicited responses.

For AT command handlers, returning NULL was a convenient alias for
asking amodem_send() to reply "OK" for them.  To allow extra
unsolicited responses after the original reply, there must be some
way to notify amodem_send() that the reply has been sent and don't
bother appending another "OK".  There are also cases that return an
empty string ("", not NULL).  The NULL value then becomes the best
choice in both literal and semantic way.
Bug 933654 - 3/3: perform voice/data registration state change in handleRadioPower.
Merge remote-tracking branch 'b2g/master' into b2g-jellybean
Bug 942089 - Have different IccId for each sim card
Merge remote-tracking branch 'b2g/master' into b2g-jellybean
Added LLCP constants and primitives

The Logical Link Control Protocol (LLCP) is used to establish
connections over NFC. It's completely independend of NFC and
can also be used over any other networking technology.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NFC infrastructure

This commit adds some infrastructure for NFC debugging and logging.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NFC RF

The NFC RF data structure represents the state of an RF interface.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NFC device state

The NFC device state is an abstract implementation on the state
of a device. The state currently contains information about the
device's initialization, and a number of configuration options.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NCI parser

The NFC Controller Interface (NCI) is the standardized protocol
for talking to local NFC controllers. This commit implements a
number of NIC protocol primitives for the bcm2079x driver. There
are more primitives specified, which can be added when necessary.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added HCI parser

The Host Controller Interface is an older interface for talking
to NFC chipsets. This commit only adds minimum support for HCI,
so that the bcm2079x driver's initialization completes. HCI is
deprecated and shouldn't be used otherwise.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added Goldfish NFC device

This patch adds an NCI-compatible NFC device to the Goldfish
emulator. The NFC Communication Interface (NCI) is a standardized
protocol for communicating with NFC chipsets. The protocol is
generic enough to be vendor and chipset independend and can be
implemented by devices with NFC-like characteristics.

The NFC device in the Goldfish emulator handles NCI messages, and
responds accordingly. This will allow for simulating basic
functionality of an NFC chipset. Some HCI and proprietary commands
are also supported to allow for use of the BCM2079x driver in the
guest system.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NFC Remote Endpoint

A remote endpoint implements an external NFC device, such as a
tag. Remote endpoints with different properties can be implemented
and used in the emulator.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Added NFC console commands

There are currently 3 console commands for NFC, which allow
for injecting rf_discovery and rf_intf_activated notificatons,
and data messages into the emulated NFC device.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>