435 Commits

Author SHA1 Message Date
Jeff Sharkey
d14e9c0518 Migrate MTP service into separate project.
As part of getting MediaProvider to compile against supported APIs,
we're moving MTP related logic into its own repository.

Bug: 135340257
Test: manual
Change-Id: Ie274b1c0da435c024385eba1e4301639991a785b
2019-08-12 13:45:05 -06:00
Nate Myren
1a8d1110c0 Merge "Permission flag updates now notify listeners" 2019-07-10 16:03:07 +00:00
Artur Satayev
7e8dbfd719 Add warning about play updatable apps.
Test: comment change

Change-Id: I2e3adf16e43a797732aa15f7f042e885d1238d04
2019-07-05 12:29:52 +01:00
Nate Myren
d3a6385686 Permission flag updates now notify listeners
Added a version of the onPermissionUpdated and
onInstallPermissionUpdated methods which will notify
OnPermissionChangedListeners, and added this to the
PermissionManagerService "updatePermissionFlags" and
"updatePermissionFlagsForAllApps" methods. Also adds
OnPermissionsChangedListener to @TestApi

Fixes: 135937566
Test: atest PermissionUpdateListenerTest
Change-Id: I906598c366234c3daaa202261678bca04837cb13
2019-06-28 16:56:26 +00:00
Alan Stokes
cc327c3c94 Merge "Explicitly grant START_ACTIVITIES_FROM_BACKGROUND to com.android.phone." 2019-06-25 07:36:41 +00:00
Michal Karpinski
a98e7b66b3 Merge "Merge "Add START_ACTIVITIES_FROM_BACKGROUND permission for com.android.providers.downloads" into qt-dev am: ec3ba99e95 am: 8fdf790def" into qt-r1-dev-plus-aosp
am: 0b89f2ead7

Change-Id: Iebe47e816a89243874eb62aa97ab393a47ca320b
2019-06-18 15:28:07 -07:00
Roshan Pius
bf56cc0089 privapps-permission: Grant REQUEST_NETWORK_SCORES to car system apps
NETWORK_REQUEST_SCORES is being changed to a privileged permission from
signature only permission. The wifi stack needs to obtain this permission,
so it can no longer be signature only.

Bug: 113174748
Bug: 135480528
Test: Compiles
Change-Id: Ia824676ee4ddc935346ae22b0aabd6ed4661743f
2019-06-18 09:46:28 -07: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
Roshan Pius
82f37f83a8 privapps-permission: Make REQUEST_NETWORK_SCORES a privilged permission
The wifi stack (signed by Google on non-Pixel devices) need to obtain this permission,
so it can no longer be signature only.

Bug: 113174748
Test: Compiles
Change-Id: Id9557a6d164a40698ee7d1e5926e56fd616868d0
2019-06-17 08:56:43 -07:00
Alan Stokes
953484ea44 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
2019-06-14 16:06:36 +01:00
Jichao Li
8878b39ccb Revert "Merge "Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for permissionController" into qt-dev am: 3206a17e5d am: c109f431a4"
This reverts commit de80ad4df7e21e2d2c070e17fbdd73da49dfc982.

Reason for revert: Revert in R, as a more complete solution in PermissionController will make the permission unnecessary.

Change-Id: Ic8401cd88438d7fb177a21f33db1c2ee1e51aa6a
2019-06-07 21:42:12 +00:00
Hongyang Jiao
de80ad4df7 Merge "Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for permissionController" into qt-dev am: 3206a17e5d am: c109f431a4
am: 0d3ce1d0b6

Change-Id: Ie5fa6cebfd7c4c83ab9149e0704f42430475c811
2019-06-07 14:36:59 -07:00
Hongyang Jiao
3206a17e5d Merge "Whitelist START_ACTIVITIES_FROM_BACKGROUND permission for permissionController" into qt-dev 2019-06-07 21:08:02 +00:00
Fabian Kozynski
e1247b3478 Merge "Restore WATCH_APPOPS permission for systemui" into qt-dev am: 76de5167ab am: 7b82702b18
am: 133e74adad

Change-Id: I2d9a72eae56a4c078a7d52f4b6ca13827ffe191a
2019-06-07 12:11:37 -07: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
Fabian Kozynski
ade26fa73a Restore WATCH_APPOPS permission for systemui
This permission is necessary for Q as it allows systemui to tag
notifications of apps that are using certain AppOps. This is a P
feature that has regressed when the permission was made privileged.

This is used by AppOpsController in order to obtain updates on any apps
(onOpActiveChanged, onOpNoted). There is no other way to obtain the
updates from apps that are not systemui, as specified in AppOpsManager.

Talked to moltmann@ to verify that this is the correct API to use for this feature.
I'll remove this permission once SystemUI does not need it anymore.
In particular, if AppOpsController does not require it for being notified of AppOps changes.

Fixes: 134747188
Test: build
Test: dumpsys SystemUI. Check that AppOpsController is getting updates.
Change-Id: I08cca4361a7fbfa8b2eb419f1459b0b8bce93a5f
2019-06-07 17:38:01 +00:00
Jeff Sharkey
92703e3432 Merge "Shift call statistics back to the original caller." into qt-dev am: c4289bdeca am: 143cc83668
am: ae8db8697c

Change-Id: I0aae36517fa81d99632c3f53e4ed83713d8d25df
2019-05-30 15:12:45 -07:00
Jeff Sharkey
c4289bdeca Merge "Shift call statistics back to the original caller." into qt-dev 2019-05-30 21:29:21 +00: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
Nicholas Sauer
1c79b46470 Merge "Add privapp config for cluster." into qt-dev am: 826c01e8e6 am: 600d39646a
am: d64a36175c

Change-Id: Iebeecabd83127b2ff83557cfc5de6ad1cf06a6ec
2019-05-29 10:45:13 -07:00
Nicholas Sauer
5f6a7901cd Add privapp config for cluster.
bug: 133809765
Test: lunch gcar && m && emulator
lunch aosp && m && emulator

Change-Id: I585bedf65113f2417da8af30eb89788bc120926a
2019-05-29 05:21:49 +00:00
Selim Gurun
ca11f7b67f Merge "Add READ_LOGS permission" into qt-dev am: 5dcbc98f21 am: 0b264c2b97
am: d83190be77

Change-Id: I69a476541022920981bbb908d712c6fea558cc99
2019-05-28 20:01:11 -07:00
TreeHugger Robot
5dcbc98f21 Merge "Add READ_LOGS permission" into qt-dev 2019-05-29 02:38:25 +00:00
Selim Gurun
5db6cdf0c5 Add READ_LOGS permission
car service and kitchensink needs READ_LOGS permission

Bug: 133607244
Test: Manual
Change-Id: Ic9382716bf901cfbdd7e43b8c3c1ca1974693d87
2019-05-28 15:02:47 -07:00
Abhijeet Kaur
2ae76e468b Merge "Migrate Shell app to use the new bugreport API." 2019-05-28 16:56:32 +00:00
Abhijeet Kaur
767c8bb96a Migrate Shell app to use the new bugreport API.
Add new calls to bugreport API, all the while keeping the previous code
and logic untouched.

Added feature flag in Settings which if untouched, runs the old dumpstate workflow
by default. To test the new workflow turn on the feature flag from UI or
`adb shell setprop settings_call_bugreport_api true`.

Add permission TRIGGER_SHELL_BUGREPORT so that not all can send
broadcasts to trigger bugreports.

Create new receiver BugreportRequestedReceiver for the new broadcast intent that the shell app will
use.

Whitelist Shell app to use the bugreport API.

Bug: 123617758

Test: manually built and flash to device. Turn on the feature flag, generate bugreports and check
the onProgress and onFinish notifications.
Test: Turn off the feature flag test old workflow.

Change-Id: I1c7c258a48815a0386d7d4771301cd76f9cae3d0
2019-05-28 14:31:57 +01:00
Ivan Chiang
1100dd8db9 Merge "Add privapp-permissions for DocumentsUI" into qt-dev 2019-05-27 02:33:22 +00:00
TreeHugger Robot
ebdb9db33b Merge "Fix the internet permission for native services" into qt-dev 2019-05-24 01:18:19 +00:00
Chenbo Feng
4c755833af Fix the internet permission for native services
The native services should specify their permissions in platform.xml if
they need internet permission, otherwise the eBPF program will block the
socket creation request. Fixing the known services that are in group
AID_INET but didn't specify their permission in the xml file.

Bug: 132217906
Test: CtsJdwpTestCases dumpsys netd trafficcontroller
Change-Id: I84cde7d3757953bc0bf761727d64a715bcdd68bb
Merged-In: I84cde7d3757953bc0bf761727d64a715bcdd68bb
(cherry picked from commit e5d6f0fa6c3fd77572f5b29f416acbf304abf9da)
2019-05-23 11:54:49 -07:00
TreeHugger Robot
73414d51d0 Merge "Allow wallpaper to access hidden methods" into qt-dev 2019-05-21 22:39:39 +00:00
Hyunyoung Song
41d8870bd8 Allow wallpaper to access hidden methods
Bug:133160356
Bug:129482731
Test: builds
Change-Id: Id4a95be17d54bc62c105041ef7e756cfa56081f4
2019-05-21 12:30:46 -07: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
TreeHugger Robot
a9607b296a Merge "Android Q is API 29" into qt-dev 2019-05-20 18:32:59 +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
Philip P. Moltmann
41b312003f Android Q is API 29
Hence mark the new split permissions as 29 instead of 10000.

Fixes: 132898943
Test: atest SplitPermissionTest
Change-Id: I0aa3e9b4d60cea1a59b891f2fb2d94a734efebf2
2019-05-16 14:03:46 -07:00
Bill Lin
54f1f21be2 Add privapp-permissions for DocumentsUI
DocumentsUI use @hide private permission:
    "android.permission.CHANGE_OVERLAY_PACKAGES"

Test: atest DocumentsUITests
Test: check CHANGE_OVERLAY_PACKAGES grant to DocumentsUI.apk
Test: check CHANGE_OVERLAY_PACKAGES grant to com.android.documentsui
Test: com.android.documentsui.xml locate in system/etc/permissions
Test: DocumentsUI.apk locate in /system/priv-app/

Bug: 128689309
Bug: 131331107
Bug: 132671058

Change-Id: Ie9bffbe152da511dc08882fd44e95dd426aef980
2019-05-15 05:13:24 +08:00
Evan Wu
e7c34cd7bb Merge "Upgrade AOSP Dialer to Android Q, add necessary permissions." into qt-dev 2019-05-14 18:01:09 +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
Evan Wu
d6474c24a8 Upgrade AOSP Dialer to Android Q, add necessary permissions.
1.Protect Device Identifiers: Starting in Android Q, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device's non-resettable identifiers
IMEI and serial is used for the *#06# dialog. OEMs needs this to run factory tests. Perhaps it is something that should be moved to telephony, but as the current state dialer is showing it.

2.Limit pre-installed app network permission:Preinstalled apps that want to access restricted network needs to declare the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
Restricted network is used for VVM access.

Bug: 132081872,132080738
Test: Compile and load build
Change-Id: I246ab62a252d8a0335b8cc9ac5bb2089910781c9
2019-05-07 00:18:35 +00:00
Antoan Angelov
61c8bb74e6 Merge "Add START_ACTIVITIES_FROM_BACKGROUND to ManagedProvisioning." into qt-dev 2019-05-02 14:59:58 +00:00
Nicholas Sauer
a067a1ca9a Merge "privapp configs for car related apps." into qt-dev 2019-05-02 14:00:46 +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
Nicholas Sauer
4037c7ee73 privapp configs for car related apps.
bug: 126582117
Test: lunch gcar_emu_x86-userdebug && m && emulator
Change-Id: Id1527857f11a3627f3215afa141feb3a73ef6c53
2019-04-29 07:54:02 -07: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