Commit Graph

6443 Commits

Author SHA1 Message Date
TreeHugger Robot
e848e106b6 Merge "Revert incorrect NonNull assertions in ColorStateList loading" 2018-02-12 19:17:14 +00:00
TreeHugger Robot
d6d5e0cc77 Merge changes from topic "revert-assetmanager2-02-09-2018"
* changes:
  Revert "Replace AssetManager with AssetManager2 implementation"
  Revert "libandroidfw: Make sure to set the 'app as lib' flag"
  Revert "Make idiomatic use of ApkAssets and AssetManager"
  Revert "libandroidfw: Add ApplyStyle and SetConfiguration benchmark"
  Revert "libandroidfw: Improve performance of AssetManager2"
  Revert "AssetManager2: Allow out of order type/type spec"
  Revert "AssetManager2: Fix list function"
  Revert "AssetManager2: Fix issue with native cast"
2018-02-10 03:42:41 +00:00
Chris Craik
2e41d49d00 Revert incorrect NonNull assertions in ColorStateList loading
Fixes: 73157047
Test: atest CtsContentTestCases:ResourcesTest

Partial revert of ceb2693621

Change-Id: I7c1db6f8d2b3451692b018212576960c78250d57
2018-02-09 14:29:11 -08:00
Dianne Hackborn
12ff371627 Add AttributeSet.getAttributeNamespace().
Why not.

Bug: 73101753
Test: Build and booted
Change-Id: I8f712ce9d7ed06eceef04d50a733a9471429b94c
2018-02-09 12:51:58 -08:00
Adam Lesinski
bde1df21ad Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit 1187590da3.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
2018-02-09 12:43:24 -08:00
Adam Lesinski
56c82be0d4 Revert "Make idiomatic use of ApkAssets and AssetManager"
This reverts commit 633085456e.

Bug: 73134570
Change-Id: I7c5171e752dd178dcd64497a780ba0f97d03b7a0
2018-02-09 12:43:15 -08:00
TreeHugger Robot
446772121f Merge "Send broadcast to pkg installers on config change" 2018-02-09 07:22:03 +00:00
TreeHugger Robot
25d7f46aa9 Merge "Revert "Call ImageDecoder directly in ResourcesImpl"" 2018-02-09 03:47:26 +00:00
TreeHugger Robot
88f284a3d3 Merge "Change Resources.getDrawable nullability" 2018-02-09 01:30:23 +00:00
Adam Lesinski
57fccd61a5 Send broadcast to pkg installers on config change
Send a protected system broadcast to apps that hold
the INSTALL_PACKAGES permission whenever a change to
properties like locale or display density happens.

Receivers can be registered in the manifest, and a process
will be woken up to receive the broadcast.

This will happen rarely, since the configuration changes
eligible to trigger this broadcast are rare themselves.

Bug: 63918966
Test: manual

Change-Id: I817a51ea05f762e02561691825d57d643db7dc30
2018-02-08 16:41:37 -08:00
TreeHugger Robot
40279e5407 Merge changes I6993325b,Icb5114fe
* changes:
  Frameworks: Annotate trivial @GuardedBy in services/core
  Frameworks: Annotate trivial @GuardedBy in core/java
2018-02-08 23:32:03 +00:00
Leon Scroggins
0f05b4895d Revert "Call ImageDecoder directly in ResourcesImpl"
This reverts commit 40c59fdef0.

Reason for revert: b/73083791

Change-Id: I044e534be07c5fd18c99dcc65a14b72eaf1fecd5
2018-02-08 21:14:32 +00:00
Chris Craik
ceb2693621 Change Resources.getDrawable nullability
Resources.getDrawable() was annotated @Nullable because there was one
very particular path where Bitmap decoding would fail and trigger a null
return.

As part of the switch to ImageDecoder, that path was changed to now throw
an IOException, which will result as a NotFoundException to the caller of
getDrawable.

This CL annotates that path as @NonNull to reduce pain of dealing with
@Nullable method that was very unlikely to be null in practice.

Also fixes many other missing nullability annotations, and relabel
many @Nullable paths that would never return null in practice as
@NonNull.

Bug: 69543526
Test: ResourcesTest

Change-Id: Ib01eca970c5c9969998ce5b265b120aa7048b41a
2018-02-08 13:11:38 -08:00
Etan Cohen
af018ce387 Merge "[RTT] Deprecate legacy RTT API" 2018-02-08 19:03:27 +00:00
Jiuyu Sun
b6276fe5a3 Merge "Revert "Public EuiccManager APIs."" 2018-02-08 17:34:30 +00:00
Jiuyu Sun
d3bb4aed78 Revert "Public EuiccManager APIs."
This reverts commit af6a5fffdc.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Id3296a91e5c3ad624a6a03f6532b859524a518bf
2018-02-08 16:38:26 +00:00
TreeHugger Robot
71a24be984 Merge "Fix APCT tests" 2018-02-08 15:06:53 +00:00
Andreas Gampe
3f24e69dbe Frameworks: Annotate trivial @GuardedBy in core/java
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.

Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Icb5114fea2ff2385e1cc7511121026099e05c0ee
2018-02-08 02:19:42 -08:00
Jiuyu Sun
7fdd2bf7c1 Merge "Public EuiccManager APIs." 2018-02-07 23:55:28 +00:00
Todd Kennedy
d5aaa44859 Fix APCT tests
* remove testInsertPackageSetting
* add path to c'tor for testUpdatePackageSetting0[12]

Change-Id: Ia690839268470db227538a7b64557da182d97751
Fixes: 72959078
Test: atest -it FrameworksServicesTests:PackageManagerSettingsTests
2018-02-07 15:44:19 -08:00
Etan Cohen
d0acccdf25 [RTT] Deprecate legacy RTT API
Bug: 65108579
Test: unit tests pass
Test: WifiRttManagerTest:test_regular_scan_then_rtt_ranging_stress
Change-Id: Ifa90acf8bb358657785b42222e68c537658c85e2
2018-02-07 12:36:09 -08:00
Holly Jiuyu Sun
af6a5fffdc Public EuiccManager APIs.
Public EuiccManager and other related necessary files.
Mark EuiccCardManager and other related necessary files as @SystemApi.
Solve lint errors and warnings.

Bug: 35851809
Test: test on phone
Change-Id: Id7895f9b35ce9d4fb6fae42ba89ca9b29dbfa74c
2018-02-07 11:09:27 -08:00
Dan Cashman
050b79975b PackageInfo: add Parcel read/write for cert history.
commit: 5cdda3425c added a new flag,
GET_SIGNING_CERTIFICATES to PackageManager for use with getPackageInfo
that returns the signing certificate history, including the current signer,
of the given package.  This is intended to replace the existing
GET_SIGNATURES flag and corresponding field.  The previous commit did not,
however, implement the read/write Parcelable methods so that this
information could be reconstructed client side.  Implement those methods
to actually expose the new API.

Bug: 64686581
Test: Test app pull of PackageInfo with GET_SIGNING_CERTIFICATES succeeds.
Change-Id: I1c023da2a6fd03e11432953080045a79b9f56839
2018-02-06 21:11:23 -08:00
David Brazdil
568f5e573a Fix ApplicationInfo.isAllowedToUseHiddenApi predicate
FLAG_UPDATED_SYSTEM_APP does not imply FLAG_SYSTEM, need to check both.

Bug: 64382372
Test: make
Change-Id: I1ad87c5ef0ad90c090da9264b894ae25e87996ae
2018-02-07 00:20:21 +00:00
TreeHugger Robot
a54e69a116 Merge "Increase instant app privacy with dummy data" 2018-02-06 23:18:13 +00:00
Adam Lesinski
cffb3604ae Merge changes from topic "assetmanager2"
* changes:
  libandroidfw: Improve performance of AssetManager2
  libandroidfw: Add ApplyStyle and SetConfiguration benchmark
  Make idiomatic use of ApkAssets and AssetManager
  libandroidfw: Make sure to set the 'app as lib' flag
  Replace AssetManager with AssetManager2 implementation
2018-02-06 19:52:36 +00:00
Patrick Baumann
4db6bc16d0 Increase instant app privacy with dummy data
This change adds some additional digest prefixes to instant app
resolution to make inverting the hash more difficult.

Change-Id: Ibf907495019338b5cac5dd22da275799e92f9b60
Fixes: 63445230
Test: manual - resolution still works with current production resolver
2018-02-06 11:44:25 -08:00
TreeHugger Robot
bc38a217b9 Merge "Call ImageDecoder directly in ResourcesImpl" 2018-02-06 18:34:40 +00:00
Patrick Baumann
a290039e92 Removes instant app visibility metadata check
Change-Id: I94c0ba08a429a60b3f7149e60f6e94f5c8e5617d
Fixes: 36551762
Test: atest EphemeralTest succeeds
2018-02-06 16:01:49 +00:00
Leon Scroggins III
40c59fdef0 Call ImageDecoder directly in ResourcesImpl
Test: Existing tests

Add a new (hidden) ImageDecoder.Source that accepts an AssetInputStream.
This allows us to create an AnimatedImageDrawable without fear of the
client closing the stream.

Call it from ResourcesImpl instead of Drawable.createFromResourceStream.

Change-Id: I07e00ca60c97538335a6310e830b73211fd8e7bb
2018-02-06 10:21:36 -05:00
Adam Lesinski
fbde6988ac Merge "OMS: handle overlay package upgrades, uninstalls" 2018-02-06 05:21:51 +00:00
Mårten Kongstad
db0e34ed83 OMS: handle overlay package upgrades, uninstalls
Teach the overlay manager about upgrades and uninstalls of overlay
packages. Add two transient overlay states STATE_TARGET_UPGRADING and
STATE_OVERLAY_UPGRADING.

Test: atest OverlayHostTests
Change-Id: I2d04204150f9e749f070b4e4363eacbd59355014
2018-02-05 19:26:24 -08:00
Adam Lesinski
633085456e Make idiomatic use of ApkAssets and AssetManager
Move away from using deprecated addAssetPath methods
and cache the instances of ApkAssets created.

Test: CTS passes
Change-Id: Ie95cd5a9e205a35806e7b142df5af02aa90d83ca
2018-02-05 18:38:57 -08:00
Adam Lesinski
1187590da3 Replace AssetManager with AssetManager2 implementation
Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
2018-02-05 18:38:49 -08:00
TreeHugger Robot
4b1f8e2f2d Merge "Require only ACTION_VIEW for web instant apps" 2018-02-06 01:29:05 +00:00
TreeHugger Robot
35232df401 Merge "Exempt system apps from hidden API warnings" 2018-02-06 00:07:40 +00:00
Fyodor Kupolov
f3f6f000ed Merge "Make MATCH_FACTORY_ONLY @TestApi" 2018-02-05 23:44:31 +00:00
Patrick Baumann
0da8537cf6 Require only ACTION_VIEW for web instant apps
When generic intent resolution support was added to instant apps, it
added the requirement that web instant app resolution also require the
BROWSABLE category. This change relaxes that requirement.

Test: manual - sent intent without browsable and observed resolution
Change-Id: I7d4d891484f538b46d37f2c8e7c040b370b46b9e
Fixes: 72835413
2018-02-05 23:21:47 +00:00
Todd Kennedy
96d601bd10 Revert "Add debug logs"
This reverts commit f996b76623.

Change-Id: I855a61070411b2a1fa8f1add10998aaabcef43f6
Fixes: 72369036
Test: Manual; builds and runs
2018-02-05 12:50:30 -08:00
David Brazdil
9e93d57221 Exempt system apps from hidden API warnings
Bug: 64382372
Test: make
Change-Id: Ib9bb92f29858dea4f53b0b1ba3b40bdf22b897c9
2018-02-05 20:04:16 +00:00
TreeHugger Robot
1bb9f29909 Merge "Autofill compatibility mode." 2018-02-05 09:55:29 +00:00
TreeHugger Robot
76be79a7c9 Merge "Exempt sync requests by FG app from app-standby" 2018-02-05 05:11:18 +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
5491881d77 Merge "Pass in the user defined by Context." 2018-02-03 02:12:22 +00: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
Makoto Onuki
61283ecc7f Exempt sync requests by FG app from app-standby
Test: manual test with request sync, etc
Bug: 72443754
Change-Id: Iecf2d3a8c54451324a02ca2762bda72aa219bd92
2018-02-02 16:40:25 -08:00
TreeHugger Robot
fa5f30a07d Merge "Marks Context.createPackageContextAsUser as System" 2018-02-03 00:37:24 +00:00
Patrick Baumann
ef4c407123 Marks Context.createPackageContextAsUser as System
Test: Builds
Bugs: 72450666
Fixes: 72863821
Change-Id: Id36730533524af4786898afadc5f11c9be83da26
2018-02-02 13:49:48 -08:00
Jeff Sharkey
e55e721647 Merge "Put PackageInstaller in the drivers seat." 2018-02-02 20:21:25 +00:00
Jeff Sharkey
0451de6254 Put PackageInstaller in the drivers seat.
openWrite() and openRead() are very flexible APIs, but their design
means they can't take advantage of the recent FileUtils.copy()
optimizations that leverage in-kernel copying.

So add new write() and read() methods where the untrusted caller
hands an FD into the OS, and then PackageInstaller drives the actual
copying process, allowing it to use FileUtils.copy() to speed
up the copying process.  (Local benchmarks are showing a 24% speed
improvement.)

We still create a FileBridge to protect the session while an active
copy is happening.

Test: bit FrameworksCoreTests:android.os.FileUtilsTest
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/FileUtilsBenchmark.java
Bug: 71932978, 25510838
Change-Id: Icc237b4c0f80d5d24b74a30f238b7fe505b856ce
2018-02-02 11:32:56 -07:00