2182 Commits

Author SHA1 Message Date
Shaopeng Jia
26cd243601 Fix the 3-parameter formatNumber to correctly handle IDDs.
Also added more unittests.

Bug: 5726454

Change-Id: I7fd96b47e7b0c34b66a2fe698308342e125ec0f3
2012-02-06 15:46:10 +01:00
Alex Yakavenka
2149014ed3 Telephony: Fix get_imsi and icc_io
Make get_imsi and icc_io requests to follow ril v6 interface

Change-Id: Ifdbdcfd943f985c759359e59ced82b67195f4163
2012-02-01 15:15:52 -08:00
Alex Yakavenka
8f24145805 Telephony: Fix sim_refresh as per ril v6
Change-Id: I2d237601c6fd58760c6d5d080709381fddc5cbbe
2012-02-01 12:27:39 -08:00
Justin Ho
7f8ab4b786 am 66146c4f: am 792d83c5: Merge "Use LTE SNR and RSRP to set signal level bar." into ics-mr1
* commit '66146c4f5b3930f7f5f08b845fb30f2bc24f8c3d':
  Use LTE SNR and RSRP to set signal level bar.
2012-01-31 14:05:26 -08:00
John Wang
5e39519396 Use LTE SNR and RSRP to set signal level bar.
The LTE signal strength level is the smaller one
between lte rsrp level and lte snr level if both
rsrp and snr are valid.

The lte snr mapping are

  Four  bars: SNR >= 45
  Three bars: 10 <= SNR < 45
  Two   bars: -30 <= SNR < 10
  One   bars: SNR < -30
  No    bars: No Service

The invalid value of lte snr is changed to INVALID_SNR
from -1, since -1 is a valid value of lte snr.

bug:5640958
Change-Id: If26aaba0c7fcc0fee3db488b5adfa02922f06715
2012-01-31 11:15:28 -08:00
John Wang
7a41c7013d am 136704a8: am b069833e: Merge "Adjust the LTE signal bar mapping." into ics-mr1
* commit '136704a803ed7dd419a452315d1c0fe4885ce441':
  Adjust the LTE signal bar mapping.
2012-01-30 11:25:48 -08:00
Jean-Michel Trivi
4ed37ea81a Bug 5567648 Request and abandon audio focus in calls
Up to now, audio focus was implicitly requested and abandoned
 when changing the audio mode. This is no longer the case so the
 behavior with regards to audio focus can be indepently set by
 the CallManager.
The logic implemented here is the same as the one previously used
 in AudioService:
  - only request audio focus when the ring volume index is > 0
    when ringing,
  - request focus before setting the audio mode to a mode other
    than normal
  - abandon audio focus after setting the audio mode to normal

Change-Id: Ia543dc779563dbff09414771fee60e589dfaab9d
2012-01-27 14:20:27 -08:00
John Wang
2c911b2416 Adjust the LTE signal bar mapping.
The new mapping are

  Four  bars: RSRP >= -95dBm
  Three bars: -105 dBm <= RSRP < -95 dBm
  Two   bars: -115 dBm <= RSRP < -105 dBm
  One   bars: RSRP < -115 dBm
  No    bars: No Service

bug:5640958
Change-Id: I9efabaeac33b624ea0a58a4d3760169dff6544f6
2012-01-27 11:05:24 -08:00
Wink Saville
b2bf3350a2 Fix ClassCastException
In "Change I95ed2aae: Stop using shared DUN APN when tethering stops",
sha1: 8beff9586ff89a1e59469e9820fd9e9d704300d2, an assumption is made
that the msg.obj is always an ApnContext, this is not true for CDMA.
Eventually we plan on removing the destinction between GSM and CDMA but
for now we need to handle it handle it.

Bug: 5904734
Change-Id: I86873dc7aeda5234c14a6fe1e4ec7345ee30e957
2012-01-25 12:42:51 -08:00
Wink Saville
7c27ac64d5 Do not clear good TLVs when a error occurs decoding.
In change Ief74d0e4f4f28dff7a435e9dab1fab1ca1d9bfaf with a sha1 of
e81932e92a773538e1ad1ad1d4bfd8f241860c8d it seemed like a good idea
to throw away all TLV's on errors. In retrospect that was probably
not a good idea. For example on the MTN Ghana SIM the error
occurs because of some 0 pad bytes at the end, all of the actual
TLV's are good, so throwing away everything is unreasonable. Instead
accepting what is valid seems a better approach.

Also, add a couple debug lines on error paths.

Change-Id: I4add0c9cd242f46e0ef8700229d0ec755b9e4c4c
2012-01-23 12:19:20 -08:00
Wink Saville
18798131c6 Merge "Additional logging information for Card Application Toolkit/SIM Toolkit" 2012-01-20 15:56:56 -08:00
Wink Saville
ea7527eca9 Additional logging information for Card Application Toolkit/SIM Toolkit
Add an optional explanation field and toString to ResultException
Add toString to CommandDetails.
Add add a few more log statements on error paths.

Bug: 5852715
Change-Id: I8594178002a67798aa3fb38ce1ee15c1a41f1854
2012-01-20 15:49:36 -08:00
Robert Greenwalt
2772143eff Merge "Stop using shared DUN APN when tethering stops." 2012-01-20 14:35:41 -08:00
Wink Saville
170bfe32ab am 7b6231a4: am aba79851: Merge "Use new preferredAPN URI avoiding onApnChanged() call with self-change" into ics-mr1
* commit '7b6231a44e21fbf5b2bc2a5eff2231139ac4088f':
  Use new preferredAPN URI avoiding onApnChanged() call with self-change
2012-01-18 16:08:04 -08:00
Wink Saville
1e6329d454 Use new preferredAPN URI avoiding onApnChanged() call with self-change
Solving the issue that setting preferred APN from GDCT triggers
back APN change event and force unnecessary data call disconnects
and setups.

The new URI is added in Telephony Provider so ContentObserver
callback (results in onApnChanged) will not be triggered.

Bug:5448858
Change-Id: I4c0bcf32cec69cf1d0a0430f7a27495b89e93625
2012-01-17 11:31:54 -08:00
John Huang
70f52e6d79 am e6572304: am 2753e826: Merge "Fix teardown of secondary connections on CDMA" into ics-mr1
* commit 'e65723044d6ad7fb2ff1bb760100a3cf40c6c5f2':
  Fix teardown of secondary connections on CDMA
2012-01-13 11:41:01 -08:00
Sean Barbeau
9a18320ef4 Adds documentation to CdmaCellLocation get lat/long methods
Adds better documentation to the getBaseStationLatitude() and
getBaseStationLongitude() methods to indicate the units for latitude
and longitude in CdmaCellLocation. Unlike the Android Location API
methods, latitude and longitude in CdmaCellLocation are not in decimal
degrees but instead in 0.25 seconds due to a more obscure 3GPP standard
underlying the Telephony API.  The current Javadocs on the Android
developer page (http://goo.gl/hvWo6) do not indicate the units for
latitude and longitude in CdmaCellLocation, making it very difficult
for developers to interpret the output of these methods, especially
since 0.25 seconds is not a commonly used unit for latitude and longitude
in application-level code.  This patch adds clear documentation to
these methods so developers can clearly understand the units for
latitude and longitude without having to dig through the Android
platform source code.

Change-Id: I259bfe3b68e3999804877821680fb99a22937651
Signed-off-by: Sean Barbeau <sjbarbeau@gmail.com>
2012-01-12 22:53:01 -05:00
Robert Greenwalt
2fceb7fec0 Fix teardown of secondary connections on CDMA
Restores functionallity from Gingerbread.  We should tear down when the
enabledcount goes to zero, but we should always notify and attempt to
switch back to default when indicated.

bug:5830081
Change-Id: Ib8469bb5369da21e8cc05fb755b2d7e24c8e02a6
2012-01-12 17:38:54 -08:00
Robert Greenwalt
140d0158c4 Merge "Ignore case on apn type strings." 2012-01-12 09:25:25 -08:00
Robert Greenwalt
bcf1276830 Ignore case on apn type strings.
Found that if the type were not lowercase it wouldn't match.
That's silly.  Do case-insensitive compares.

bug:5525764
Change-Id: Ibfe6be6c34116e00931594ec317fe192e1756ade
2012-01-11 17:01:50 -08:00
John Wang
1f7b23dda2 am 70205788: am 6ad68ba9: Adjust the mapping of LTE signal bars.
* commit '70205788fa39968b8331085597e3d3b61e271fbe':
  Adjust the mapping of LTE signal bars.
2012-01-11 16:05:14 -08:00
John Wang
6ad68ba9d9 Adjust the mapping of LTE signal bars.
bug:5640958
Change-Id: I91efc5a81b505aae59dac9b1d69314efaffda6b6
2012-01-11 14:47:19 -08:00
Wink Saville
7c20c4607c Add ril.test.emergency system property.
This allows testing of emergency numbers by dialing an emergency
number but having it remapped to another number.

Bug: 5479306
Change-Id: Ia9bb53e2e2e47f78dc9f75d3add6f785d10e4b2a
2012-01-10 17:04:21 -08:00
Wink Saville
7a939077bd Merge "Add use of net.tethering.noprovisioning to fetchDunApn" 2012-01-06 23:43:37 -08:00
Wink Saville
43420a49f9 Add use of net.tethering.noprovisioning to fetchDunApn
To make it easier to test tethering, have fetchDunApn
return null when the system property
net.tethering.noprovisioning is true.

Change-Id: Id6162967c6b8b25f04380fe009961c150fa714ef
2012-01-06 17:24:27 -08:00
Wink Saville
bbfec33d94 am f817e941: am 2f143a96: Merge "Fix an RuntimeExcpetion in GsmDCT.onDataSetupComplete" into ics-mr1
* commit 'f817e9413356de2a303e14709e67457190e976c9':
  Fix an RuntimeExcpetion in GsmDCT.onDataSetupComplete
2012-01-06 14:32:37 -08:00
Wink Saville
17907a7b74 Fix an RuntimeExcpetion in GsmDCT.onDataSetupComplete
Instead of throwing an exception when the connection between
the DCT and a DC is broken (i.e. its null) it is treated as
an error with a new cause. And thus will be handled as other
typical errors.

Bug: 5798643
Change-Id: I46f1660ae78f118b54ab62504809723ca302b2ef
2012-01-05 17:21:46 -08:00
Wink Saville
9a03482c66 am 3ed28036: am c697ebfd: Merge "Enhancement on ICS data stall polling logic" into ics-mr1
* commit '3ed2803691cc271fe6b893dc46d49fca2fce61df':
  Enhancement on ICS data stall polling logic
2012-01-04 21:52:13 -08:00
Wink Saville
efd617e01f am 0ad96f89: am d4d35168: Merge "Add support of dislaying Alpha tag for BIP commands" into ics-mr1
* commit '0ad96f89401920486b68d8404f6a143870d57500':
  Add support of dislaying Alpha tag for BIP commands
2012-01-04 21:52:10 -08:00
Wink Saville
7da207b574 am a3534ad4: am c97d0e43: Merge "Support suggestedRetryTime in CDMA DCT" into ics-mr1
* commit 'a3534ad4a4b936a2629f4a0b854b814b3494ac7e':
  Support suggestedRetryTime in CDMA DCT
2012-01-04 21:52:06 -08:00
Wink Saville
c697ebfdd6 Merge "Enhancement on ICS data stall polling logic" into ics-mr1 2012-01-04 13:53:25 -08:00
Wink Saville
d4d3516812 Merge "Add support of dislaying Alpha tag for BIP commands" into ics-mr1 2012-01-04 13:50:04 -08:00
Kazuhiro Ondo
7efb89b955 Enhancement on ICS data stall polling logic
Put enhancements on data stall polling logic in ICS so that
stall recovery can kick in earler while screen is on.

Bug: 5767897
Change-Id: I4683fc45c0161f4374749c8e5840261c19a48f77
2012-01-04 11:09:51 -08:00
Robert Greenwalt
8beff9586f Stop using shared DUN APN when tethering stops.
Even if other people are sharing the connection (ie, carrier wants
default and tethered traffic on the same APN) stop using
a carrier-described APN when the tethering stops.

bug:5525764
Change-Id: I95ed2aaed4d79519d233a62cf2945edead8114bc
2012-01-03 16:32:04 -08:00
Wink Saville
81fa7f305b Add support of dislaying Alpha tag for BIP commands
While BIP data call setup is still handled in RIL/Modem,
this patch is adding support of Alpha tag display on UI.
Alpha tag is optionally included in "OPEN Channel", "Close Channel",
"Send Data" or "Receive Data" command.

"Open channel" will be notified via RIL_UNSOL_STK_PROACTIVE_COMMAND
which requires TERMINAL RESPONSE based on user input.
"Close channel", "Send Data" and "Receive Data" commands
are send via RIL_UNSOL_STK_EVENT_NOTIFY just to display
transient notice.

Bug:5165510
Change-Id: I873e55274c860886bc816ce6fb07cb882d339214
2012-01-03 15:06:15 -08:00
Wink Saville
e7f2cafc17 Merge "Separate SIM states from Radio states" 2011-12-29 16:41:09 -08:00
Naveen Kalla
fc2cbe9b46 Separate SIM states from Radio states
Radio state reflects the state of the modem. SIM_READY, RUIM_READY,
NV_READY are subscription states and it is possible that the new cards
have multiple subscriptions. Remove the SIM states from Radio State and
introduce a new VOICE_RADIO_TECH message to identify the exact voice
technology. SIM states will continue to be identified from the
SIM_STATUS messages.

Change-Id: Ia67d54f43b6c3340d9cf5c27fcb6f7ef49ef4d40
2011-12-29 15:08:20 -08:00
Robert Greenwalt
2cc19b1cc9 Use shared connections over retries.
Old code would detect we were in a retry loop and ignore other active
connections we could share.  We really want live shared connections to
dominate over retrying disconnected ones.

bug:5525764
Change-Id: If93383c52024113eec595b31e46897d1fcabc44c
2011-12-20 17:28:58 -08:00
Kazuhiro Ondo
6de972a5c3 Support suggestedRetryTime in CDMA DCT
Support suggestedRetryTime in SETUP_DATA response in CDMA DCT.

Bug: 5740832
Change-Id: I4abd884bec76f1d9ee29d1ba36c7ea2cac9e0fb3
2011-12-20 17:04:52 -08:00
Wink Saville
a78a08b103 am ea75b822: am 234a5ef6: Merge "When the SIM_READY set current preferred network type." into ics-mr1
* commit 'ea75b82221dc9086cf97a791aed3b79ff3731bba':
  When the SIM_READY set current preferred network type.
2011-12-07 20:19:50 -08:00
Wink Saville
975d348c18 When the SIM_READY set current preferred network type.
This looks to fix a problem where the nv_data.bin file
file gets corrupted. When greping a radio log for "md5" if something
like following is seen:

  RIL(s)  : load_md5_state: MD5 state 1
  RIL(s)  : check_md5:
  RIL(s)  : compute_md5: path /efs/nv_data.bin
  RIL(s)  : check_md5: MD5 fail. orignal md5 '628647a8e5c6cac2d586199417c0103c' computed md5 '58a635cbaf5fe4ffb2797aeaa2b32709' (rild)
  RIL(s)  : check_md5:
  RIL(s)  : compute_md5: path /efs/.nv_data.bak

It means that corruption was detected and a back version was used
which is ok. Apparently that backup version can have the default
network type revert to 2G only thus causing the symptoms reported
in b/5695729 where after taking an OTA 2G becomes the default.

By calling setCurrentPreferredNetworkType when the sim is ready we
can reset the the network type to 3G.

Note: I also tried calling setCurrentPreferredNetworkType in
EVENT_RADIO_AVAILABLE but that didn't work and we would see
the response to setPreferredNetworkType failing as the ril wasn't ready.

  RILJ    : setCurrentPreferredNetworkType: 0
  RILJ    : [0004]> REQUEST_SET_PREFERRED_NETWORK_TYPE : 0
  RILJ    : [0004]< REQUEST_SET_PREFERRED_NETWORK_TYPE error: com.android.internal.telephony.CommandException: RADIO_NOT_AVAILABLE


Bug: 5695729
Change-Id: Ibbd29cda0b201a8c08f4dcfa5cec211611e1d599
2011-12-07 20:07:54 -08:00
John Wang
10fd37dd9e am 2de0b07f: am ca0a68cc: Merge "Correct the dialing number of structured MMI." into ics-mr1
* commit '2de0b07f47c3561b6e550ff630901d2776a437e3':
  Correct the dialing number of structured MMI.
2011-12-07 19:03:42 -08:00
John Wang
ca0a68cc8a Merge "Correct the dialing number of structured MMI." into ics-mr1 2011-12-07 18:49:28 -08:00
John Wang
2690817815 Correct the dialing number of structured MMI.
According to TS 22.030 6.5.2 "Structure of the MMI", the dialing number
can not end with #. The format is like *SC*SI#DN. Correct the mmi pattern
to exclude DN# case. With this fix, processCode() will tread *NNN#DN#,
e.g. *400#16 digit number# in bug 5622718, as USSD and send via
RIL_REQUEST_SEND_USSD.

bug:5622718
Change-Id: Ifc8d0edff4308602a5f3fc651cf116bf6bad3cbc
2011-12-07 16:38:56 -08:00
Robert Greenwalt
86a943951b am 2ebd3612: am f352491a: Merge "Trim leading zeros from ipv4 addrs." into ics-mr1
* commit '2ebd3612d82f728873f87cdbea9fa5513b5cfb39':
  Trim leading zeros from ipv4 addrs.
2011-12-07 12:33:24 -08:00
Robert Greenwalt
d4420ab2fb Trim leading zeros from ipv4 addrs.
Underlying libraries will interpret leading zeros as octal values and
fail.

bug:5262995
Change-Id: Iff949225bb6b941f7274ee81754e1f41ed719a6c
2011-12-07 09:58:48 -08:00
Robert Greenwalt
2a1152ac96 am 00f1ac80: am 2a7b5ab1: Merge "Be careful sharing connections when dun is in play" into ics-mr1
* commit '00f1ac8001b2bfe2ab70730d9c039ca4e633a2c2':
  Be careful sharing connections when dun is in play
2011-12-02 17:57:37 -08:00
Robert Greenwalt
7cb88dda5b Be careful sharing connections when dun is in play
A request for a DUN connection should only use the carriers requested dun connection.  Don't
share another connection unless it matches the carriers settings.

bug:5701374
Change-Id: I75a65fcfce1b218bd9ca4ce2ab85cbe850813321
2011-12-02 16:42:18 -08:00
Robert Greenwalt
89b262990f am c8e643a8: am 22d5d7b6: Merge "Fix state synchronization problem." into ics-mr1
* commit 'c8e643a86345ef7e2807946107062c9d8635455d':
  Fix state synchronization problem.
2011-12-01 09:46:14 -08:00
Robert Greenwalt
645c80654f Fix state synchronization problem.
Don't report that we're disconnected immediately if we're disconnecting when another
disconnect comes in.  Remove this behavior from the default handler and add a catch
all "yeah, we're disconnected already" to the inactive state.

bug:5568633
Change-Id: Iff7ccde2069b47f8ad8255f3bca0292b80041388
2011-11-30 15:07:30 -08:00