Commit Graph

827 Commits

Author SHA1 Message Date
Jeff Sharkey
b270eabe36 Merge "Aggresive performance optimizations." into qt-dev
am: 433b7fc88b

Change-Id: Iae7e2135360590f7246aea640fadd95ff0cad4c4
2019-05-17 23:12:40 -07: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
Evan Laird
79e5e41853 Merge "Grant STATUS_BAR permission to com.android.shell" into qt-dev
am: 36e3f91918

Change-Id: I48c58cb96499b3dbf9ea2811184b9b1ce2d12555
2019-05-10 18:58:43 -07:00
TreeHugger Robot
36e3f91918 Merge "Grant STATUS_BAR permission to com.android.shell" into qt-dev 2019-05-11 00:46:36 +00:00
Bill Yi
a6865863b2 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I3b830d4343ec1aa35e4b5174ad3b0f1e81261f8c
2019-05-04 08:39:32 -07:00
Sasha Smundak
7d539ad6f3 Merge "Convert packages/Shell/**/Android.mk file to Android.bp" am: 355f9f77a9
am: 3d94f0ea5b

Change-Id: Iae73f1affbb285c1a2f978340a2a17ba17607265
2019-05-03 09:31:09 -07:00
Sasha Smundak
3d94f0ea5b Merge "Convert packages/Shell/**/Android.mk file to Android.bp"
am: 355f9f77a9

Change-Id: I7c869c798b4836485daee9113b83100fc36ee862
2019-05-03 09:20:52 -07:00
Sasha Smundak
995887eafb Convert packages/Shell/**/Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: atest ShellTests
(same errors as baseline)
Change-Id: I63b777342359e0b42ccd554b7d056c7431178380
2019-05-02 21:35:45 -07:00
Bill Yi
0862e69651 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I4a4bfa1d6db234699c00ce167efa16ab297da941
2019-04-25 09:49:28 -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
Bill Yi
2524f8f796 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I88f2588ab4330239de3174b349f9b08f97b3cfce
2019-04-17 14:02:09 -07:00
Bill Yi
16adee0dec Import translations. DO NOT MERGE
Change-Id: I219d0c8ab1cf805a0f32e64b53dee3a94abfa68a
Auto-generated-cl: translation import
2019-04-12 21:17:01 -07:00
Narayan Kamath
55a06bb5d1 Merge "Shell: Grant CACHE_CONTENT to Shell"
am: dd2e005d2f

Change-Id: I5a409357fa9a4acd2cc7cbdf707b7388557e8643
2019-04-10 01:20:37 -07:00
Narayan Kamath
f207dc666f Shell: Grant CACHE_CONTENT to Shell
Required to test ContentResover#[get|put]Cache

Bug: 127711435
Test: atest CtsContentTestCases

(cherry picked from commit a31ed1bbdd)

Merged-In: I5eb72772a0a35897611dd6db95c68a2d2e971e9a
Change-Id: I91a91a2969db175d88e9f41938869bc751f7b108
2019-04-09 18:58:02 +01: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
Narayan Kamath
a31ed1bbdd Shell: Grant CACHE_CONTENT to Shell
Required to test ContentResover#[get|put]Cache

Bug: 127711435
Test: atest CtsContentTestCases
Change-Id: I5eb72772a0a35897611dd6db95c68a2d2e971e9a
2019-04-09 09:50:53 +01: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
Hall Liu
7e3864bc99 Merge changes from topics "nw-scan-cts", "nw-scan-changes"
am: f276a56215

Change-Id: I1399e0bd8a6ff26e8df2bfc7d4515e4dbb1d64e4
2019-04-01 13:54:15 -07:00
Hall Liu
f276a56215 Merge changes from topics "nw-scan-cts", "nw-scan-changes"
* changes:
  Add shell permissions for CTS testing
  Allow requestNetworkScan to return sanitized info
2019-04-01 20:31:10 +00:00
TreeHugger Robot
5595790416 Merge "Grant com.android.shell access to DynamicSystem" 2019-03-31 15:12:39 +00:00
Hall Liu
64fbe76fba 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
Merged-In: I1f75c9005620b3b0e06f066677cba6190f1d266c
2019-03-29 17:15:02 +00:00
Mark Chien
b15da9fb19 Merge "[KA09] add keepalive offload permission to shell"
am: bc350db984

Change-Id: Ica5b5ec05731a7c840d1f7dd1534d532c524df04
2019-03-28 23:34:48 -07:00
Mark Chien
bc350db984 Merge "[KA09] add keepalive offload permission to shell" 2019-03-29 06:15:11 +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
KOUSHIK PANUGANTI
7c3422aa30 Merge "Migrate frameworks/base/packages/Shell to androidx.test" am: fae40404f7 am: 343676e483
am: bf95e8d0ca

Change-Id: I75cac67a55969ced8379368e7b74b9e6e9ef79c0
2019-03-28 14:01:01 -07:00
KOUSHIK PANUGANTI
343676e483 Merge "Migrate frameworks/base/packages/Shell to androidx.test"
am: fae40404f7

Change-Id: Icc87997f68dcc8256fec71d213ea754d8bd8c729
2019-03-28 13:22:22 -07: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
Treehugger Robot
fae40404f7 Merge "Migrate frameworks/base/packages/Shell to androidx.test" 2019-03-28 19:56:53 +00: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
markchien
95ddfff752 [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
Merged-in: Ib6660a5eaa72f83042596481452be4d415383f02
2019-03-28 04:41:14 +00:00
Abhijeet Kaur
f43399621c Merge "Add Looper.prepare() to doInBackground()"
am: 89bf100d66

Change-Id: Ia030ffbf4913d1f04f0f007a9947186d107038cc
2019-03-25 02:01:16 -07:00
Treehugger Robot
89bf100d66 Merge "Add Looper.prepare() to doInBackground()" 2019-03-25 08:48:03 +00:00
Abhijeet Kaur
f990cf0392 Add Looper.prepare() to doInBackground()
Fix runtime error that was being thrown as Looper.prepare() was not called
in the async function doInBackground.

Bug: 124612105

Test: Was not able to reproduce the bug (that is make code execution flow
through the catch block).
* Reproduced by throwing IOException in the try block so that code flows
  to the catch block.
* Build and flash.
* Take interactive bugreport and change title and name of the bugreport from
  the progress bar.

Merged-In: I6a5ea594d95462e1c66bd28eb81dd5f4daa6f35e
Change-Id: I6a5ea594d95462e1c66bd28eb81dd5f4daa6f35e
(cherry picked from commit b7a6549654)
2019-03-23 15:39:03 +00:00
TreeHugger Robot
0369790fac Merge "Add Shell permission for CTS test." 2019-03-22 22:31:32 +00:00
TreeHugger Robot
f07223a399 Merge "Add Looper.prepare() to doInBackground()" 2019-03-22 11:51:48 +00:00
Abhijeet Kaur
b7a6549654 Add Looper.prepare() to doInBackground()
Fix runtime error that was being thrown as Looper.prepare() was not called
in the async function doInBackground.

Bug: 124612105

Test: Was not able to reproduce the bug (that is make code execution flow
through the catch block).
* Reproduced by throwing IOException in the try block so that code flows
  to the catch block.
* Build and flash.
* Take interactive bugreport and change title and name of the bugreport from
  the progress bar.

Change-Id: I6a5ea594d95462e1c66bd28eb81dd5f4daa6f35e
2019-03-22 11:37:07 +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
Zimuzo Ezeozue
91ea7af912 Merge "Add CONTROL_KEYGUARD_SECURE_NOTIFICATIONS to shell app" 2019-03-21 16:03:05 +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
KOUSHIK PANUGANTI
390f4c03ab Migrate frameworks/base/packages/Shell to androidx.test
See go/jetpack-test-android-migration

Test: mmma frameworks/base/packages/Shell
Change-Id: I26076b3ad1871dde3ef6b206bf5502648d1a0cbb
2019-03-20 05:36:17 +00: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
Richard Uhler
1fc10c1209 Only allow rollback to be enabled on modules.
Only allow rollback to be enabled on the modules included in a mainline
update. We don't want to support rollbacks for all apks in general yet.

Enforce that only installers granted the MANAGE_ROLLBACKS permission can
enable rollback for a package.

Introduce a new TEST_MANAGE_ROLLBACKS permission that can be used to
enable rollback on packages that are not modules. This allows us to
continue testing rollbacks, given we can't do a mainline update as part
of the rollback tests.

Test: atest RollbackTest, with new tests for permissions added.
Bug: 128277794
Change-Id: I29ab9a750a1283592b8a855322ece516e42260ca
2019-03-18 14:05:28 +00:00
Benedict Wong
7e89a284ec Merge "Add MANAGE_TEST_NETWORKS permission as @hide" am: 96f51fd970 am: 7a66b02e62
am: db34163526

Change-Id: Ic283c247bbb5b62f9816cf074abd1fbeb5778cd4
2019-03-14 11:31:44 -07:00
Benedict Wong
7a66b02e62 Merge "Add MANAGE_TEST_NETWORKS permission as @hide"
am: 96f51fd970

Change-Id: Ia5e9f3e7ba7024151d0f4fa595bf66daaa0fc948
2019-03-14 10:59:14 -07:00
Benedict Wong
600d93f1de Add MANAGE_TEST_NETWORKS permission as @hide
This commit adds a new permission for test networks, granted to the
shell permission identity.

Bug: 124519473
Test: In-progress CTS tests
Change-Id: I995b93a66d283b9e37381b616843dd44dbafe319
2019-03-13 00:44:04 +00:00
Hai Zhang
7e9b5b3c76 Merge "Add OBSERVE_ROLE_HOLDERS permission to shell."
am: 3d8cef1fa8

Change-Id: Id4d2229546b9a8469a6ec2abb897ec620f82995b
2019-02-27 12:30:43 -08:00
Hai Zhang
f7e8368d31 Add OBSERVE_ROLE_HOLDERS permission to shell.
This allows testing relevant APIs in CTS tests. The listener itself
only gives the changed role name and user affected.

Bug: 125404675
Test: build
Merged-In: I5c979a26dae103ea1b633c2119c59363d8953aa2
Change-Id: I29ca1827e597d318cbd74ba3e70796c5853a9dc4
2019-02-26 16:55:35 -08:00
Hai Zhang
abf0d98d61 Add OBSERVE_ROLE_HOLDERS permission to shell.
This allows testing relevant APIs in CTS tests. The listener itself
only gives the changed role name and user affected.

Bug: 125404675
Test: build
Change-Id: I5c979a26dae103ea1b633c2119c59363d8953aa2
2019-02-26 16:50:53 -08:00
Xin Li
b455c3a7f3 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
2019-02-21 16:02:06 -08:00