2100 Commits

Author SHA1 Message Date
Alex Yakavenka
fe37acae72 Telephony: Dynamically instantiate IccCard
Change-Id: I8c4d800158fb1eb12de66d437cb0d76695ff98d3
2012-04-17 15:00:30 -07:00
Daisuke Miyakawa
8334679be1 Merge "Introduce cachedPhotoIcon for notification's large icon" 2012-04-17 08:52:46 -07:00
Daisuke Miyakawa
265974803a Introduce cachedPhotoIcon for notification's large icon
Bug: 6336293
Change-Id: I492384fdb819dfd6574b0dbc84a0324c917c392c
2012-04-16 16:03:32 -07:00
jshin
f80310d3c5 Added API to replace unicoded digits to ascii numbers
Users can enter arabic phone number or click arabic phone number
to send MMS. Works for generic Unicode digits (full-width, etc.).

bug:5615791
Change-Id: Ieec8c5c6c3736ee2b4ac8ddf17f8c41b2001460e

Signed-off-by: Jake Hamby <jhamby@google.com>
2012-04-16 15:06:40 -07:00
Jake Hamby
e333c82da3 Convert Arabic phone numbers to ASCII when sending SMS.
Modify PhoneNumberUtils to automatically convert non-ASCII digits,
such as Arabic-Indic numbers, CJK full-width digits, etc., to ASCII
in normalizeNumber(), extractNetworkPortion(), and stripSeparators().

This enables the SMS application to support sending SMS's to phone
numbers written with Arabic, or other non-ASCII digits. The number will
be converted to ASCII digits and formatted for the user according to the
country formatting rules.

Bug: 5615791
Change-Id: I42039285db5795b1dda22e4251f54af302e27f13

Signed-off-by: Jake Hamby <jhamby@google.com>
2012-04-16 15:06:40 -07:00
Wink Saville
48a7bf24e3 Merge "Enhance the debug output for StateMachines." 2012-04-13 16:52:04 -07:00
Wink Saville
583eaaa57c Enhance the debug output for StateMachines.
Allow some messages to be ignored and allow the subclass to
add additional information. In particular, the information
can be used to decode the msg.what to a string.

Change-Id: I4f53becc6f0cb77399f99702084efef9d8785d67
2012-04-13 16:11:20 -07:00
Jake Hamby
b4bc99e847 Add user confirmation dialog before sending SMS to short code.
Non-system apps now require user confirmation before sending an SMS
to a short code that may potentially cost the user money. The number
is tested against regex patterns for short codes for the country
matching the user's SIM card or network. The user is warned if the
phone number is potentially or definitely a premium SMS number.

The regex patterns are loaded from core/res/res/xml/sms_short_codes.xml.
If the user's country is not found, then phone numbers of 5 digits or less
(excluding known emergency phone numbers) are considered to be potential
SMS short codes.

Command to run test cases:
$ runtest -c com.android.internal.telephony.SmsUsageMonitorShortCodeTest frameworks-telephony

Bug: 5513975
Change-Id: Ic0b483153390e974c632302f3061300bc2a2274a
2012-04-13 11:50:10 -07:00
Wink Saville
335ef47968 Fix phone is sometimes in America/Dawson canadian time zone
Add code that updates the time zone whenever the country code
or time zone changes. In bug 6269708 the device initially
reported the mcc as 001 and then a short time later it got
the correct code, 311. This could cause the time zone to be
reported as America/Dawson instead of America/Los_Angeles.

Bug: 6269708
Change-Id: Ibfb40ea1158d3b99c121ed9960a1f0b1a45980bd
2012-04-12 15:11:59 -07:00
Wink Saville
cbc41deaa3 Merge "Telephony: Fix NV ready state" 2012-04-09 14:22:13 -07:00
Wink Saville
431a4a3b97 Add some additional debug for set operator numeric.
Change-Id: I7e22a33f893984c1ad5bd9dd79428ad72d2b4d7c
2012-04-09 12:19:01 -07:00
Wink Saville
784eb36b88 Telephony: Fix NV ready state
Don't trigger RuimRecords onReady so that it doesn't overwrite
mccmnc property value set by CdmaPhone in NV case.

Bug: 6153667
Change-Id: I2f25f6a69deecd085f11dbe1dbf752c2fd51cecb
2012-04-09 12:14:03 -07:00
John Wang
2119ade6d7 Merge "Enhance Cell Location Api." 2012-04-05 16:51:32 -07:00
Jeff Sharkey
8fc27e8b87 Support metered Wi-Fi NetworkPolicy.
Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID.  Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode.  Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7
2012-04-05 16:02:25 -07:00
John Wang
963db55d59 Enhance Cell Location Api.
To boost accurary and enhance capability of cell location api,
two new APIs, TelephonyManager.getAllCellInfo() and
TelephonyManager.listen(LISTEN_CELL_INFO), are added. Two new
Class, CellInfo and CellIdentity, are created.

This API change returns all information of one cell locaiton
at the same time. It also provides additional LTE and timestamp information.

Change-Id: I4d0f813107e625ec4ac88c8d980ffd171aa5fc30
2012-04-05 11:30:37 -07:00
Wink Saville
e1bff46863 Merge "Add DebugService." 2012-04-02 11:49:53 -07:00
Wink Saville
30ccade7f9 Add DebugService.
This will dump the state of the telephony stack using:

  adb shell dumpsys activity service android.phone.TelephonyDebugService

The service is located in packages/app/Phone and TelephonyDebugService
instantiates DebugService and calls its dump method when asked
via the dumpsys command above.

Change-Id: I4d34c741544cafdadce2532de8b9c117a4d435a5
2012-04-02 10:54:34 -07:00
Daisuke Miyakawa
54e73321e5 Add supportsAdn()
Bug: 5487135
Change-Id: I52e570ef5d175ed8ae971c5f9889496e30f2c528
2012-03-29 17:19:06 -07:00
Daisuke Miyakawa
5f12f03111 Move TelephonyCapabilities from Phone to telephony
- Move the class.
- Remove some TODOs mentioning this action : the class should belong to
  telephony layer instead of to the Phone package
- Add private strings used in the class

Bug: 6252254
Change-Id: I0d4ca2f8e4d775004d146fe6f9c60165a94366a9
2012-03-29 15:27:55 -07:00
Alex Yakavenka
12ef0981be Telephony: Remove IccFileHandler from PhoneBase
mIccCard is now be multi-thread safe but other similar
variables such as mIccRecords will be cleaned up in
the future and are no worse than before.

Change-Id: Ic2fc31af2575c2dc0bb30e7348dd9e76ec61e763
2012-03-26 13:57:57 -07:00
Alex Yakavenka
ce2dcb6f13 Telephony: Move Cat to IccCard
Change-Id: Ibbea7b8f277f33e71580d61f83645b0aaefef580
2012-03-21 13:04:36 -07:00
Alex Yakavenka
80198f2235 Telephony: Remove coupling between phone and IccRecords
Change-Id: I7af0f0f37c59b7554fa329a5b00ff28cb149b4d9
2012-03-21 04:00:13 -07:00
Jake Hamby
3e3c3f80a9 Add support for CMAS warning notifications over CDMA.
Refactor SMS Cell Broadcast support to enable receiving CMAS warning
notifications over CDMA. The CellBroadcastReceiver app must also be
updated with the corresponding change. All cell broadcasts are now
delivered as a Parcelable SmsCbMessage object in the "message" extra
of the SMS_CB_RECEIVED_ACTION or SMS_EMERGENCY_CB_RECEIVED_ACTION,
instead of as a GSM/UMTS "pdu" byte array.

Existing functionality for ETWS and CMAS alerts over GSM/UMTS continues
to be supported using the new radio-technology independent SmsCbMessage
and related objects. Test cases are added to verify that valid and
invalid broadcast data is handled appropriately.

Unit testing discovered a bug in the BitwiseOutputStream utility class
used by the added test cases. When the BitwiseOutputStream object must be
expanded (in the private possExpand() method), the mEnd field is not
updated to the new array size. This causes a new array to be allocated
on every new write, and for all data beyond the original array allocation
to be replaced with zeroes. Fixed by adding a line to possExpand() to
update mEnd. Added a test case to BitwiseStreamsTest to verify the fix.
Besides the test cases, BitwiseOutputStream is only used by BearerData in
two places, both of which allocate a sufficient initial buffer. So the
bug in BitwiseOutputStream is not critical to fix for normal operation,
but should be fixed so that the test cases using it function correctly.

Bug: 5856308
Change-Id: I201ecbf11607fd200aaae3cbb32561efabf65672
2012-03-13 15:31:33 -07:00
Alex Yakavenka
2b75d12a7b Telephony: Make IccFileHandler use ci instead of phone
Change-Id: I94889b5b7954d9c16721f12145e8412ba418ac12
2012-03-13 11:39:03 -07:00
Wink Saville
33c67dcb23 am 2a0eed20: am 442612a2: am f4ae6aab: Allow CDMA on LTE devices to get data connections even if otasp is needed.
* commit '2a0eed20b5828877b2db24bf49468e10c3f1b36b':
  Allow CDMA on LTE devices to get data connections even if otasp is needed.
2012-03-12 16:00:09 -07:00
Wink Saville
f4ae6aabbc Allow CDMA on LTE devices to get data connections even if otasp is needed.
Bearer Independent Protocol (BIP) connections as defined in
ETSI TS 102 223 "Smart Cards; Card Application Toolkit (CAT) (Release 11)"
need to be able to establish data connections even when not provisioned.
This can occur when trying to provision on via and EVDO network.

Bug: 6110632
Change-Id: I85722e0ba2e2606ffcf2516b8f00be6ff5271adf
2012-03-10 13:23:35 -08:00
Todor Kalaydjiev
26a92257b4 Support auto-complete in PhoneNumberFormattingTextWatcher. Also, simplify logic.
Previously, the assumption was that only a deletion or an insertion can happen
at a time; but with auto-complete, a deletion and insertion happen at the same time.

Needed for bug 5992672 in the Messaging app and is nice to have in the platform.

Change-Id: I2d80cecc486e7a1ceeaeb34866bcd834074f5ead
2012-03-08 10:22:42 -08:00
Wink Saville
22c1700378 Telephony: Create and use UiccController
UiccController creates and disposes IccCard
IccRecords and IccFileHandler is part of IccCard

Change-Id: I3dfb476c76162bbe8443271927a06743bb5e39c4
2012-03-06 17:11:49 -08:00
Wink Saville
7eed139cdf Merge "Telephony: Remove SimCard and RuimCard" 2012-03-01 17:03:47 -08:00
John Wang
393acacd61 Merge "[maguro] Add Cheers' MCCMNC in SIMRecords.java" 2012-03-01 10:52:47 -08:00
Sangcheol Lee
859b7ef8f0 [maguro] Add Cheers' MCCMNC in SIMRecords.java
[issue 5963659]
Result:
There is no APN information for Cheers

Expected Result:
Mobile internet APN name for Cheers should be displayed

Change-Id: Iab29cfbd06ab15559048ced23136abae1fcab8f3
2012-03-01 10:29:51 -08:00
Wink Saville
a27421a306 If no NITZ information use Country Code to set TimeZone.
This is not perfect and only works if the CC is known via
the GSM radio and is only accurate if there is one time zone
per country. This does nothing to resolve time zone problems
for wifi only devices.

So this is a partial fix for bug 2896745

Bug: 2896745
Change-Id: I78f013836c4e4870b8b1016a8312f5adbe0d31c9
2012-03-01 10:25:48 -08:00
Jake Hamby
efba344b5a Revert "Add support for CMAS warning notifications over CDMA." I'll submit again when the app change is ready.
This reverts commit 0c49f03a0429b5c0c4a619256f7bca86a4997ae8
2012-02-29 14:00:12 -08:00
Alex Yakavenka
e7af59b375 Telephony: Remove SimCard and RuimCard
Remove notions of SimCard and RuimCard since they don't make sense
in the world of Uicc cards where each card can have multiple
3gpp and 3gpp2 subscriptions.

This change prepares code for the introduction of Uicc cards.

Change-Id: Ibab13004604f829328b73c177669b89ef97d3f25
2012-02-29 10:18:07 -08:00
Jake Hamby
0c49f03a04 Add support for CMAS warning notifications over CDMA.
Refactor SMS Cell Broadcast support to enable receiving CMAS warning
notifications over CDMA. The CellBroadcastReceiver app must also be
updated with the corresponding change. All cell broadcasts are now
delivered as a Parcelable SmsCbMessage object in the "message" extra
of the SMS_CB_RECEIVED_ACTION or SMS_EMERGENCY_CB_RECEIVED_ACTION,
instead of as a GSM/UMTS "pdu" byte array.

Existing functionality for ETWS and CMAS alerts over GSM/UMTS continues
to be supported using the new radio-technology independent SmsCbMessage
and related objects. Test cases are added to verify that valid and
invalid broadcast data is handled appropriately.

Unit testing discovered a bug in the BitwiseOutputStream utility class
used by the added test cases. When the BitwiseOutputStream object must be
expanded (in the private possExpand() method), the mEnd field is not
updated to the new array size. This causes a new array to be allocated
on every new write, and for all data beyond the original array allocation
to be replaced with zeroes. Fixed by adding a line to possExpand() to
update mEnd. Added a test case to BitwiseStreamsTest to verify the fix.
Besides the test cases, BitwiseOutputStream is only used by BearerData in
two places, both of which allocate a sufficient initial buffer. So the
bug in BitwiseOutputStream is not critical to fix for normal operation,
but should be fixed so that the test cases using it function correctly.

Bug: 5856308
Change-Id: Ie3e6af747976ce9b8a3e71e76fec71709cf86545
2012-02-28 16:49:17 -08:00
John Huang
fd400f5f48 Merge "Prevent dial() return null in a racing condition." 2012-02-27 13:47:13 -08:00
John Wang
0593c68a98 Prevent dial() return null in a racing condition.
The racing condition happens between dial() returns and
the first GET_CURRENT_CALLS query gets handled.

If GET_CURRENT_CALLS gets handled before dial() finishs, the pendingMO can be set
to null in handlePollCalls() so that dial() will return null. This null connection causes
error in PhoneUtils.placeCall().

The Synchronized dial() and handlePollCalls() Methods will make sure the
dial() returns before the first GET_CURRENT_CALLS gets handled.

bug:6028290
Change-Id: I41b024760acb7dd13b342866180dffe3fdbe1c03
2012-02-24 22:26:34 -08:00
Mathias Agopian
d13f9aa8b1 attempt to fix IMSFramework crash
Change-Id: Iad6dd85afe8f37c1e443c116162d75f116c24316
2012-02-24 19:32:03 -08:00
Robert Greenwalt
6513daef5e Merge "Seperate RIL constants from the framework." 2012-02-24 15:02:30 -08:00
Robert Greenwalt
1434d7b855 Seperate RIL constants from the framework.
We have two sets of constants for network type.  One used by the RIL can't
be changed without big pains with OEM/Radio vendors.  The other has been published
as part of the framework and can't be easily changed either.

Separate the two so it's clear where one should be used versus the other.

bug:5717664
Change-Id: Ibf21f9165662e75557c7254fc9ad9a4870ba4af9
2012-02-24 09:37:37 -08:00
Daisuke Miyakawa
ddda82cd62 Merge "Introduce convertAndStrip()" 2012-02-15 12:22:06 -08:00
Daisuke Miyakawa
510db8feb6 Introduce convertAndStrip()
Phone app will use this for actual phone calling, coping with
IccProvider, etc.

Add unit tests for the method, and stripSeparators() which is missing

Bug: 5546664
Change-Id: I49b996abe7a44f7db4301b62f667189281fc40e9
2012-02-15 11:29:21 -08:00
Robert Greenwalt
2d9d7fb74b am 1b2583c4: am 7874efeb: am c8711ca7: Merge "Stop using shared DUN APN when tethering stops." into ics-mr1
* commit '1b2583c41c37c055821d8f4ebbdc717f108c3b48':
  Stop using shared DUN APN when tethering stops.
2012-02-15 07:53:53 -08:00
Robert Greenwalt
f8b8eafc45 am 7a08ef44: am e3776a47: am fc19160a: Merge "Add a config to set Dun capabilities." into ics-mr1
* commit '7a08ef442ad6138352785690a8e341607d763399':
  Add a config to set Dun capabilities.
2012-02-15 07:53:51 -08:00
Robert Greenwalt
c8711ca7eb Merge "Stop using shared DUN APN when tethering stops." into ics-mr1 2012-02-14 13:38:15 -08:00
Robert Greenwalt
2384386f31 Stop using shared DUN APN when tethering stops.
Backported from master, including a bug fix and a cdma enhancement.

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:5972599
Change-Id: I25e4831855e6b62c0c3ab3a6f4d4846aaee6ac50
2012-02-14 11:44:09 -08:00
Robert Greenwalt
8d27f20ac2 Add a config to set Dun capabilities.
Since CDMA doesn't use APN settings there was no place to say what a cdma
device's DUN connection would support, so by default normal device
originating traffic would be blocked on a tethering single-connection device.

With this change you can (via overlay) say that it supports everything
so mms and on-device browsing/email will still work even when on a dun connection.

The reason to allow both: some carriers will charge per byte for dun access
and so they don't want lots of non-tethering traffic used (costs the user alot)
but other carriers just use a dun connection to limit access to tethering, but
once there give unlimited data, so it makes sense to support everything there.

bug:5972599
Change-Id: I78fd7f3ac63c51a0560b659ed5ec219b10a93f8d
2012-02-14 11:29:36 -08:00
Makoto Onuki
75400e775e Merge "Fix the 3-parameter formatNumber to correctly handle IDDs." 2012-02-13 15:20:40 -08:00
Wink Saville
1b6512127b Merge "Add ril.test.emergency system property." 2012-02-08 09:19:19 -08:00
Wink Saville
28900a7b36 Merge "Fix INTENT_RECONNECT_ALARM_EXTRA_xx, make strings meaningful." 2012-02-07 15:56:23 -08:00