Commit Graph

6830 Commits

Author SHA1 Message Date
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
TreeHugger Robot
39f04a7da4 Merge "Document -n option on intent specification." into pi-dev 2018-06-07 00:36:10 +00:00
Sanry Huang
afef5daaf9 Revert "Hide system apps until installed (1/2)"
This reverts commit 40ede29ed6.

Bug: 74068582
Bug: 80444486
Bug: 80316870
Bug: 109803325
Bug: 109642189
Bug: 109660260
Bug: 109649585
Bug: 109647120
Bug: 109648512
Bug: 109648513
Bug: 109647122
Change-Id: I0e50ceebeaecae89f461f541450e24d9c148527d
2018-06-06 19:42:39 +00:00
Neil Fuller
df3cf2b39d Merge "Minimum viable TimeDetectorService" 2018-06-05 17:52:58 +00:00
Andrew Sapperstein
e159397fc2 Merge "Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"" into pi-dev am: 0c6929ec04
am: de8f091279

Change-Id: Ic55195e325096b049b0a4d0ae40649457cc6b0f5
2018-06-04 18:37:39 -07:00
Andrew Sapperstein
de8f091279 Merge "Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"" into pi-dev
am: 0c6929ec04

Change-Id: I2f1c4b07946290e3adde90af82b6f7a2ec55f2b1
2018-06-04 17:28:50 -07:00
Hongming Jin
82ecb81061 Merge "Add shell command handler for account manager to allow enabling service binding for instant app. Test: cts-tradefed run cts -m CtsAccountManagerTestCases cts-instant-tradefed run cts-instant -m CtsAccountManagerTestCases Bug: 79367659" into pi-dev am: 64896541d4
am: 10fa41b542

Change-Id: I2ccad1d178aab981b0f4e47f8f332e7cc6057bb0
2018-06-04 16:32:51 -07:00
TreeHugger Robot
0c6929ec04 Merge "Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"" into pi-dev 2018-06-04 23:27:42 +00:00
Jackal Guo
395391f9bc Merge "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS" into pi-dev am: 15ebbeb9fd
am: 411e733a83

Change-Id: I1f12d9261b8c0f1f058f511129d98c6831f7a6c2
2018-06-04 16:26:50 -07:00
Hongming Jin
10fa41b542 Merge "Add shell command handler for account manager to allow enabling service binding for instant app. Test: cts-tradefed run cts -m CtsAccountManagerTestCases cts-instant-tradefed run cts-instant -m CtsAccountManagerTestCases Bug: 79367659" into pi-dev
am: 64896541d4

Change-Id: I6221649f9035bcaa5dea4066b5a61c9dc8fdb06d
2018-06-04 14:19:06 -07:00
Jackal Guo
411e733a83 Merge "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS" into pi-dev
am: 15ebbeb9fd

Change-Id: I6447f40dae907f63042024ac9558aa9ba6f6f4fd
2018-06-04 14:11:44 -07:00
Hongming Jin
64896541d4 Merge "Add shell command handler for account manager to allow enabling service binding for instant app. Test: cts-tradefed run cts -m CtsAccountManagerTestCases cts-instant-tradefed run cts-instant -m CtsAccountManagerTestCases Bug: 79367659" into pi-dev 2018-06-04 20:38:46 +00:00
Andrew Sapperstein
4da326c0d6 Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"
This reverts commit 44c4ca41d8.

Reason for revert: Wanted to go with a different option and this was mistakenly Dr. No'ed.

Bug: 80444486
Test: clean revert
Change-Id: I7fdd13a5bc0f4d9fabf91f3e5497c4065008b531
2018-06-04 20:34:31 +00:00
TreeHugger Robot
15ebbeb9fd Merge "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS" into pi-dev 2018-06-04 20:32:30 +00:00