huaweigeneric-ril: update LOG() macros for Jelly Bean

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
use proper service start/stop for pppd

This cleans up the code a lot and no longer requires rild to
keep running as root.

As a bonus, pass optional username and password to pppd on
commandline.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
pass LAC and CID as decimal values

In the response to  RIL_REQUEST_{VOICE,DATA}_REGISTRATION_STATE,
pass LAC and CID as decimal values. Although the documentation
in ril.h shows them as hexidecimal, the Java RIL layer does
not support hex values (not even when prefixed with 0x).

This prevents RILJ from throwing exceptions.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Fix handling of RIL_REQUEST_ENTER_SIM_PIN

First of all, if the data contains two pointers, the second might still
be NULL, causing "(null)" to be passed as the new PIN (two arguments means
enter PUK and new PIN). This was seen happening on 4.1.1 (Jelly Bean).

Second, the +CPIN command returns just OK on success, not +CREG! +CREG
could be sent as an unsolicited response, as a successful +CPIN command
will make the ME operational and could cause the ME to register itself
with the network, but this is not mandatory!

The +CREG if sent will be picked up by the RILJ layer anyway.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Edit README to match new service usage

Besides removing the wrapper script, also move the ttyUSB* handling
to ueventd.myboard.rc, where it can be done with a single line, and
do some general formatting for readability.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Provide backwards compatibility for pre-Jelly Bean

To make sure we can still use this RIL for earlier Android versions,
like ICS, just define the ALOG* functions as LOG* if not defined.

This patch can be reverted when no support for earlier versions
is required anymore.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Use 0 as default value for LAC and CID

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
getVersion(): return correct name

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Fix error check to prevent NULL pointer reference

In requestRegistrationState, after a call to at_send_command_singleline(),
only error was checked, but not success. It turns out that if error is 0,
but success is 0 also, p_response->p_intermediates can be NULL.

This happened with an EM770W on Jelly Bean, causing rild to continuously
crash.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
After successfully specifying the PIN, enable network notifications

This needs to be done explicitely here because many modules will not
accept these commands before the PIN is entered, and our RIL does try
to set them before the PIN is set.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Add support files to repository

Add the ip-up script to setup the required network properties on
successful pppd connection and a properly filled in apns-conf.xml
file to the repository, for use by builds utilizing this RIL.

This way, all the dependencies of this RIL are clear and we can
share any additional APNs easily.

Signed-off-by: Ithamar R. Adema <ithamar.adema@team-embedded.nl>
Merge pull request #1 from UpgradeAndroid/ics

merge Ithamar's work