Commit Graph

3424 Commits

Author SHA1 Message Date
Nazanin Bakhshi
1ca89a995b Merge "Add device identifier permission checks to TelephonyPermissions" 2019-07-01 23:26:18 +00:00
Michael Groover
94672cea7c Add device identifier permission checks to TelephonyPermissions
Bug: 131916175
Fixes: 136305129
Test: atest PhoneSubInfoControllerTest
Change-Id: Icca98347ab76b7c3468b95756a33a758a3abde37
Merged-In: I3c82c53ec89cd17b34a61166ccc9e9747388efac
2019-07-01 17:53:11 +00:00
Nathan Harold
4d4e2474ea Merge "Revert "Use TM SubId in getDataState and getDataActivity"" 2019-06-27 22:11:18 +00:00
Nathan Harold
44173ee7b0 Revert "Use TM SubId in getDataState and getDataActivity"
This reverts commit b2ab846cf4.

Reason for revert: Decision has been made to keep the unsupported AIDL API.

Change-Id: I31219606974019ac46da789ec31ca9cb3a86eb13
2019-06-26 00:41:00 +00:00
Chen Xu
b6399511f8 Merge "move short code definitions to SmsManager Test API" 2019-06-25 17:18:46 +00:00
Neil Fuller
b8bdc72174 Merge "Migrate telephony code away from Time" 2019-06-25 08:48:17 +00:00
chen xu
0276e13b96 move short code definitions to SmsManager Test API
Bug: 127560420
Test: cts
Change-Id: I6a5ba2439713105b25913ba8eb081abfaafd1a2e
(cherry picked from commit 9c7fad9235)
Merged-in: I6a5ba2439713105b25913ba8eb081abfaafd1a2e
2019-06-24 21:12:48 +00:00
Steven Moreland
f961b9632f Merge "Remove obsolete reference to ServiceManagerNative." 2019-06-24 18:02:34 +00:00
Steven Moreland
bb25d1aeba Remove obsolete reference to ServiceManagerNative.
ServiceManagerNative.getDefault doesn't exist.

Bug: 135768100
Test: N/A
Change-Id: I6e04b54c986c3d0997429a8d810f2554d84dc119
2019-06-21 16:41:50 -07:00
Amit Mahajan
44ea78d8ff Merge "Set mOriginatingAddress and mRecipientAddress separately" 2019-06-21 23:23:12 +00:00
Amit Mahajan
3fdedfab76 Merge "Replace the IDD with the '+' sign" 2019-06-21 16:34:12 +00:00
Taesu Lee
da48fd8fc1 Set mOriginatingAddress and mRecipientAddress separately
Properly assign the address according to the parameters in the PDU for
3GPP2 SMS. mOriginatingAddress or mRecipientAddress should be used to
get the address according to the actual message type. And the destination
subaddress is added also.

Test: Manual

Change-Id: Ide734b7348ea5eb8cf460dac046e96609ed9d8b3
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-06-20 07:56:31 +09:00
Nathan Harold
b2ab846cf4 Use TM SubId in getDataState and getDataActivity
-Update getDataState() API to use the SubId specified
 by the TelephonyManager instance.

-Update the getDataActivity() API to use the SubId
 specified by the TelephonyManager instance.

Bug: 135205433
Test: manual (automated test is infeasible)
Change-Id: Icf27eab40b1f979892123dc4185db2a138c1ffc2
2019-06-17 18:29:09 -07:00
Jack Yu
807a82b3aa Fixed tethering failed when device is on CBRS
Fixed by using the correct sub id for CBRS subscription

Bug: 133852860
Test: Manual
Merged-In: If01e17becce9684556345eb76512f617b9a9278c
Change-Id: If01e17becce9684556345eb76512f617b9a9278c
(cherry picked from commit a952d2018b)
2019-06-17 18:29:09 -07:00
Neil Fuller
c18b91b35e Migrate telephony code away from Time
Switch telephony code under frameworks/base/ away from
android.text.format.Time. Time uses 32-bit ints to represent
seconds from the start of the Unix epoch and therefore will
break in 2038. Moving to java.time types avoids this problem.

Bug: 16550209
Test: build / boot / treehugger
Change-Id: I49e748f686709c0c38aa5ba37b37ec4ed1e68b55
2019-06-17 20:19:14 +01:00
Treehugger Robot
94deb1ca38 Merge "Assume successful delivery if no Message Status" 2019-06-13 23:32:09 +00:00
Brad Ebinger
05f4ff0a95 Trampoline SMS disambig dialog to Telephony
SmsManager used to display a "select default SMS
subscription" dialog every time SmsManager was used
and no default SMS subscription was set. This change
fixes the following issues:
1_ getSubscriptionId no longer pops up a disambig
dialog.
2) The disambig dialog no longer sets the
default, rather it waits for the response from the
user and performs the operation when it receives
a response.
2a) Dialogs can no longer be created from background
services, so we now have a restriction that if
the disambig dialog is shown via a background service,
we will use phone 0 as default (backwards compat for
apps targeting <Q) or fail (on apps targeting Q+).
3) If there is only one active subscription, use that
to perform the operation on MSIM devices instead of
asking and only displaying the one active subscription.
4) Certain non "user-facing" APIs that are used by
carrier apps no longer will pop up a UI.

Bug: 131713446
Bug: 130853716
Bug: 129141025

Test: run SmsManagerTestApp; atest TelephonyFrameworksTests

Merged-In: Ibbc07c961f1bdc19e1015885487e9f7b6a14fa83
Change-Id: I6be1c6d7bf6b6ee614b6a7d0369147e3b1890588
2019-06-13 18:30:14 +00:00
Taesu Lee
f018547425 Assume successful delivery if no Message Status
It assumes ERROR_CLASS is ERROR_NONE and MSG_STATUS_CODE is
STATUS_DELIVERED if there is no Message Status subparameter in Delivery
Acknowledgment.

Test: Manual

Change-Id: If5660235ce2a6af84d03ec1367a8be5daee672d2
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-06-13 12:53:13 +09:00
Jack Yu
a726a48fcd Supported data enabled override for different scenarios
Added override rules support for always allowing mms and
internet data during voice call.

Test: Manual + unit tests
Bug: 132113695
Merged-In: I2266d7f428901ccbba6bf538a7c7696e6566b96c
Change-Id: I2266d7f428901ccbba6bf538a7c7696e6566b96c
(cherry picked from commit 0d26d718b3)
2019-06-07 14:47:13 -07:00
chen xu
459e51e5ba skip permission check for TelephonyManager API getMmsUserAgent
Bug: 133637995
Test: Manual test
Change-Id: Ib9f211120c34e9b48c02f990088c32fb307a64f2
(cherry picked from commit 4878165365)
Merged-in: Ib9f211120c34e9b48c02f990088c32fb307a64f2
2019-06-04 18:13:32 +00:00
Taesu Lee
ee503e4c07 Replace the IDD with the '+' sign
It replaces the IDD in front of an address in 3GPP2 message with the '+'
to show as an international phone number format.

Test: Manual

Change-Id: I450b514bfd5d638ca886d8b64a6db45526f13fbf
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-05-24 11:13:21 +09:00
Nathan Harold
744b57e122 Add permissions check for getNetworkType
-Add a function in TelephonyPermissions to check
 READ_PHONE_STATE or return NETWORK_TYPE_UNKNOWN (soft denial).
-Honor the subId in TM or use the default DATA sub when
 returning the network type.

Bug: 132466954
Test: cts - atest TelephonyManagerPermissionTest
Merged-In: I4e1767c9dc10acbadec286512752d4bb52059b74
Change-Id: I4e1767c9dc10acbadec286512752d4bb52059b74
(cherry picked from commit 39444b39ba)
2019-05-22 13:44:24 -07:00
Amit Mahajan
dd4b36a12c Add comments for boolean parameters in translate().
Test: none
Bug: 132259056
Change-Id: Ia57d8a81a980959ea1f79692501edd88a8bab273
2019-05-21 17:32:45 -07:00
Taesu Lee
8debeeb126 Divide a message text into correctly sized parts
Message format info is required in order to divide a message text into
correctly sized parts on a device that supports for both 3GPP and 3GPP2
formats in multi-sim. And fixed to get default SMS subId from SmsManager
in SmsMessage class instead.

Test: Manual

Change-Id: Id2512eb62504b7e789f58b7d9697009d565c4a18
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-05-21 07:55:14 +09:00
chen xu
2a5483ff77 PhoneStateListener msim improvement
1. Docuemnt the scope of each callback event either apply to specific
subscriptions or not.
2. TelephonyRegistry store separate state e.g, precisecallstate, callAttribute
for each slot to support msim.
3. Add missing subscription match check when notify callbacks.

Bug: 130423985
Bug: 132181378
Test:  atest CtsTelephonyTestCases:PhoneStateListenerTest
Merged-In: I4b014e00528a1f05e0b5f237229c561f8260e2bd
Change-Id: I4b014e00528a1f05e0b5f237229c561f8260e2bd
(cherry picked from commit d5deeb15e9)
2019-05-13 21:38:12 -07:00
Jordan Liu
f1aca7cf4e Merge "Update getMergedSubscriberIds to pass subId" 2019-05-13 18:16:18 +00:00
Jordan Liu
857c4cbf5f Update getMergedSubscriberIds to pass subId
Bug: 131189269
Test: manual
Merged-In: I0d237b646969442b71597e66c9cb491c02a144d3
Change-Id: I0d237b646969442b71597e66c9cb491c02a144d3
(cherry picked from commit 973a60d76ec29e7295237ef8b6670f81917b071b)
2019-05-10 14:39:11 -07:00
Xin Li
5bc12066ca Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:45 +00:00
Thom Hurks
17a01554c7 Use correct variable for init in GsmAlphabet
When initializing the shift table in GsmAlphabet the correct
variable is now used. An error was logged already if the value
is wrong, so this does not have any logic correctness or
performance impact, just code correctness.
Test: very small refactoring. Tests still pass.

Change-Id: I5329cfa0be63b6a3ebd06414c6247d94ca93f40b
Signed-off-by: Thom Hurks <thomhurks@gmail.com>
2019-05-09 00:01:13 +02:00
Jordan Liu
88f125c096 Merge "Update getUiccCardsInfo doc"
am: 39fbf96b5a

Change-Id: I2b3af7fb26bfd5e403401daaac37888877bca851
2019-05-01 15:02:42 -07:00
Jordan Liu
eb5c27d469 Update getUiccCardsInfo doc
This method will return info for inactive eUICCs, filtered by carrier
privilege. (Since we can't read carrier privilege on an inactive eUICC,
we always assume that the caller does not have carrier privilege).

Bug: 130826215
Test: manual
Change-Id: Id89fa48f119004b6c18bd21791396bc6c3df2c95
Merged-In: Id89fa48f119004b6c18bd21791396bc6c3df2c95
2019-05-01 10:32:36 -07:00
Xiangyu/Malcolm Chen
386d538f9d Merge changes from topic "128616035"
am: dc4d14b37a

Change-Id: I0f9807127cdd46079a969532bdeb121bf544921d
2019-04-19 10:14:32 -07:00
Malcolm Chen
4d6ff22849 Adding @hide API to return whether an APN is metered or not.
In addition, make isMmsDataEnabled more generic:
isDataEnabledForApn

Bug: 128616035
Test: manual
Change-Id: Icd520c3094dd761a13435fae79b7b6b3ba2ebda9
Merged-In: Icd520c3094dd761a13435fae79b7b6b3ba2ebda9
2019-04-19 01:23:39 -07:00
Malcolm Chen
7611d69c75 Add API to set alwaysAllowMms
Add API in SubscriptionManager setAlwaysAllowMmsData
and isMmsDataAllowed.

Bug: 128616035
Test: unittest
Change-Id: Ie56c2d0619a68b188c35e8e24db6c2012d22538b
Merged-In: Ie56c2d0619a68b188c35e8e24db6c2012d22538b
2019-04-18 19:55:33 -07:00
Jack Yu
4f1a82ac5b Merge "Fixed the incorrect function signature"
am: 0233bc3e85

Change-Id: Ic78ee64402bce334f30073c9bf52589314404066
2019-04-12 16:43:53 -07:00
Jack Yu
b8e354206f Fixed the incorrect function signature
The name source should be an integer instead of long

Test: Manual + unit tests
Bug: 130237749
Merged-In: Ic4447da24073d37401ae0f6e8f8b41bd60d7167d
Change-Id: Ic4447da24073d37401ae0f6e8f8b41bd60d7167d
(cherry picked from commit 5d8f6447a7)
2019-04-10 17:15:06 -07:00
Tobias Thierer
cccb4f08ea Merge "Add missing @Deprecated annotation."
am: 498562c3cb

Change-Id: I8e744a739a5772e68fb87cf64747d9e7c03bf416
2019-04-10 04:51:08 -07:00
Tobias Thierer
77645d05fc Add missing @Deprecated annotation.
make warns when a @deprecated javadoc tag is not matched by
a corresponding annotation. The other @deprecated fields in
this class have both.

Fixes: 71706673
Test: Treehugger
Change-Id: I3749a54acc9f63dabdacac77849add34d4085561
2019-04-10 10:32:04 +01:00
Xiangyu/Malcolm Chen
04946bdad4 Merge changes from topics "126864501", "129296702"
am: 9f80ec1d51

Change-Id: Iadd23b2af9d4f85d88f6915d042641d2f481a784
2019-04-08 15:43:09 -07:00
Malcolm Chen
96dd9e4dfe Add @hide API to return whether a modem stack is enabled or not.
Bug: 129296702
Test: TelephonyManagerTestApp
Change-Id: I7ef4ad8322cf85e5a159363e90dde303ac7240de
Merged-In: I7ef4ad8322cf85e5a159363e90dde303ac7240de
2019-04-08 12:53:50 -07:00
Tyler Gunn
f31c79bef4 Merge "Add @hide API to get the phone account handle for a subId."
am: f910aa4e60

Change-Id: Ib7e13db1f586b9032082683ebae083b3b68ae11e
2019-04-04 11:34:35 -07:00
Tyler Gunn
f910aa4e60 Merge "Add @hide API to get the phone account handle for a subId." 2019-04-04 18:26:29 +00:00
Tyler Gunn
c0340aa16a Add @hide API to get the phone account handle for a subId.
This is used in SubscriptionManager to figure out which phone account
is being updated when the default voice sub changes.  It seemed like
a good spot to put it since we should really have an api for this in
the future.

Test: Manual, manual, manual
Bug: 128916238
Change-Id: If5137c0e7f01a14810e0ee94e5d857d69f368a87
2019-04-03 20:18:01 -07:00
Xiangyu/Malcolm Chen
f9edc9fffd Merge "API Feedback for CBRS"
am: 9c706654a2

Change-Id: I6a6d0a81100093696fc6e4b66b32e34dbed49913
2019-04-01 19:10:02 -07:00
Malcolm Chen
4674a797e9 API Feedback for CBRS
Bug: 128902411
Test: unittest
Change-Id: I2476834a5048d0e3c2c3413d7168a7a3ad2d7042
Merged-In: I2476834a5048d0e3c2c3413d7168a7a3ad2d7042
2019-04-01 15:23:53 -07:00
Xiangyu/Malcolm Chen
4e32ac7754 Merge "Remove clearDefaultsForInactiveSubIds."
am: 1e263e7bc0

Change-Id: I8fb91dd4928cf8a607a876cc304c261bfb762a59
2019-04-01 14:05:57 -07:00
Xiangyu/Malcolm Chen
1e263e7bc0 Merge "Remove clearDefaultsForInactiveSubIds." 2019-04-01 20:51:54 +00:00
Malcolm Chen
8231d3b231 Remove SubscriptionManager#setMetered API.
am: 9b932fa1a4

Change-Id: I55b74e102d77785e7f925d02049037b24a5d352a
2019-03-29 15:21:07 -07:00
Xiangyu/Malcolm Chen
dc4cb81c83 Merge changes from topics "128455935", "123661746"
* changes:
  Better description and parameter name of setPreferredDataSubscriptionId
  Remove SubscriptionManager#setMetered API.
2019-03-29 21:48:10 +00:00
Malcolm Chen
60cc67f5ac Remove clearDefaultsForInactiveSubIds.
clearDefaultsForInactiveSubIds is no longer needed as Telephony
has internal logic to clear or update default settings automatically.

Bug: 128645056
Test: manual
Change-Id: Ib7bc0ae6dba6f10e3a052df1644cc77dd30121a9
Merged-In: Ib7bc0ae6dba6f10e3a052df1644cc77dd30121a9
2019-03-29 14:41:59 -07:00