Commit Graph

12699 Commits

Author SHA1 Message Date
Julia Reynolds
30b82786c1 Merge "Rename broadcast constants" 2018-02-05 17:07:13 +00:00
TreeHugger Robot
5ce2d49b2f Merge "Introduce "adb shell dpm force-security-logs"" 2018-02-05 15:16:23 +00:00
Julia Reynolds
44ff7c9585 Rename broadcast constants
Test: runtest systemui-notification, cts verifier
Change-Id: I41812e7fa0ae532fbdff5c5ba88887d1b1187b79
Fixes: 72762612
2018-02-05 15:05:00 +00:00
TreeHugger Robot
1bb9f29909 Merge "Autofill compatibility mode." 2018-02-05 09:55:29 +00:00
Svetoslav Ganov
24c90450fe Autofill compatibility mode.
Autofill helps users fill credentials, addresses, payment methods,
emails, etc without manually typing. When focus lands on a fillable
element the platform captures a snapshot of the screen content and
sends it to an autofill service for analysis and suggestions. The
screen snapshot is a structured representation of the screen content.
If this content is composed of standard widgets, autofill works
out-of-the-box. However, some apps do their own rendering and
the content in this case looks like a single view to the platform
while it may have semantic structure. For example, a view may render
a login page with two input test fields.

The platform exposes APIs for apps to report virtual view structure
allowing autofill services to handle apps that have virtual content.
As opposed to apps using standard widgets, this case requires the app
developer to implement the new APIs which may require a fair amount
of code and could be seen as a processes that could take some time.
The most prominent typs of apps that fall into this category are
browsers.

Until most apps rendering virtual content and specifically browsers
don't implement the virutal APIs, autofill providers need to fall-
back to using the accessibliity APIs to provide autofill support
for these apps. This requires developers to work against two sets
of APIs - autofill and accessibility - which is incovenient and error
prone. Also, users need to enable two plugins - autofill and
accessibility which is confusing. Additionally, the privacy and
perfomance impact of using the accessibility APIs cannot be addressed
while autofill providers need to use thes APis.

This change adds an autofill compatibility mode that would allow
autofill services to work with apps that don't implement the
virtual structure autofill APIs. The key idea is to locally enable
accessibility for the target package and remap accessibility to
autofill APIs and vise versa. This way an autofill provider codes
against a single set of APIs, the users enable a single plugin,
the privacy/performance implications of using the accessibility
APIs are addressed, the target app only takes a performance hit
since accessibility is enabled locally which is still more efficient
compared to the performance hit it would incur if accessibility is
enabled globally.

To enable compatibility mode an autofill service declares in its
metadata which packages it is interested in and also what is
the max version code of the package for which to enable compat
mode. Targeted versioning allows targeting only older versions of
the package that are known to not support autofill while newer
versions that are known to support autofill would work in normal
mode.

Since compatibility mode should be used only as a fallback we
have a white list setting with the packages for which this mode
can be requested. This allows applying policy to target only
apps that are known to not support autofill.

Test:
     cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
     cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases

bug:72811034

Change-Id: I11f1580ced0f8b4300a10b3a5174a1758a5702a0
2018-02-02 19:34:26 -08:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Jason Monk
632def142d Switch SliceManager IContentProvider to ContentProviderClient
Also fix up some docs.

Test: cts + unit tests
Change-Id: I25ebbcb3fd2cef223a2cd43fba57c06a183e1d31
2018-02-02 10:33:23 -05:00
Jason Monk
b715b04763 Add backup/restore for slices access
Test: various "adb shell bmgr" commands to verify behavior
Change-Id: Ic4439e0e17516462acdb8d28fe49095209a2ed6f
Fixes: 68751119
2018-02-02 10:33:19 -05:00
Pavel Grafov
5bb5a6219d Introduce "adb shell dpm force-security-logs"
This command fetches the most recent batch of the logs
and makes them available to the DPC. Primary purpose is
to make security logging testable in CTS without having
to either wait for 2 hours or relying on implementation
details.

To prevent the user from abusing the command and
annoying the DPC, it is throttled if run more than once
per 10 seconds. Waiting happens in Dpm command.

Test: adb shell dpm force-security-logs
Bug: 70886042
Bug: 62251154
Change-Id: Ic5acd5a3e5c3b060881385c472df2b972961b626
2018-02-02 14:20:41 +00:00
Jeff Sharkey
044111b8b3 Merge "Move more folks to FileUtils.copy()." 2018-02-02 03:14:39 +00:00
TreeHugger Robot
0c8a7247c8 Merge "Switch order of onSaveInstanceState and onStop" 2018-02-01 23:26:21 +00:00
Jeff Sharkey
45c97df89d Move more folks to FileUtils.copy().
Also extend API to accept a "count" argument of exactly how many
bytes to copy, and return the actual number of copied bytes.

Improve docs.

Test: bit FrameworksCoreTests:android.os.FileUtilsTest
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/FileUtilsBenchmark.java
Bug: 71932978
Change-Id: I8d255e4f97462838c02a8ecb6d2d221188c4eff0
2018-02-01 16:01:55 -07:00
TreeHugger Robot
ab4332d616 Merge changes I855f5315,I9ac7e13e,I003837a9
* changes:
  WSA: More dead code.
  Restore pinned stack shadows.
  Nuke WSA#mClipRect/mHasClipRect
2018-02-01 04:03:36 +00:00
TreeHugger Robot
daaa009003 Merge changes I4a907600,If3205033
* changes:
  Marking used instant apps fields as System API
  Revert "Revert "Removes EphemrealResolverService and related""
2018-02-01 02:27:32 +00:00
TreeHugger Robot
3a2e3b03dc Merge "Revert "Revert "Adds generic intent Instant App resolution""" 2018-01-31 22:38:48 +00:00
Patrick Baumann
577d402d0d Revert "Revert "Adds generic intent Instant App resolution""
This reverts commit 860b8ba719.

The original change that was reverted contained a bug that allowed an
http view/browsable intent used to query for browsers to be considered
as a candidate for instant apps. This was resulting in an attempt to
bind to the instant app resolver while holding a lock on mPackages.

This change ensures that PMS doesn't bind while checking for the browser
status of a package in both the instant app filtering code and by adding
the FLAG_IGNORE_EPHEMERAL to the canonical browser intent.

Reason for revert: Applying fix

Change-Id: I4896b3a15416a11fdc3f6c191e552c4ce8963623
Fixes: 63117034
Fixes: 71916178
Test: Manual using test app at google_experimental/users/patb/InstantAppsInP
Test: atest android.appsecurity.cts.EphemeralTest passes after modification
2018-01-31 14:00:18 -08:00
Patrick Baumann
43c97a0e90 Revert "Revert "Removes EphemrealResolverService and related""
This reverts commit 1e0c91968e.

Reason for revert: Original issue fixed

Fixes: 38137176
Fixes: 38121489
Test: manual; builds and instant apps launch
Change-Id: If320503381b21580ac1b127c49f754b39ffcc93b
2018-01-31 14:00:18 -08:00
Robert Carr
32bcb10e33 Restore pinned stack shadows.
We use the approach of outsetting the stack bounds and then
insetting windows which don't have surfaceInsets by said outsets.

Test: Manual. go/wm-smoke
Bug: 72657549
Change-Id: I9ac7e13ec696f88f02794175d0d44ac870f91d33
2018-01-31 12:39:46 -08:00
David Brazdil
059054ff3f Merge "Show hidden API warning once per process" am: 880839d2d1 am: 169a159207
am: 5379c4fe3a

Change-Id: Iebf487a69de640fdcd181bc2bb8e8f8dbe826b8c
2018-01-31 19:53:52 +00:00
David Brazdil
5379c4fe3a Merge "Show hidden API warning once per process" am: 880839d2d1
am: 169a159207

Change-Id: I11b174f82b8a71884de6b384f9478d125ce45ab4
2018-01-31 19:45:39 +00:00
TreeHugger Robot
7f03076ba5 Merge "Add API to only map to slice uri and not bind" 2018-01-31 19:42:35 +00:00
David Brazdil
169a159207 Merge "Show hidden API warning once per process"
am: 880839d2d1

Change-Id: I2da706085d0ee0cb047b6b5c516c8a91487b77eb
2018-01-31 19:39:30 +00:00
TreeHugger Robot
397c38d017 Merge "Revert "Adds generic intent Instant App resolution"" 2018-01-31 09:57:26 +00:00
TreeHugger Robot
4b4539b6b0 Merge "Revert "Removes EphemrealResolverService and related"" 2018-01-31 09:57:17 +00:00
David Brazdil
d960cc4a51 Show hidden API warning once per process
In order to not spam users with warning toasts, add a boolean flag
that guards the displaying of a warning message about hidden API
usage and is set after the first time a message is shown.

Bug: 64382372
Test: manual
Change-Id: If7ea995ddf4727a15eccf55dad42ef7775b1fc91
2018-01-31 08:03:29 +00:00
Patrick Baumann
1e0c91968e Revert "Removes EphemrealResolverService and related"
This reverts commit 5564f880db.

Reason for revert: Resolve merge conflict for another revert (ag/3537193)
Bug: 72710855
Change-Id: Id7c3a3993a45c588ee4668d7486d67d764541b1e
2018-01-31 03:00:26 +00:00
TreeHugger Robot
3a247b19dd Merge "Removes EphemrealResolverService and related" 2018-01-31 02:05:32 +00:00
Patrick Baumann
860b8ba719 Revert "Adds generic intent Instant App resolution"
This reverts commit 3e8bd0f3b5.

Reason for revert: b/72710855

Change-Id: I1378ccb5c5c16256e472e1ff7c3ad2460e091300
Fixes: 72710855
2018-01-31 01:35:13 +00:00
Andrii Kulian
391161f110 Switch order of onSaveInstanceState and onStop
This CL switches order of onSaveInstanceState and onStop
callbacks for app that target P+. Now activity state will
be saved after onStop.

Bug: 68763258
Test: Manual
Change-Id: If0410cbfe7920bfff9e3b9fd8879646c5622cb33
2018-01-30 16:59:14 -08:00
Andrii Kulian
7db9d22139 Merge "Always execute onStop and onSaveInstanceState together" 2018-01-31 00:46:21 +00:00
Alex Chau
87ea3c3de3 Merge "API Review: Return status code for user management APIs" 2018-01-30 23:30:52 +00:00
Patrick Baumann
5564f880db Removes EphemrealResolverService and related
This change removes deprecated classes and constants that were not
renamed from ephemeral to instant prior to O. There were no
consumers of these APIs as correctly named alternatives existed and were
referenced in docs. No known consumers of these APIs exist on user
builds.

Fixes: 38137176
Fixes: 38121489
Test: manual; builds and instant apps launch
Change-Id: I982f8a6edc5668dd42cea65e52a1433ec8d6f8ef
2018-01-30 22:48:03 +00:00
TreeHugger Robot
d937d4b80c Merge "Update slice constants for range/input range." 2018-01-30 22:21:21 +00:00
Jason Monk
7b8fef2573 Add API to only map to slice uri and not bind
Test: cts
Bug: 68751119
Change-Id: Ideef3089f21f9dbffacf50a3e0ff139b214062ca
2018-01-30 16:23:07 -05:00
Tyler Gunn
83a6df5b07 Merge "Add handover permission, fill in some missing API gaps." am: 1dfa830bb0
am: ed4dd9fbc6

Change-Id: I2f04ac80df28e45d1bb9f8e55b45317752d61bd6
2018-01-30 19:43:52 +00:00
Tyler Gunn
ed4dd9fbc6 Merge "Add handover permission, fill in some missing API gaps."
am: 1dfa830bb0

Change-Id: Ie07c7031c1411b59bbcd250be9517eda51b58310
2018-01-30 19:32:32 +00:00
TreeHugger Robot
7f8fddc310 Merge "Fix slice listener permissions" 2018-01-30 19:19:27 +00:00
Treehugger Robot
1dfa830bb0 Merge "Add handover permission, fill in some missing API gaps." 2018-01-30 18:33:27 +00:00
Alex Chau
596c2880b3 API Review: Return status code for user management APIs
- Replaced boolean return value with error code

Bug: 71866621
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StartInBackground
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StartInBackground_MaxRunningUsers
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_CannotStopCurrentUser
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StopUser
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LogoutUser
Test: com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest#testCannotStartManagedProfileInBackground
Test: com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest#testCannotStopManagedProfile
Test: com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest#testCannotLogoutManagedProfile
Change-Id: Iddc3e33c91c3f9584d53e537dbab3f61b8772fb1
2018-01-30 17:34:07 +00:00
TreeHugger Robot
1b24054faf Merge "Fixed Activity.dump() to lazy load AutofillManager if needed." 2018-01-30 16:56:16 +00:00
Amin Shaikh
60593c2444 Update slice constants for range/input range.
Test: make
Bug: 68378584
Change-Id: Ie731edd779f60d0555ea3a573f465f4f3910a054
2018-01-30 10:55:56 -05:00
Jason Monk
3a1d2e9791 Fix slice listener permissions
When trying to listen to slices without permission before hand, it
would previously crash. Now it works properly with the grant dialog
and whatnot.

Test: uiservicestests
Bug: 68751119
Change-Id: I3aedab9c75ac8486026723dea5c93ee950995295
2018-01-30 10:13:11 -05:00
TreeHugger Robot
5e25d9aaa2 Merge "Revert "Minor LoadedApk refactoring."" 2018-01-30 14:43:28 +00:00
Todd Kennedy
233a0b14ca Revert "Minor LoadedApk refactoring."
This reverts commit 7541ca4d1a.

Change-Id: I2a6aa5038870c32c4145436f0463092c9b82dd23
Bug: 71501570
Test: manual
2018-01-30 05:53:38 -05:00
Felipe Leme
9d16dff058 Fixed Activity.dump() to lazy load AutofillManager if needed.
Bug: N/A
Test: manual verification

Change-Id: I2ab74caab460e41ed6c08882af3d504d3322a577
2018-01-29 18:13:16 -08:00
Alison Cichowlas
087fc33b05 Merge "Revert "Security model for moving sharesheet to systemui"" 2018-01-30 00:00:10 +00:00
Alison Cichowlas
76f0ccb5f1 Revert "Security model for moving sharesheet to systemui"
This reverts commit 88f3d4dbe1.

Bug: 72554856
Test: repro instructions in bug
2018-01-29 16:34:33 -05:00
Sudheer Shanka
5be44ff31c Add a DPM api to check if a pkg is restricted to use metered data.
We need this so that Settings can check if an app is
restricted by admin from using metered data.

Bug: 63700027
Test: manual
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I9a2ea9c458b0f10a3c3c6edcbe82da9eccaa51c3
2018-01-29 11:24:46 -08:00
Andrii Kulian
8ae7957390 Always execute onStop and onSaveInstanceState together
Because onStop is guaranteed to be called when activity goes away
and onSaveInstanceState is always called before onStop (starting
with Honeycomb), we can execute these two callbacks together.

This CL consolidates all call points to stop the activity and
moves them to callActivityOnStop, which will also take care of
saving instance state.

Bug: 68325009
Bug: 68763258
Test: Manual
Change-Id: I1062c6be28581a7de7961babd55664640aaae359
2018-01-29 10:51:48 -08:00
TreeHugger Robot
84783905c0 Merge "Adds generic intent Instant App resolution" 2018-01-29 18:43:46 +00:00