Commit Graph

3765 Commits

Author SHA1 Message Date
Michael Groover
285a12043d Merge "Grant device ID access to app with carrier privlege on any sub ID" into qt-dev
am: 7aac1013b7

Change-Id: I78374a9cf934cc2826f322b95223de817f588a4e
2019-05-15 08:40:52 -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
5811135e2a Merge "checkCarrierPrivilegesForPackage by subId rather than default" into qt-dev
am: 856fe0fefc

Change-Id: Id20ca739786ef1fcaf242dbec3d5a004d19aa9a2
2019-05-13 18:30:01 -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
42ce8673bb Merge changes from topic "sms_trampoline_intent-qt-dev" into qt-dev
am: 8b2d80c768

Change-Id: Ibbc07c961f1bdc19e1015885487e9f7b6a14fa83
2019-05-10 13:11:08 -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
Jordan Liu
e586fdea3f Merge "Update getMergedSubscriberIds to pass subId" into qt-dev
am: 4f8ad9cb35

Change-Id: I0d3885cd7506fbc900c358fec360ae893aa21662
2019-05-09 23:01:30 -07: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
Thom Hurks
118540582b Merge "Use correct variable for init in GsmAlphabet" am: f84cf464e9
am: 2a0d20e295

Change-Id: Icd1657553f0cbc918a0d85f518e863d83204f650
2019-05-09 16:59:22 -07:00
Thom Hurks
2a0d20e295 Merge "Use correct variable for init in GsmAlphabet"
am: f84cf464e9

Change-Id: I552f20acd1de433abecc1ce32912686a5401322d
2019-05-09 15:14:55 -07:00
Jordan Liu
4f8ad9cb35 Merge "Update getMergedSubscriberIds to pass subId" into qt-dev 2019-05-09 21:27:58 +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
Chen Xu
b3e9773d71 Merge "PhoneStateListener msim improvement" into qt-dev
am: bfe4c111c4

Change-Id: I52e237495ed72afca170034b295daa25541bdc70
2019-05-08 13:46:18 -07: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
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
Michael Groover
0c107d5ce8 Merge "Revert "Tempoarily allow priv-apps access to device identifiers"" into qt-dev
am: 7abba0a4bc

Change-Id: I52ffd23a6daf6d69e90519024cf389c70196a8fc
2019-05-01 09:34:48 -07: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
Jordan Liu
a7907d780d Merge "Update getUiccCardsInfo doc" into qt-dev
am: a49ff8b68e

Change-Id: Id421e57e4a4f35d1d8c335177bd928b9bbdc34e8
2019-04-30 19:55:10 -07: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
546be49a9f Merge "Show opportunistic provider name conditionally" into qt-dev
am: c6e0753506

Change-Id: I7b9018112f8808fae1533efaffa8b6d1129250a6
2019-04-30 07:10:37 -07: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
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
Xiangyu/Malcolm Chen
1a17f08c28 Merge "Adding @hide API to return whether an APN is metered or not." into qt-dev
am: 7deafd415b

Change-Id: Ibb9f5bc4988fab052327fe3fb54918e815089a4d
2019-04-18 19:34:41 -07: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
8306a55b5b Merge "Add API to set alwaysAllowMms" into qt-dev
am: f447240a0c

Change-Id: I7d243714fef121d6379db587c79edd15fa6fad92
2019-04-17 10:30:50 -07:00
Xiangyu/Malcolm Chen
f447240a0c Merge "Add API to set alwaysAllowMms" into qt-dev 2019-04-17 17:14:55 +00:00
Michael Groover
fe4f44f41f Merge "Grant access to device identifiers with READ_DEVICE_IDENTIFIERS appop" into qt-dev
am: f636d3cde8

Change-Id: Iaef33e9974a0ca2dcc74649b6e082d7d15704138
2019-04-16 17:18:55 -07: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
4f1a82ac5b Merge "Fixed the incorrect function signature"
am: 0233bc3e85

Change-Id: Ic78ee64402bce334f30073c9bf52589314404066
2019-04-12 16:43:53 -07:00
Jack Yu
24d89c6854 Merge "Fixed the incorrect function signature" into qt-dev
am: 1fbf66bbf4

Change-Id: I5cf4074a5267a4d8188590a6c1114613758f21dc
2019-04-10 20:19:12 -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
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
Tobias Thierer
ebb1d94ccf Merge "Add missing @Deprecated annotation." am: 498562c3cb
am: cccb4f08ea

Change-Id: Ib3df5ab9dc9561223b896804eefc731b833180fe
2019-04-10 05:12:05 -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
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
Xiangyu/Malcolm Chen
04946bdad4 Merge changes from topics "126864501", "129296702"
am: 9f80ec1d51

Change-Id: Iadd23b2af9d4f85d88f6915d042641d2f481a784
2019-04-08 15:43:09 -07: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
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
Svetoslav Ganov
3d47c34546 Merge "Restricted permission mechanism - framework" into qt-dev
am: 9dfc48d06e

Change-Id: I2c4a8f7f9275ad2be25c203831c273f23a5c0930
2019-04-08 08:18:59 -07: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