2121 Commits

Author SHA1 Message Date
Jake Hamby
47509c744f Merge "Change SMS security check to enforceCallingPermission()." into jb-dev 2012-05-14 13:12:14 -07:00
Jeff Brown
7304c34382 Move power HAL interactions to PowerManagerService.
This refactoring sets the stage for a follow-on change that
will make use additional functions of the power HAL.

Moved functionality from android.os.Power into PowerManagerService.
None of these functions make sense being called outside of the
system server.  Moving them to the PowerManagerService makes it
easier to ensure that the power HAL is initialized exactly once.

Similarly, moved ShutdownThread out of the policy package and into
the services package where it can tie into the PowerManagerService
as needed.

Bug: 6435382
Change-Id: I958241bb124fb4410d96f5d5eb00ed68d60b29e5
2012-05-11 18:42:42 -07:00
Wink Saville
e9aa4b27af Merge "Add additional debug for time zone handling." into jb-dev 2012-05-10 23:05:54 -07:00
Wink Saville
26e1a02ba3 Add additional debug for time zone handling.
Change-Id: Ie46bba7e0ef7737a865f7efadbf963c2d14e488f
2012-05-10 16:23:39 -07:00
Robert Greenwalt
26ee989576 Fix some apn settings issues.
Correct some logging that was misleading and be more precise in our
removal of things from the waiting list.

bug:6445253
Change-Id: I97b20b851617149a24303276392de403dbde2a8f
2012-05-09 15:35:06 -07:00
Jake Hamby
6de4da4461 Change SMS security check to enforceCallingPermission().
The permission check for IccSmsInterfaceManager.sendText() was changed from
enforceCallingPermission() to enforceCallingOrSelfPermission() to enable the
Phone app to send SMS's directly for the "reply by SMS" feature. That feature
was implemented in a different way (handled by the MMS app), so the permission
check can be changed back to the original enforceCallingPermission(). Verified
that SMS can still be sent, including "reply by SMS" for an incoming call.

Bug: 4686733
Change-Id: If844a0c485de0a87857d8f82a3452e776005153e
2012-05-09 15:17:16 -07:00
Daisuke Miyakawa
e69ec2253c Remove STOPSHIP part of the logging in telephony
We still need the log itself to trap the exceptional case.

Bug: 6201805
Change-Id: I62d12f6a1ed41817ee12c0f5c7fc4aa0a967a60f
2012-05-09 11:44:58 -07:00
John Wang
290e1c9396 Set provider name in airplane mode.
Set eriText to correct provider alpha during power_off state.

bug:5262482
Change-Id: Ic72aaf0465cde6934a2b46d4b9520627ac0ac335
2012-05-07 16:41:29 -07:00
Wink Saville
1d7c1f1117 Rename isTimeZoneFixNeeded to shouldFixTimeZoneNow.
Change-Id: I01c73a0afaa17793f9dea1b78c9fe49fa138f787
2012-05-03 10:34:57 -07:00
Wink Saville
9a992450cb Merge "Time can become incorrect when no sim is present or mcc changes." into jb-dev 2012-05-03 09:35:27 -07:00
Wink Saville
f0f43227a7 Time can become incorrect when no sim is present or mcc changes.
bug: 6393147
Change-Id: I07ad74998b03af532ccf704a8a7e4844f5829b14
2012-05-03 09:26:25 -07:00
John Wang
6ac0471da7 Enable restart in getSpnFsm().
If the FSM gets restart while waiting for one of
SPN EFs results (i.e. a SIM refresh occurs after issuing
read EF_CPHS_SPN), it will re-initialize only after
receiving and discarding the unfinished SPN EF result.

bug:5499225

Change-Id: I715fc2feabdd03435903f7dcb785c8f0154619bc
2012-05-02 17:10:51 -07:00
Robert Greenwalt
4dafaf117e Fix data roaming notification.
We shouldn't tell people we're not connected due to roaming if it's really because
of data-disabled.

Use the data-disabled setting to decide if we should inform people about
data-discon due to roaming.  Note this doesn't effect other notifications about roaming.

Also fix the data-enable/disable code to take roaming into account and clear/set the
roaming notification as needed (if data is enabled while we can't get on due to roaming
we should put up the roaming notifcation..  if data is disabled while that notification is
up we should take it down).

bug:5805666
Change-Id: I5c925dfdca4abc27e0034b113508df5719f04fae
2012-04-30 10:59:56 -07:00
Robert Greenwalt
7725180c64 Prefer the preferred APN for all types it supports
We used to only prefer it when connecting for default connection purposes,
but it makes sense to use the preference for all apn types it supports.

bug:6377793
Change-Id: I8b26b77fc0787121749cce9d32303ab24cc72c75
2012-04-25 09:44:53 -07:00
Daisuke Miyakawa
0205537536 Add debug log for 5914560 and 6383850
This won't be shown in usual condition since in most cases the method
will just use the block just above the logging and return true/false
there. On the other hand this might be useful if the case is truely
exceptional and thus this path is really used.

Bug: 5914560
Bug: 6383850
Change-Id: I2242f93a9b905b5a39d997aa30d9fd6f5bfbdf49
2012-04-25 08:03:22 -07:00
Ye Jingjing
53eb13ce0a Set AuthType to NONE if username of APN is not set
When APN is edited, if authType and username are both not
set, authType should be set to NONE before setup of
data call.

The code today checks mApn.user for NULL, but if
user has edited APN the mApn.user field will be set
to an empty string.

Change the check of mApn.user to also take care of
this case.

Change-Id: I0e49247d46e1ba93da6dd951bbb75acc63fac73f
2012-04-20 12:04:34 -07:00
Jake Hamby
d65c2be548 Merge "Add ContentProvider for apps to read received SMS cell broadcasts." 2012-04-19 16:15:42 -07:00
Wink Saville
d38e766e5e Merge "Fix calcuation of CMD_TO_STRING_COUNT." 2012-04-19 09:53:52 -07:00
Wink Saville
01ce0ce472 Fix calcuation of CMD_TO_STRING_COUNT.
Change-Id: I03ae1a545474d7dcd4e65c58d9befd020d5b9c54
2012-04-18 21:42:44 -07:00
Jake Hamby
c3296ffdfc Add ContentProvider for apps to read received SMS cell broadcasts.
The CellBroadcastReceiver app will allow apps with the new permission
"android.permission.READ_CELL_BROADCASTS" to read previously received
cell broadcast messages from a new ContentProvider database at URI
"content://cellbroadcasts". This will enable third parties to provide
additional information to users in the event of emergencies without
delaying or interfering with the initial system alert dialog to warn
the user when the alert is received.

Includes a new android.telephony.CellBroadcastMessage class which
can be instantiated from the Cursor retrieved from the ContentProvider.
This was previously a part of the CellBroadcastReceiver app, but can now
be used by third party apps with read permission on the ContentProvider.

Change-Id: I2c31f62b63c050c7946de2d81c28a5f4dc6f00b0
2012-04-18 16:41:19 -07:00
Wink Saville
ecd302259a Revert "Telephony: Dynamically instantiate IccCard"
This reverts commit fe37acae729529b8bf3a3140fa397bddce42b1e0

There are two bugs that are weekend release blockers:

  b/6357558
  b/6357880

6357558 is easily fixed with:

  https://android-git.corp.google.com/g/#/c/182228/

But there are still questions. Bug 6357880 has
unknown causes at the moment but this change is the
most likely candidate. So for today's pre-weekend
build we are reverting this change.
2012-04-18 15:37:21 -07:00
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