Commit Graph

3732 Commits

Author SHA1 Message Date
Andrew Sapperstein
e016781807 Add a blacklist for preinstalled carrier apps.
Allows an OEM to specify that a preinstalled carrier app, even if
TelephonyManager says it should have carrier privileges, does not
get granted the default permissions and does not get enabled when
a compatible SIM is inserted.

Bug: 138150105
Test: verified locally
Change-Id: I0afec28f1f18227947c1fe9e6bb5fd0dad3b5dac
Merged-In: I0afec28f1f18227947c1fe9e6bb5fd0dad3b5dac
2019-08-08 15:05:06 +00: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
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
Xiangyu/Malcolm Chen
7c49110098 Merge "Add @hide API to return whether a modem stack is enabled or not." 2019-03-28 18:27:08 +00:00
Malcolm Chen
afd0087aee Add @hide API to return whether a modem stack is enabled or not.
Bug: 129296702
Test: TelephonyManagerTestApp
Change-Id: I7ef4ad8322cf85e5a159363e90dde303ac7240de
2019-03-27 19:21:11 -07:00
sqian
9e9ed18772 Check permissions and carrier privilege in notifyActiveDataSubIdChanged
Bug: 127978132
Test: Treehugger
Change-Id: I1d9c5d1b242953a2af3e56718ef82761941d8d9c
2019-03-27 17:40:27 -07:00
Amit Mahajan
95f616da80 Merge "Device could not use wifi hotspot when data card switch to sim2" am: cd24e832e8 am: 012a279038
am: 59a2a726bc

Change-Id: I23f5c047f63fa585a49c5daf935931e0dec92ef5
2019-03-26 17:16:17 -07:00
Amit Mahajan
012a279038 Merge "Device could not use wifi hotspot when data card switch to sim2"
am: cd24e832e8

Change-Id: I9ae2b31e6dd3f4a4c575ff37b8a9df58eb2c2e70
2019-03-26 15:45:52 -07:00
Chen Xu
493080e883 Merge "move short code definitions to SmsManager Test API" 2019-03-26 22:07:41 +00:00
Amit Mahajan
cd24e832e8 Merge "Device could not use wifi hotspot when data card switch to sim2" 2019-03-26 21:18:23 +00:00
chen xu
9c7fad9235 move short code definitions to SmsManager Test API
Bug: 127560420
Test: cts
Change-Id: I6a5ba2439713105b25913ba8eb081abfaafd1a2e
2019-03-25 21:51:26 -07:00
Chen Xu
2f662e6477 Merge "notifyCarrierNetworkChange with subId" 2019-03-26 04:20:52 +00:00
chen xu
5b98d401a0 notifyCarrierNetworkChange with subId
notifyCarrierNetworkChange should only be allowed
for carrier service which has the carrier priviledge.

to find carrierService is notifying which subId,
check which subId the caller has carrier privileges
under at the time of the call and use that to restrict.

Bug: 128989180
Test: Build
Change-Id: I061dd5773f8db87c702c5e60413b198330bee854
2019-03-25 16:20:24 -07:00
Brad Ebinger
8a838a991d Merge "Query isEmergencySmsMode API when checking if emergency for GPS" am: dedc27142d am: 3b176bc1de
am: 6862694d61

Change-Id: Id37265bae6fc641b77073c16b5a1b9a54a49b750
2019-03-22 10:59:52 -07:00
Brad Ebinger
3b176bc1de Merge "Query isEmergencySmsMode API when checking if emergency for GPS"
am: dedc27142d

Change-Id: Ieccb97fb300455e9338c022c46466bed355be79a
2019-03-22 10:36:07 -07:00
Brad Ebinger
dedc27142d Merge "Query isEmergencySmsMode API when checking if emergency for GPS" 2019-03-22 17:18:47 +00:00