Commit Graph

6843 Commits

Author SHA1 Message Date
Jeff Sharkey
32b947ead4 Throw exceptions expected by CTS.
Bug: 111855029
Test: atest android.content.cts.ContentValuesTest
Change-Id: If05d9d0f0960bf890af742fc9c13926bbc5eb4b6
2018-08-08 13:42:53 -06:00
Jeff Sharkey
ce599a149d Merge "Add tracing for ContentProviders." 2018-08-07 17:04:44 +00:00
Jeff Sharkey
9664ff5590 Add tracing for ContentProviders.
You could squint at raw Binder transactions to try detecting calls
like these, but there are several ContentProviders inside the OS
that either call into themselves, or call into providers within the
same process, which means it's more difficult to triage slow calls
without explicit visibility.

Bug: 112080089
Test: manual
Change-Id: I4e1e026f2bdc43d179c796d892e84af6da559f3a
2018-08-03 17:08:07 -06:00
Sudheer Shanka
9c5079a2fb Limit sharedUserIds to 255 characters.
These sharedUserIds will be used as filenames and ext4 filesystem
has a limitation of 255 bytes on the filename length. This is the
same limit we currently use for the package names.

Bug: 111890351
Test: device boots
Change-Id: I22ca607cf4243887bd47e7803ae77a3af903da78
2018-08-03 19:53:44 +00:00
Philip P. Moltmann
7c79a07c34 Merge changes from topic "SplitPackageInstaller"
* changes:
  Split PackageInstaller app into installation and permissions management
  Copy package installer into framework/base/packages/PackageInstaller
2018-08-01 14:26:10 +00:00
Sudheer Shanka
0a541a5a3a Update StorageManagerService to push package info to vold.
For creating the package sandboxes, vold needs app ids and
sandbox ids for all available packages on the device.

Bug: 111890351
Test: n/a
Change-Id: Icafd27e2663f11deeb11d46592ef8f1c653dbc4f
2018-07-31 14:19:37 -07:00
Philip P. Moltmann
8943ad6325 Split PackageInstaller app into installation and permissions management
The two components were mostly independant for a long time. Since
I1e80a3f5e63d02b3859ecf74af21ca4c61f96874 the installation flow does
not grant any permissions anymore and the last connection between these
parts was broken.

The new app "com.android.packageinstaller" in
frameworks/base/packages/PackageInstaller will only handle (side load)
package installtion and uninstallation.

The exisiting app will be renamed to "com.android.permissioncontroller"
and only handle permission granting and permission management.

This change does only minimal cleanup cleanup. In particularly it does
not move any files in the old permissions controller. This is to not
disturb other features currently in development.

This change set also updates the make files to install the two apps on
the appropriate devices.

Further the permisson policy xmls need to be updated to point to the
right packages.

Test: Installed + uninstalled packages
      Granted permissions + managed permissions

      GtsPackageInstallTestCases
      GtsNoPermissionTestCases
      GtsNoPermissionTestCases25
      GtsPackageInstallerTapjackingTestCases
      GtsPackageUninstallTestCases
Change-Id: I2d3796b837fc0049e712c82a990907f305c8febf
2018-07-30 08:59:51 -07:00
Wale Ogunwale
590c716f8c Merge "Moved URI grants code out of ActivityManagerService to its own service (13/n)" 2018-07-26 03:56:08 +00:00
TreeHugger Robot
3b8a4cec85 Merge "Rename ACTION_CONFIRM_PERMISSIONS -> ACTION_CONFIRM_INSTALL" 2018-07-24 22:46:52 +00:00
Philip P. Moltmann
6c644e620d Always review permissions before <M app is started the first time
This splits the
- review permissions
- individually control permissions
- consent to manage wireleess (wifi + bluetooth)
properties.

Almost all code cares only for the first and it is now always true.
Hence a lot of code can be simplified.

Bug: 110431654
Test: atest PermissionsHostTest
      started pre-M app
Change-Id: I733cd476ccd0bf5eaa59e9a9506db34f57c6baee
2018-07-24 11:45:34 -07:00
Wale Ogunwale
6d50dcc8af Moved URI grants code out of ActivityManagerService to its own service (13/n)
Allows for other services like window manager to call uri grants without
holding AM service lock.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie5b4ddb19a2cedff09332dbeb56bcd9292fd18ac
2018-07-23 16:37:46 -07:00
Philip P. Moltmann
e8fe3cb195 Rename ACTION_CONFIRM_PERMISSIONS -> ACTION_CONFIRM_INSTALL
The old name never really made sense. Now that installations get
confirmed on first start of the app, the old name doesn't make sense at
all anymore.

Test: Installed app via PackageInstallSession (gts-tradefed run
commandAndExit gts-dev -m GtsPackageInstallTestCases)
Change-Id: I3701d34068e2c30002a3b1dddf4aacead8bafaa2
2018-07-23 15:38:08 -07:00
Jeff Sharkey
6adc98c09c Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-07-13 18:11:37 -06:00
Jeff Sharkey
5aae0c9df7 Utility methods useful for working with files.
Part of getting DocumentsUI ready for building against public API.

Test: builds
Bug: 110959821
Change-Id: I7cc0acd5ac3bcc89790cb49f34291ae523e44019
2018-07-11 14:41:24 -06:00
TreeHugger Robot
9a8e27a915 Merge "Allow UiAutomation to adopt the shell permission indentity" 2018-07-04 03:00:14 +00:00
Svet Ganov
d873ae62c4 Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2018-07-03 16:39:44 -07:00
TreeHugger Robot
ca48d74547 Merge "Make getDimension's Javadoc say it returns px." 2018-07-02 20:29:29 +00:00
Danny Epstein
4ffbd471b4 Make getDimension's Javadoc say it returns px.
Bug: 24467193
Test: Only changed Javadoc.
Change-Id: I209d8ddbe025ec2c35668ddaac2bdba79305ec6a
2018-06-29 16:24:29 -07:00
Jeff Sharkey
c609116a1b Get android.os tests running against real APIs.
Combination of moving to existing public API, tagging things as
@TestApi, and bringing utility methods into tests.

Bug: 13282254
Test: atest cts/tests/tests/os/
Change-Id: Ifd24c0d048d200e8595e194890cc1dc53ddc2b3e
2018-06-29 17:15:44 -06:00
TreeHugger Robot
9fc85c97ef Merge "StrictMode to catch implicit Direct Boot matching." 2018-06-26 21:06:35 +00:00
Andrew Sapperstein
8e6710d768 Merge "Hide system apps until installed (1/2)" 2018-06-26 19:48:05 +00:00
Jeff Sharkey
c59a5e7e0b StrictMode to catch implicit Direct Boot matching.
When an app starts becoming Direct Boot aware, it can be difficult
to track down all the places they're implicitly relying on
PackageManager filtering behavior.

For example, if the current Launcher isn't Direct Boot aware, we
hide it until the user is unlocked, which could confuse other Direct
Boot aware apps into thinking it had been uninstalled, which could
cause data loss.

This change helps apps track down places where they're implicitly
relying on the automatic filtering; they should instead carefully
choose a combination of MATCH_DIRECT_BOOT flags to decide on the
explicit matching behavior they want.

To implement this, we partially migrate the updateFlags() methods
out into ApplicationPackageManager, since the checking needs to
happen on the client side to correctly report StrictMode
violations.  We don't currently mutate the flags, but we retain
the naming to keep that door open in the future.

Test: manual
Bug: 110413274
Change-Id: Iff6feba19da81ea1b4eeb3af821c3bdfbd9bf17c
2018-06-26 13:20:37 -06:00
Neil Fuller
4d9f7a8bc3 Merge "Minimum viable TimeZoneDetectorService" 2018-06-25 18:47:39 +00:00
TreeHugger Robot
abe78cd313 Merge changes from topic "biometrics-face"
* changes:
  5/n: Move FaceService to biometrics directory
  4/n: Add face authentication framework
2018-06-22 18:44:27 +00:00
Gilad Bretter
cb51b8b847 4/n: Add face authentication framework
This change is cherry-picked and rebased from AOSP
https://android-review.googlesource.com/c/platform/frameworks/base/+/660242

Add face recognition as an identification method, following fingerprint
design. Unlike fingerprint, only one face template can be enrolled per
user, and a vendor message is passed from the HAL all the way to the
client callback to allow GUI indication about the enrolled face
templates.

Add FaceAuthenticationManager and FaceService.
Add face authentication capability to TrustManager and Keyguard.
Modify TrustManager and KeyguardUpdateMonitorCallback fingerprint code
to support generic biometric method to eliminate duplications.
Add BiometricSourceType enum to keep track of the specific biometric
method.

Test: biometric authentication still works on the device

Fixes: 110385761

Change-Id: I5d04fe69a112c13d3ef7330b9c08c146e36c5335
Signed-off-by: Gilad Bretter <gilad.bretter@intel.com>
2018-06-21 17:00:07 -07:00
Rhed Jao
cd47c26d74 Hide system apps until installed (1/2)
Applying this mechanism for system carrier apps to make visibility
reasonable from the user's perspective. In other words, before
hidden system apps have been installed, they wouldn't be listed
via APIs in PackageManager which are used at all apps list and
search in Settings and so on.

Test: atest CarrierAppUtilsTest
Test: atest PackageManagerTest
Test: cts DeviceOwnerTest
Test: gts ManagedProfileProvisioningHostsideTest
Bug: 74068582
Change-Id: I1f23aba589b98351a1871a44a3058b67c416f351
2018-06-21 20:39:23 +08:00
Neil Fuller
7fb88c3928 Minimum viable TimeZoneDetectorService
This is a do-nothing TimeZoneDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeZoneDetectorServiceTest

Test: build / boot
Test: See above
Change-Id: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
2018-06-21 10:28:47 +01:00
TreeHugger Robot
6531d27cc0 Merge "Allow permissions to have background permissions" 2018-06-19 23:09:43 +00:00
Colin Cross
a844fff7ba Merge "Don't override targetVers with minCode" am: 3b0eba4499 am: 234a906ee1
am: d5f926ba79

Change-Id: Id3a1efa5e926faa52778a0762855d668ff5e54ba
2018-06-19 13:39:14 -07:00
Colin Cross
234a906ee1 Merge "Don't override targetVers with minCode"
am: 3b0eba4499

Change-Id: Ied3eb76b2b996500c540965d970fc9cc05fccbd9
2018-06-19 13:10:23 -07:00
Philip P. Moltmann
4a6dff0911 Allow permissions to have background permissions
Some permissions are getting split into foreground and background
variants. If an app only has the foreground version it can only access
the protected resource while the user is using it. Once the background
permission is added to the foreground permission the app can always
access the resource protected by the permission.

- Only having the background permission does grant anything.
- Mutliple foreground permission can share a single background permission,
  but a foreground permission can not have multiple background
  permissions.
- As the implementation of background permissions is based on AppOps
  only the system can declare such foreground/background permissions
- A CTS test enforce that the background is in the same group as the
  matching foreground permission.

Bug: 78788390
Test: Checked declared permission after boot and found new attributes
Change-Id: Ica7ba77b24345607c7467c41c982a58c39199024
2018-06-19 12:23:55 -07:00
Colin Cross
f61f9e3cd9 Don't override targetVers with minCode
If a package contains minSdkVersion="Q" targetSdkVersion="25",
targetCode will be initialized to "Q" when reading minCode,
but targetVers will be set to "25".  targetCode overrides
targetVers, so this results in the computed targetSdkVersion
being "Q".  If minSdkVersion were instead "28", the computed
targetSdkVersion would be "Q".

Make the computed targetSdkVersion consistent by leaving
targetCode and targetVers unset while parsing minSdkVersion,
and then setting them to minCode and minVers if there is
no targetSdkVersion attribute.

Bug: 110167203
Bug: 110353795
Test: install DeviceHealthChecks, verify targetSdk=25
Change-Id: I9547e9b4720543f0c892cbf4de92888c8eead44f
2018-06-18 12:58:11 -07:00
TreeHugger Robot
0348ab2db1 Merge "Removes deprecated EXTRA_EPHEMERAL*" 2018-06-12 19:48:18 +00:00
TreeHugger Robot
6006f76ad7 Merge "Split interfaces and service for activities from current AM interfaces (1/n)" 2018-06-12 18:18:48 +00:00
Andreas Gampe
eb56c581d3 Frameworks: Remove complex boolean
To allow an Errorprone warning to become an error.

Bug: 72451126
Test: m
Change-Id: I8733f0ee74de615e4ffc979fb9de38730c2506c6
Merged-In: Ia6856157e8813856268fba003e1e591d690cb26e
2018-06-12 10:37:04 -07:00
Patrick
7f3a2f81c0 Removes deprecated EXTRA_EPHEMERAL*
This change removes deprecated and unused Intent extra names that were
replaced in P with EXTRA_INSTANT* equivalents.

Change-Id: Idd57b9db5896eda24349d01c0d7557f2d4e820ea
Fixes: 72700831
Test: build succeeds and instant app launches with installer on system image
2018-06-12 15:28:33 +00:00
Neil Fuller
79d42a61e4 resolve merge conflicts of 5e1d95b0cc to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic5527b29cbe8c84d2053be849cf09df5341e4790
2018-06-12 14:23:51 +01:00
Patrick
00e8d59af0 Honors MATCH_ALL flag
This makes the behavior of MATCH_ALL match the documentation by ignoring
all other match flags.

Change-Id: I8060cedd2144d0cdbc89d974f4d9f87b601d24e3
Fixes: 35176630
Test: disabled some components and ensured they are visible when querying with MATCH_ALL
2018-06-11 10:01:57 -07:00
Neil Fuller
b557907f51 Minimum viable TimeDetectorService
This is a do-nothing TimeDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeDetectorServiceTest

Test: build / boot
Test: See above
Merged-In: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
Change-Id: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
(cherry picked from commit feeee682a2)
2018-06-11 15:29:57 +01:00
Chris Forbes
9176f02bdf Merge "pm: Exposing Vulkan 1.1 does not guarantee AHB extension support" into pi-dev am: 551328eaaa
am: 27213a3120

Change-Id: I1540f12409051323dc1540b87b61e1cc431d676c
2018-06-07 23:36:25 -07:00
Chris Forbes
27213a3120 Merge "pm: Exposing Vulkan 1.1 does not guarantee AHB extension support" into pi-dev
am: 551328eaaa

Change-Id: I4f9a420dcefb53e767a745f595787b71fcacd228
2018-06-07 22:23:29 -07:00
Chris Forbes
98f34402cc pm: Exposing Vulkan 1.1 does not guarantee AHB extension support
Bug: b/109875843
Change-Id: Ib53fb1a4f7a5a6c055b575b4d8775f8bd62db7a8
2018-06-07 16:41:19 -07:00
TreeHugger Robot
1aadbc2d09 Merge "Add new background location APIs." 2018-06-07 19:32:36 +00:00
Dianne Hackborn
afba81619d Add new background location APIs.
Work on issue #109754053: Implement tri-state location in platform

- New background location permission
- New (temporary?) API level for compatibility with old apps

None of this is exposed yet as a public API, that will be
done in the future.

Bug: 109754053
Test: atest FrameworksServicesTests:AppOpsServiceTest
Test: atest CtsPermissionTestCases:AppOpsTest
Change-Id: I986dc871b9e8ed3bf592d2546eadaefb4fefe099
2018-06-07 11:04:22 -07:00
Andrew Sapperstein
e042fdd61c Merge "Revert "Hide system apps until installed (1/2)"" into pi-dev am: bae9b1a71c
am: 15014a6f4c

Change-Id: I91a5b8e0fde679dfa324f7485fe2216017484872
2018-06-07 09:49:15 -07:00
Andrew Sapperstein
15014a6f4c Merge "Revert "Hide system apps until installed (1/2)"" into pi-dev
am: bae9b1a71c

Change-Id: I75e88cc0905cb90412609f9a14627e6fa7963a27
2018-06-07 09:36:29 -07:00
Andrew Sapperstein
bae9b1a71c Merge "Revert "Hide system apps until installed (1/2)"" into pi-dev 2018-06-07 16:15:57 +00:00
Felipe Leme
7184c4b230 Merge "Document -n option on intent specification." into pi-dev am: 39f04a7da4
am: c0830f8f2a

Change-Id: I27e11342c073d1d019ecd183044d97e67399532d
2018-06-06 20:09:35 -07:00
Felipe Leme
c0830f8f2a Merge "Document -n option on intent specification." into pi-dev
am: 39f04a7da4

Change-Id: Id8b23acedbd9fe3eb73438b1397a6ff80d36c267
2018-06-06 19:55:38 -07:00
Wale Ogunwale
65ebd955e1 Split interfaces and service for activities from current AM interfaces (1/n)
First step in unifying the window hierarchy that is currently split
within AM and WM packages. We separate the interfaces and service dealing
with activities and their containers (tasks, stack, display) from the
rest of AM interfaces and services. This will allow us to move the new
interfaces and services to WM when the internal states are cleaned-up.

Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790
Change-Id: Ide9b3f89123b768cdbd3e3878113c7a8021187f3
2018-06-06 18:26:21 -07:00