Commit Graph

3745 Commits

Author SHA1 Message Date
Jordan Liu
7dad5ea750 Merge "Use TM SubId in getDataState and getDataActivity" into qt-r1-dev 2019-07-12 18:29:05 +00:00
TreeHugger Robot
4c452a6534 Merge "Check Carrier Privilege on Hidden Subs" into qt-r1-dev 2019-07-12 18:00:48 +00:00
Malcolm Chen
ac56a4254e Provide @hide API to return merged IMSIs from grouping.
Bug: 135105735
Test: test app. Apply grouping and call the new API, to make sure
it returns correct values.

Change-Id: I99586976d3421d4b35be465201ee33cbb2dfd1d9
2019-07-11 13:19:36 -07:00
Nathan Harold
9d2660041a 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.

(This CL is an un-revert of aosp/984377)

Bug: 135205433
Test: manual (automated test is infeasible)
Change-Id: I035f2c44a7955e88608b1c336acb72fb68c3e450
Merged-In: I035f2c44a7955e88608b1c336acb72fb68c3e450
2019-07-11 12:39:31 -07:00
Hunter Knepshield
b26cbbd53d Check Carrier Privilege on Hidden Subs
When calling CheckCarrierPrivilegeForAnySubId the
hidden subscriptions were not being taken into account
due to getAllActiveSubscriptionIds being a public method
that intentionally ignores hidden subscriptions.

NOTE: This is identical to ag/8193293, except that the
SubscriptionManager modifications don't make
getActiveSubscriptionIdList() static (it was causing test failures). A
further bug can be pursued to make everything static all at once.

Bug: 135684437
Test: manual
Change-Id: Iad6a3c2635e5eac2d33a16aa460b98394fd817f4
2019-07-10 13:14:44 -07:00
Eugene Susla
cbdc139229 Merge "Fix sms app changed broadcast" into qt-dev
am: 0a98e4b693

Change-Id: Ic2ab525c22b17afc97b5220a8c5b4ddd18db225b
2019-07-03 16:32:01 -07:00
Eugene Susla
0fa8049fe8 Fix sms app changed broadcast
Fixes: 136257475
Test: switch sms holder in settings, and ensure ceceived broadcasts for both
becoming and leaving the sms app status
Change-Id: I10dda3fd8ebd38ab12bdb8192ed4f3863f4238b8
2019-07-02 11:06:26 -07:00
TreeHugger Robot
85a55afa3e Merge "Revert "Check Carrier Privilege on Hidden Subs"" into qt-r1-dev 2019-07-02 02:11:37 +00:00
Jordan Liu
3c41bb707b Revert "Check Carrier Privilege on Hidden Subs"
This reverts commit 6fc804b3f9.

Reason for revert: causes test failures b/136421546

Change-Id: I3b1dcd78aea6beeadb82626145e868954286bbee
2019-07-01 23:03:50 +00:00
Nathan Harold
09ef9e13a7 Merge "Check Carrier Privilege on Hidden Subs" into qt-r1-dev 2019-06-29 06:07:52 +00:00
Nathan Harold
6fc804b3f9 Check Carrier Privilege on Hidden Subs
When calling CheckCarrierPrivilegeForAnySubId the
hidden subscriptions were not being taken into account
due to getAllActiveSubscriptionIds being a public method
that intentionally ignores hidden subscriptions.

Bug: 135684437
Test: manual
Change-Id: I7688e4fe25fd2c6ed22dc8edc508345c1a3d447c
2019-06-27 16:02:35 -07:00
Andy Chou
a96ab85260 Merge "Notify physical channel configuration with phoneId and subId" into qt-r1-dev 2019-06-26 01:24:46 +00:00
andychou
ce65922c73 Notify physical channel configuration with phoneId and subId
Physical channel configuration may be retrieved before SIM loaded. So
configuration will not be able to report via TelephonyRegistry.
Therefore, use phoneId to mapping record and notify

Bug: 123904518
Test: Manual test and make sure physical channel configuration is
displayed in RadioInfo

Change-Id: I11c89b9cf68c3f3d7523ad8dfc21520f44fa7ce3
2019-06-25 17:57:29 +00:00
Michael Groover
faf3e373db Merge "Remove settings to relax device ID access restrictions" into qt-dev
am: 692a68133b

Change-Id: I3312fae325c593aef750c80cbd4365dfd2669f6c
2019-06-12 14:20:22 -07:00
Jack Yu
a952d2018b Fixed tethering failed when device is on CBRS
Fixed by using the correct sub id for CBRS subscription

Bug: 133852860
Test: Manual
Change-Id: If01e17becce9684556345eb76512f617b9a9278c
2019-06-07 11:07:43 -07:00
Michael Groover
44c92e0708 Remove settings to relax device ID access restrictions
Bug: 123937881
Test: atest TelephonyPermissionsTest
Change-Id: I6eb1920730a28d393cdbef06195f43da957338fd
2019-06-04 18:30:59 -07:00
Ritwika Mitra
19afd4690f Initializing the Telephony Sms DB based on RoleManager.ROLE_SMS
Fix: 133356079
Test: manual

Change-Id: I49dcdc450e1113ffae887ad488d39f74a96787ed
2019-06-03 10:42:43 -07:00
Jack Yu
0d26d718b3 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
Change-Id: I2266d7f428901ccbba6bf538a7c7696e6566b96c
2019-05-31 11:06:15 -07:00
chen xu
4878165365 skip permission check for TelephonyManager API getMmsUserAgent
Bug: 133637995
Test: Manual test
Change-Id: Ib9f211120c34e9b48c02f990088c32fb307a64f2
2019-05-28 15:38:54 -07:00
Amit Mahajan
3aa54b1fff Merge changes from topic "Correct subId in divideMessage()" into qt-dev
* changes:
  Fix the default sub id returned by SmsManager.
  Divide a message text into correctly sized parts
2019-05-23 16:42:19 +00:00
Nathan Harold
39444b39ba 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
Change-Id: I4e1767c9dc10acbadec286512752d4bb52059b74
2019-05-21 16:50:00 -07:00
Taesu Lee
98d41e6917 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
Bug: 132259056
Merged-in: Id2512eb62504b7e789f58b7d9697009d565c4a18
Change-Id: Id2512eb62504b7e789f58b7d9697009d565c4a18
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
(cherry picked from commit 8debeeb126)
2019-05-21 10:32:59 -07:00
Michael Groover
7aac1013b7 Merge "Grant device ID access to app with carrier privlege on any sub ID" into qt-dev 2019-05-15 15:26:13 +00:00
Michael Groover
dd2c16678f Grant device ID access to app with carrier privlege on any sub ID
Fixes: 132173603
Test: atest TelephonyPermissionsTest
Test: cts-tradefed run cts-dev -m CtsTelephony3TestCases
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts-dev -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest

Change-Id: I6a92790389db8ce08118e7f7f45d9309296d2551
2019-05-14 17:08:57 -07:00
Chen Xu
856fe0fefc Merge "checkCarrierPrivilegesForPackage by subId rather than default" into qt-dev 2019-05-14 01:06:05 +00:00
chen xu
28fe1359ee checkCarrierPrivilegesForPackage by subId rather than default
1. checkCarrierPrivilegesForPackages by subId
2. getPackagesWithCarrierPrivileges by subId
3. new hidden API getPackagesWithCarrierPrivilegesForAllPhones which
returns packages for all subs.

Bug: 132078279
Test: Manual
Change-Id: Ic666218f0c290d1b428530982b689af110f74c69
2019-05-13 16:30:37 -07:00
Brad Ebinger
8b2d80c768 Merge changes from topic "sms_trampoline_intent-qt-dev" into qt-dev
* changes:
  Trampoline SMS disambig dialog to Telephony
  No longer show disambig when calling SmsManager#getSubId
2019-05-10 19:42:55 +00:00
Brad Ebinger
360415aa13 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

Change-Id: I6be1c6d7bf6b6ee614b6a7d0369147e3b1890588
2019-05-10 00:14:23 +00:00
Jordan Liu
4f8ad9cb35 Merge "Update getMergedSubscriberIds to pass subId" into qt-dev 2019-05-09 21:27:58 +00:00
chen xu
d5deeb15e9 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
Change-Id: I4b014e00528a1f05e0b5f237229c561f8260e2bd
2019-05-08 18:20:51 +00:00
Jordan Liu
26dd1a5f4f Update getMergedSubscriberIds to pass subId
Bug: 131189269
Test: manual
Change-Id: I0d237b646969442b71597e66c9cb491c02a144d3
2019-05-07 17:14:15 +00:00
TreeHugger Robot
7abba0a4bc Merge "Revert "Tempoarily allow priv-apps access to device identifiers"" into qt-dev 2019-05-01 09:05:42 +00:00
Michael Groover
de186b8cb7 Revert "Tempoarily allow priv-apps access to device identifiers"
This reverts commit 6e96da2927.

Reason for revert: Play and MTP/PTP issues have been resolved,
restoring device identifier access restrictions for priv apps.

Bug: 117781266
Test: cts-tradefed run cts-dev -m CtsTelephony3TestCases
Change-Id: I7ab432cfa92b6da65137608fc9d435d8296ffb84
2019-04-30 16:01:59 -07:00
Jordan Liu
a49ff8b68e Merge "Update getUiccCardsInfo doc" into qt-dev 2019-04-30 18:04:18 +00:00
Sooraj Sasindran
0d45da7abb Show opportunistic provider name conditionally
For testing purpose, we want system UI to show grouped CBRS carrier name
as in the upper left corner in system UI. But we want to make this a
conditoinal behavior.

Bug: 129865342
Test: manual
Change-Id: I38a49447ca07615b5e14a92412b68a2a44b2726c
2019-04-26 14:44:07 -07:00
Jordan Liu
5867df3139 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
2019-04-26 21:28:08 +00:00
Malcolm Chen
9562a92874 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
2019-04-18 16:40:39 -07:00
Xiangyu/Malcolm Chen
f447240a0c Merge "Add API to set alwaysAllowMms" into qt-dev 2019-04-17 17:14:55 +00:00
TreeHugger Robot
f636d3cde8 Merge "Grant access to device identifiers with READ_DEVICE_IDENTIFIERS appop" into qt-dev 2019-04-16 21:52:56 +00:00
Malcolm Chen
8402ba5593 Add API to set alwaysAllowMms
Add API in SubscriptionManager setAlwaysAllowMmsData
and isMmsDataAllowed.

Bug: 128616035
Test: unittest
Change-Id: Ie56c2d0619a68b188c35e8e24db6c2012d22538b
2019-04-15 17:03:21 -07:00
Jack Yu
5d8f6447a7 Fixed the incorrect function signature
The name source should be an integer instead of long

Test: Manual + unit tests
Bug: 130237749
Change-Id: Ic4447da24073d37401ae0f6e8f8b41bd60d7167d
2019-04-10 14:40:59 -07:00
Michael Groover
656ef911b4 Grant access to device identifiers with READ_DEVICE_IDENTIFIERS appop
The app holding the SMS role and other carrier apps installed through
Play that cannot be granted carrier privileges can have a legitimate
need to access device identifiers but do not meet the new
requirements for access. This appop will provide a way to grant role
holders and apps delivered through Play a way to access these
identifiers.

Bug: 124236412
Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases -t \
      android.appsecurity.cts.DeviceIdentifierTest#testDeviceIdentifierAccessWithAppOpGranted

Change-Id: Ieb182b254472b79cb791419222ee6ff9dedc6880
2019-04-10 00:39:46 +00:00
Tyler Gunn
beeb456338 Merge "Add @hide API to get the phone account handle for a subId." into qt-dev 2019-04-08 20:44:05 +00:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
Tyler Gunn
d67bd616e0 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-04 19:08:33 -07:00
Chen Xu
1ec46998a0 Merge "SDK API doesSwitchModemConfigTriggerReboot" 2019-04-03 22:17:47 +00:00
chen xu
c320f2cb37 SDK API doesSwitchModemConfigTriggerReboot
Bug: 129424775
Change-Id: If03e376ad0e91ad69f8444567700ed3fe76d66f6
2019-04-03 10:21:33 -07:00
Michael Groover
d18900b937 Merge "Remove unused code and cleanup parameters for DPM dev ID access" 2019-04-01 19:27:42 +00:00
Michael Groover
9fd02c5027 Remove unused code and cleanup parameters for DPM dev ID access
Fixes: 123684619
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCannotGetDeviceIdentifiersWithoutPermission

Change-Id: Ibc647847a47911c0c32cf5cf33bd3187dc3aebd2
2019-03-29 11:31:44 -07:00
Shuo Qian
41fd744738 Merge "Check permissions and carrier privilege in notifyActiveDataSubIdChanged" 2019-03-29 18:20:45 +00:00