183 Commits

Author SHA1 Message Date
Tyler Gunn
f701f7a765 Car mode InCallService changes.
1. Grant ENTER_CAR_MODE and CONTROL_INCALL_EXPERIENCE permissions to the
shell identity for use within CTS tests.
2. Remove un-needed Telecom shell command.

Test: unit tests, telecom CTS tests, manual testing
Bug: 144345414
Change-Id: I54a2e723d6ef9552117e6cadf4ab7c449dd5e3cb
2019-11-26 13:43:53 -08:00
Tyler Gunn
f05f2c2cc2 Add prioritized enableCarMode API in UiModeManager
Per design doc (go/android-car-mode-design), added new system API to
enable car mode and specify a priority for the calling app.
Also modified UiModeManager to pass the package name of the caller to
UiModeManagerService.

Bug: 136109592
Test: Added new unit tests and CTS tests.
Test: Added Telecom test app functionality to verify.
Change-Id: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
Merged-In: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
2019-11-19 23:15:52 +00:00
Jordan Liu
776242c0c6 Move cell broadcast service module directory
Update the permissions and resource to reflect this move.

Bug: 135956699
Test: manual
Change-Id: I8c798f48e3a342cc2ce29d1f7f199ae1337ff2d0
Merged-In: I8c798f48e3a342cc2ce29d1f7f199ae1337ff2d0
2019-11-05 11:28:53 -08:00
Jordan Liu
7aea30267c [DO NOT MERGE] Add CellBroadcastService and related permissions
CellBroadcastService is bound to by the platform to handle cell
broadcasts.

Bug: 135956699
Test: manual
Change-Id: I865c09d6d246779b706c06371df685d415618699
2019-10-18 14:20:50 -07:00
Tyler Gunn
8c4ced5b43 Merge "Explicitly grant START_ACTIVITIES_FROM_BACKGROUND to com.android.phone." 2019-10-14 16:15:28 +00:00
Alan Stokes
c3e775bb11 Explicitly grant START_ACTIVITIES_FROM_BACKGROUND to com.android.phone.
It's needed because when we broadcast ACTION_SIM_SLOT_STATUS_CHANGED
we want to allow the receiving app to start an activity from the
background.

The app already has it implicitly, since it has the same shared UID as
com.android.stk which has the permission for unrelated reasons. Making
it explicit makes it less likely it will lose the permission
accidentally re-introducing a subtly bug.

Bug: 132691768
Test: Builds
Change-Id: I85669423e628b4534a3f28efd17947ca2481454e
Merged-In: I85669423e628b4534a3f28efd17947ca2481454e
2019-10-10 12:58:35 -07:00
Jordan Liu
656502be63 [DO NOT MERGE] Revert "Add CellBroadcastService and related permissions"
This reverts commit b59c74f3026ce1b7f978cb15275ee01dd001cf3b.

Reason for revert: depends on ag/9477322 being CP'd, or else causes breakages downstream (b/142399383)

Change-Id: I25b1695757d5fec8c00f05d033c33501f4fc5389
2019-10-09 13:34:26 -07:00
Jordan Liu
b59c74f302 Add CellBroadcastService and related permissions
CellBroadcastService is bound to by the platform to handle cell
broadcasts.

Bug: 135956699
Test: manual
Change-Id: Ib1b20da03d271fc0b2736774b2ca6c6514944093
Merged-In: Ib1b20da03d271fc0b2736774b2ca6c6514944093
2019-10-08 11:20:46 -07:00
TreeHugger Robot
269907a310 Merge "Revert "Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for"" into qt-dev 2019-06-20 23:49:39 +00:00
Wenjie Zhou
46a4491253 Revert "Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for"
This reverts commit 0999f93e4a00a7991d13cfca185e99b9fbecbc38.

Reason for revert: There is a better choice (ag/8051966) than adding the permission to resolve b/130827484

Bug: 130827484
Change-Id: I1b8fd74a173d4b0ef981e51f7e0a9c5f84d5f416
2019-06-20 23:48:59 +00:00
Michal Karpinski
efa05d9179 Add START_ACTIVITIES_FROM_BACKGROUND permission for
com.android.providers.downloads

Required because DownloadManager needs to whitelist
a broadcast for bg activity starts.

Bug: 135515407
Test: builds, boots (it wouldn't without this)
Change-Id: Id6c22d1397417bbc10e2829e563f29cbccccd8bf
2019-06-18 15:39:50 +01:00
jiaohy
0999f93e4a Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for
permissionController

Bug:134429397
Test: Locally flash on sailfish
Change-Id: I650c08a7f0a823085e0eaa0e1cae8b5b44cabd8f
2019-06-07 11:46:00 -07:00
Jeff Sharkey
c0bb5985af Shift call statistics back to the original caller.
Most of the time MediaProvider is making Binder calls on behalf of
an external caller, so use PropagateWorkSourceTransactListener to
ensure that we record the original source.

Bug: 125725916
Test: atest --test-mapping packages/apps/MediaProvider
Change-Id: I591dfb2903a54239639452954ea2d780e79b280c
2019-05-30 12:18:34 -06:00
Varun Shah
a248265d93 Add INTERACT_ACROSS_PROFILES permission to shell for CTS test.
Bug: 127804311
Test: atest CrossProfileAppsHostSideTest#testStartActivity
Change-Id: I1deb66409fae1ec654555adb8d4a61d670689d2a
2019-05-20 20:56:59 -07:00
Zimuzo Ezeozue
ab9c69fda4 Merge "Add ExplicitHealthCheckServiceImplTest" into qt-dev 2019-05-20 20:16:22 +00:00
Zimuzo
0d70a6ac49 Add ExplicitHealthCheckServiceImplTest
Test: atest
android.ext.services.watchdog.ExplicitHealthCheckServiceImplTest
Bug: 132640467

Change-Id: I2d1820a38adce238a157e925512898c184dadec0
2019-05-19 19:39:29 +01:00
Jeff Sharkey
b66f4f4bad Aggresive performance optimizations.
Now that we have LocalCallingIdentity, we can start caching it in
very narrow cases.  We must be careful to not cache too long, since
any changes to granted permissions for the UID mean we need to
re-evaluate any cached answers.

The best middle-ground for this in the Q release is to use an active
camera session as a proxy for when we should create a cache object
and then later invalidate it.  (It's very unlikely that a user
changes permissions while actively using the camera, and this is
a strong signal that the caller is sensitive to performance.)

Many other sprinkled optimizations to avoid extra binder calls into
the OS, such as aggressively caching VolumeInfo related details.

Track IDs that are owned by each LocalCallingIdentity, to speed up
all future security checks.

Dispatch all change notifications asynchronously, and delay them by
several seconds while the camera is being actively used, to give
more important foreground work a fighting chance.  Invalidate
thumbnails asynchronously.

Optimizations to ModernMediaScanner where it's safe to skip the
"reconcile" and "clean" steps when we're focused on a single file
that we successfully scanned.

Local tests show this CL improves performance of a test app that
takes 100 rapid shots by 45%.  (All the collective optimizations
done so far this week add up to a 70% improvement.)

Bug: 130758409
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: trivial manifest change
Change-Id: I38cc826af47d41219ef44eae6fbd293caa0c01d5
2019-05-18 05:48:21 +00:00
TreeHugger Robot
36e3f91918 Merge "Grant STATUS_BAR permission to com.android.shell" into qt-dev 2019-05-11 00:46:36 +00:00
TreeHugger Robot
aede3d1a2b Merge "Remove DefaultContainerService and its references." into qt-dev 2019-05-10 01:52:37 +00:00
Antoan Angelov
61c8bb74e6 Merge "Add START_ACTIVITIES_FROM_BACKGROUND to ManagedProvisioning." into qt-dev 2019-05-02 14:59:58 +00:00
Tyler Gunn
425dac52b0 Change command like set-default-dialer to be a test override.
RoleManager likes to terminate apps when roles are changed which does
not work in CTS tests.  We need to use a temp override in Telecom
for now.

Test: Run the CTS tests over, and over and over again.
Bug: 131065482
Change-Id: Id36942f2813abdfa0020ce4805c492a69bd07d0e
(cherry picked from commit 509ef150f23531b18fe29ef85337312f54535300)
2019-04-30 20:26:47 +00:00
arangelov
72e8f8e46c Add START_ACTIVITIES_FROM_BACKGROUND to ManagedProvisioning.
Fixes: 131240642
Fixes: 130371743
Test: Manual
Change-Id: I72a4ab31bc662af4e3580a2c1d50f550e6314f74
2019-04-30 12:56:41 +01:00
Lorenzo Colitti
eb970d77ab Add privapp permissions to network modules.
When built as part of the system, the network stack and the
captive portal login app should have the BYPASS_PRIVATE_DNS
and CONNECTIVITY_USE_RESTRICTED_NETWORKS permissions.
These are necessary to validate restricted networks, bypass VPNs,
bypass private DNS for captive portal login, etc. Add these
permissions to privapp-permissions-platform.xml.

When installed as mainline modules that cannot use signature
permissions, the modules get this ability by virtue of having the
MAINLINE_NETWORK_STACK permissions.

Additionally, add the CONNECTIVITY_USE_RESTRICTED_NETWORKS
permission to the captive portal login app manifest, which did
not contain it.

Bug: 129789428
Test: builds, boots
Test: dumpsys package shows permissions
Change-Id: I632359f7eff09fed71167733ac75824a5aa57894
Merged-In: I632359f7eff09fed71167733ac75824a5aa57894
(cherry picked from commit 109dbf9c05f325d6f8298ffa81b9e90668fddaf3)
2019-04-25 03:58:51 +00:00
Varun Shah
ec9f62255d Remove DefaultContainerService and its references.
Pre-req for running tests marked with (*): adb shell setprop vold.has_adoptable 1

Bug: 111838160
Test: builds and flashes
*Test: atest cts.AdoptableHostTest
*Test: atest cts.StorageHostTest
Change-Id: Iaa376a6bc984cc449239b7fe54a4a2708ad05a72
2019-04-23 11:46:34 -04:00
Jack Yu
974607aac8 Fixed that emergency alert dialog not popped up
Fixed by granting START_ACTIVITIES_FROM_BACKGROUND
to the cell broadcast receiver.

Test: Manual
Bug: 130384940

Change-Id: Ie563a8f11ac991ab9568f65df6a4d14eebe47c5e
2019-04-21 17:21:43 -07:00
Evan Laird
deb46f3c36 Grant STATUS_BAR permission to com.android.shell
Allows for testing APIs protected by this permission from CTS tests

Test:  adb shell dumpsys package com.android.shell | grep "\bSTATUS_BAR:
granted=true" # should find the permission
Bug: 130178313

Change-Id: Ida0950664b98217d9c0801c0f19436c754ee6744
2019-04-19 16:23:40 +00:00
Julia Reynolds
dc6adc6ca8 Adjust testapis/permissions for CTS tests
Test: cts
Bug: 127341023
Change-Id: Ice19dc337a06a3f20edca583ecbe5ef3148fd96d
2019-04-09 17:55:39 +00:00
TreeHugger Robot
5595790416 Merge "Grant com.android.shell access to DynamicSystem" 2019-03-31 15:12:39 +00:00
Mark Chien
be40054bee Merge "[KA09] add keepalive offload permission to shell" 2019-03-29 04:20:39 +00:00
Hall Liu
d272ec184b Merge "Add shell permissions for CTS testing" 2019-03-29 00:04:54 +00:00
Hall Liu
9cf3e7ae68 Add shell permissions for CTS testing
Add NETWORK_SCAN to shell permissions to enable CTS testing of the
network scan changes

Bug: 126779616
Test: CTS
Change-Id: I1f75c9005620b3b0e06f066677cba6190f1d266c
2019-03-28 12:57:02 -07:00
Po-Chien Hsueh
e56f2f583d Grant com.android.shell access to DynamicSystem
Add permission INSTALL_DYNAMIC_SYSTEM to Shell's AndroidManifest.xml
and privapp-permissions-platform.xml.

Bug: 124637092
Test: adb shell am start-activity
Change-Id: Id7727a195f61c2fbffa0b2f52f3098784feeee52
2019-03-28 17:25:36 +08:00
Anton Hansson
aecff3d7c4 Merge "Move EmergencyInfo perm whitelist to /product" am: ae957afaa6 am: 300026a5e9
am: e6039fbffe

Change-Id: Id4df504d0c5a4622605b4803e8b3f2cb49003156
2019-03-26 06:22:22 -07:00
Anton Hansson
38cb100224 Move EmergencyInfo perm whitelist to /product
The app is moving to /product, to separate out its permission
grants to a separate file and move that file to /product as well.

Bug: 122353713
Test: boot aosp_arm64 emulator
Change-Id: Ic165aae180a002c3566e3c1b1495a1d50dfd0e4a
2019-03-25 20:13:54 +00:00
Anton Hansson
aaf15d2222 Grant PermissionController SUBSTITUTE_NOTIFICATION_APP_NAME
This app will pretend to be the Settings app when sending
location access notifications.

Bug: 128608303
Test: boot
Change-Id: I447510bbe323f3de40828a5cb4a37abe1c44c990
2019-03-25 16:13:26 +00:00
TreeHugger Robot
0369790fac Merge "Add Shell permission for CTS test." 2019-03-22 22:31:32 +00:00
TreeHugger Robot
c396d6738c Merge "API review followup: DynamicAndroidClient" 2019-03-22 17:21:39 +00:00
TreeHugger Robot
db053d1949 Merge "Revert "Checkbox for removing contributes files"" 2019-03-22 01:15:20 +00:00
wilsonshih
5db7b39dd8 Add Shell permission for CTS test.
Add Shell permission for new CTS tests to test the multi-display
functionality in WallpaperService/WallpaperManagerService.

Bug: 123707989
Test: atest WallpaperManagerMultiDisplayTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Id97db050a0b9d1940c2dfaa793fbe526df578105
2019-03-22 09:13:10 +08:00
TreeHugger Robot
38076cdc88 Merge "Add system API for whether emergency assistance is enabled." 2019-03-21 23:03:33 +00:00
markchien
5e430e5a39 [KA09] add keepalive offload permission to shell
This change adds PACKET_KEEPALIVE_OFFLOAD to shell, which allows
shell or code with shell permission identity to use privileged
tcp keepalive offload API.

Bug: 114151147
Test: -atest ConnectivityManagerTest#testCreateTcpKeepalive
      -build, flash, boot

Change-Id: Ib6660a5eaa72f83042596481452be4d415383f02
2019-03-21 19:56:42 +08:00
Po-Chien Hsueh
4e908c24ca API review followup: DynamicAndroidClient
Some API changes per API reivew:
- Move DynamicAndroidClient and ~Manager to android.os.image.
- Rename them to DynamicSystemClient and ~Manager.
- Rename permission MANAGE_DYNAMIC_ANDROID to MANAGE_DYNAMIC_SYSTEM
- Corresponding changes in the installation service.
- Corresponding changes in privapp-permissions-platform.xml.
- Add missing annotations.
- Change setOnStatusChangedListener's parameters order.
- Improve documentations.
- Re-generate api/system-current.txt.

Bug: 126613281
Test: adb shell am
Change-Id: Ia920e9ccf6de1dbbd38c52910cb72cb81b9b5b32
2019-03-21 17:25:59 +08:00
Evan Severson
95358d8b7b Revert "Checkbox for removing contributes files"
This reverts commit 38ea50c63e8a031a6430d26b1f5b561402007243.

Revert and clean up merge conflicts. The checkbox which asks
to remove app data is still here

Fixes:112002130
Test: Build and check that the correct box is gone
      atest CtsPackageUninstallTestCases

Change-Id: I47d8632d2fca360c02151ad54a4b927a5c2801f1
2019-03-20 17:42:57 -07:00
Hai Zhang
953a8032a8 Add system API for whether emergency assistance is enabled.
This is needed in the emergency role.

Bug: 124452117
Test: build
Change-Id: I277ad208dfa07d42f3e2daee658d30ef831d4b9b
2019-03-20 14:38:13 -07:00
Zimuzo
901c70d18c Add CONTROL_KEYGUARD_SECURE_NOTIFICATIONS to shell app
Shell app needs the permission when we run KeyguardManager CTS for
allowing private notifications as a privileged app.

Bug: 127351183
Test: m -j
Change-Id: I199bac8c8fed9ff0fc63b8c62f8002a6b273b28f
2019-03-19 22:19:56 +00:00
Julia Reynolds
d0ceefa989 API changes for NAS
- make NAS @SystemApi and guard with permission
- Add missing Nullable/NonNull annotations

Fixes: 126699678
Fixes: 127146476
Test: make, gts
Change-Id: Ie024983f7c440d5b4d3065af031b27958395f2f1
2019-03-06 09:40:36 -05:00
Remi NGUYEN VAN
2e35424ad2 Merge "Rename NetworkStack package" am: e4a40c77e1 am: 69728afbc7
am: 8f46e05096

Change-Id: I9d5b907c3bcd9b15899307927b8518a9f60eceba
2019-02-17 17:34:12 -08:00
Remi NGUYEN VAN
e4a40c77e1 Merge "Rename NetworkStack package" 2019-02-18 01:07:51 +00:00
TreeHugger Robot
2a10cb0c3e Merge "Add DynamicAndroidInstallationService" 2019-02-13 16:44:55 +00:00
Remi NGUYEN VAN
2134893486 Merge "Remove INTERACT_ACROSS_USERS_FULL for NetworkStack" am: 749dfc3083 am: 082034a6dd
am: 67e46255ea

Change-Id: I57248b9294e239d031dcf36cf75e94bf58919701
2019-02-11 21:20:07 -08:00