5311 Commits

Author SHA1 Message Date
Diego Perez
fdf453aa9d Fix broken perf tests
Do not dispose Bridge on tearDown. The concept of disposing the Bridge
only made sense when we were loading it dynamically. Some classes have
static initializers that will fail after the dispose (like Typeface).

Test: N/A
Change-Id: I9c934432232bda02a4d26425587096fb6dc957b0
(cherry picked from commit f1532e36e16e2b55f175a24f11df91cf344833ff)
2017-04-03 14:11:23 +00:00
TreeHugger Robot
28119285e8 Merge "Revert "Layoutlib changes to support the new ResourceUrl"" into oc-dev 2017-04-01 05:31:05 +00:00
TreeHugger Robot
f9f1f1c1c3 Merge "Use variable fonts for Noto Sans Khmer" into oc-dev 2017-04-01 00:00:52 +00:00
TreeHugger Robot
2d161b1d3f Merge "Implement issue #36590595: Add ability to associated a ClipData with JobInfo" into oc-dev 2017-03-31 23:21:11 +00:00
Jungshik Shin
88b1114010 Use variable fonts for Noto Sans Khmer
Update fonts.xml to use NotoSansKhmer-VF.ttf.

The weight range of Khmer is also extended to have 9 weight instances
(three more than Roboto with 200, 600 and 800).

The width range for Khmer is left alone partly because of an apparent
lack of support in fonts.xml for non-normal width fallback fonts.

Note that Noto Sans Khmer UI is left alone because of a baseline issue.

BUG: 22667753
Test: See the QA instruction in comment 10 of the bug.
Test: fontchain_lint
Change-Id: Idf6d4fec86822663ac08feb8979edacbc6c709a0
2017-03-31 19:31:13 +00:00
Winson Chung
ac52f2892d Ensure we show the PiP menu in response to KEYCODE_WINDOW.
Bug: 36687605
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testWindowButtonEntersPip
Change-Id: I0bb35fd666eb6a438e4676267f6726b44bffb3db
2017-03-31 10:42:53 -07:00
Dianne Hackborn
a47223f99b Implement issue #36590595: Add ability to associated a ClipData with JobInfo
Yum!

Also needed to have a Context.revokeUriPermission() variant that is sane,
so reasonable CTS tests can be written.

Test: new ClipDataJobTest added.

Change-Id: Ia3135ea788a6e32c971bae7dab3a844d0ef4139c
2017-03-31 10:41:50 -07:00
Diego Perez
51b4387ae0 Revert "Layoutlib changes to support the new ResourceUrl"
This reverts commit 9fb4d6876a78fb336cb3650aca84bce723f96ecb.

Test: N/A
Change-Id: I57a09c6f011b8d8c9c2d054b03536e0a6fcc5688
(cherry picked from commit a4e82144b26ee50fca2739abc4f6c7111dc2f3cb)
2017-03-31 13:46:26 +00:00
Christopher Tate
08992ac57e API refactor: context.startForegroundService()
Rather than require an a-priori Notification be supplied in order to
start a service directly into the foreground state, we adopt a two-stage
compound operation for undertaking ongoing service work even from a
background execution state.  Context#startForegroundService() is not
subject to background restrictions, with the requirement that the
service formally enter the foreground state via startForeground() within
5 seconds.  If the service does not do so, it is stopped by the OS and
the app is blamed with a service ANR.

We also introduce a new flavor of PendingIntent that starts a service
into this two-stage "promises to call startForeground()" sequence, so
that deferred and second-party launches can take advantage of it.

Bug 36130212
Test: CTS

Change-Id: I96d6b23fcfc27d8fa606827b7d48a093611b2345
(cherry picked from commit 79047c62b58fb0a0ddf28e2b90fe4d17e05bc528)
2017-03-30 18:31:24 +00:00
Diego Perez
0677ce27b6 Fix fonts following 455f1bfc05
Test: Fixes broken tests
Change-Id: I62d001c6d0ed84fe1d1d9865b1027be0e1cad8b4
(cherry picked from commit de5a95d42c9e5f4fbcf0064ae8eaa33ab5747637)
2017-03-30 15:35:09 +00:00
TreeHugger Robot
261dd2305a Merge "Handle the case where no session exists" into oc-dev 2017-03-30 13:27:00 +00:00
Diego Perez
3134462c5e Merge "Make layoutlib more lenient with recoverable errors" into oc-dev 2017-03-30 13:12:39 +00:00
Diego Perez
a55b3ba642 Handle the case where no session exists
In some cases, if an error happens, no session will exist in
BridgeRenderSession.

Test: Added small regression test
Change-Id: Ic9be381767626766395c65044542c197ed7649e7
2017-03-30 12:21:07 +01:00
Diego Perez
d88c717b4e Make layoutlib more lenient with recoverable errors
In many cases, throwing an exception will stop the inflation or
rendering of a layout. Sometimes, we could recover from some of the
failures and render a layout that is "usable".
I've done a first pass trying to follow the following rules:
 - Try simple recoveries by choosing sensible defaults. Not trying
 complex recoveries.
 - Only recover if the exception is not part of the class behaviour.
 Avoided removing declared exceptions or exceptions that are expected by
 the framework.
 - I've kept assertions in place so, in most cases, the behaviour will
 be almost identical to the previous one with assertions enabled.

Test: Checked with existing tests
Change-Id: I0001fdd3c808cf405c4eb8d734b9bbe63493e05c
2017-03-30 12:07:28 +01:00
Adam Lesinski
c26ace0754 Merge "AAPT2: Parse an ID encoded as a map" into oc-dev 2017-03-30 00:31:01 +00:00
Adam Lesinski
b1afa07745 AAPT2: Allow arbitrary entry names with aapt2 optimize
Presumably, the apps build fine for the developers, so just
feed the existing names through without validation. Validation
still exists when building an app from source.

Bug: 36051854
Change-Id: Idc64ee91b08dce67d3c28f3c5284a7afa1312df1
Test: run aapt2 optimize on the apks from b/36051854 and build aapt2_tests
2017-03-29 20:56:32 +00:00
Adam Lesinski
33af6c730f AAPT2: Parse an ID encoded as a map
ID types should not be encoded as a map. AAPT and AAPT2 emit
IDs as boolean types.

Some apps exist that for some reason have their ID types encoded
as empty maps. This is the case only for the auto generated IDs
from enum values in <attr> tags.

Allow IDs as maps and ignore their content when processing an APK
for optimizing.

Also fixes an issue with expected size of the ResTable_package struct.

Bug: 35861796
Test: tested against the APK in b/35861796
Change-Id: I29a19cd9777bb10bed6766cd42e35e50e098797b
2017-03-29 20:11:04 +00:00
Diego Perez
31f7d6f535 Add audio service support to BridgeContext
Bug: http://b.android.com/259326
Test: N/A
Change-Id: Ie43ccca49a5e77d82426b4f265e3c05dddfacad9
2017-03-29 12:03:58 +01:00
Chad Brubaker
336ae5b616 Add ACTION_EPHEMERAL_RESOLVER_SETTINGS
This Intent will be used in Settings to show the settings UI for the
Ephemeral resolver. Settings can get the correct component to send the
Intent to by calling
PackageManager.getInstantAppResolverSettingsComponent

Bug: 35918998
Test: Boots
Change-Id: I0edcf85704f2c19e0ee27f91b6ef057d52e32778
(cherry picked from commit aa49cb86e6d5f23d82c97db32c848bc4ea2b81bc)
2017-03-28 20:34:55 +00:00
Adam Lesinski
cf1f1d9128 AAPT: Version <adaptive-icon> to v26
Bug: 35908647
Test: manual
Change-Id: Ic8f43efe34385192fbab18675eb5898ed80912a5
2017-03-28 19:16:11 +00:00
TreeHugger Robot
48a153e570 Merge "Fix font golden image using Oracle JDK" 2017-03-27 15:57:21 +00:00
Diego Perez
06ed84f7b3 Merge "Handle case where canvas is 0x0 for shadows" 2017-03-27 14:28:56 +00:00
Diego Perez
25cbb6c009 Fix font golden image using Oracle JDK
Test: Fixes test
Change-Id: Ie90d55ee73d6342524ba2b8b267d190cb5218fc8
2017-03-27 14:20:31 +01:00
TreeHugger Robot
42a872ac4a Merge "Updating font test after the TextView fix" 2017-03-27 11:13:01 +00:00
TreeHugger Robot
27a01ef063 Merge "AAPT2: Fix up file IO" 2017-03-24 22:04:59 +00:00
Diego Perez
ef74ede008 Handle case where canvas is 0x0 for shadows
Test: N/A
Change-Id: Ie837fb4097d7e1e47e8f96c73bb79ac8e7772a6b
2017-03-24 19:06:05 +00:00
Diego Perez
f170175402 Updating font test after the TextView fix
Test: Updated
Change-Id: Ia427cc25936b7a6aed035a4068d53151c74e839d
2017-03-24 14:55:38 +00:00
Diego Perez
d7437d649e Dispose font cache on bridge.dispose
Test: N/A
Change-Id: I81404740835814a018bfd70cf70b5c22933f19f5
2017-03-24 11:10:38 +00:00
Diego Perez
b4e6b5a719 Merge "Layoutlib changes to support the new ResourceUrl" 2017-03-23 10:06:44 +00:00
Jerome Gaillard
7628101938 Merge "Update FontFamily_Delegate following Change Ia23ee6a7" 2017-03-22 18:55:11 +00:00
Tenghui Zhu
b6cee106ed Merge "disable versioning for objectAnimator to support path motion" 2017-03-22 17:34:30 +00:00
Jerome Gaillard
f7a594358e Update FontFamily_Delegate following Change Ia23ee6a7
Test: layoutlib tests
Change-Id: I8815060f9bab65f913a0272e439f6c86a63acbcf
2017-03-22 16:55:04 +00:00
Diego Perez
9fb4d6876a Layoutlib changes to support the new ResourceUrl
Updates the resource handling after the changes to the ResourceUrl API
changes.

Test: Existing tests should pass
Change-Id: I314a20673cf94e4ef27e9712d3fa7b6f69bba796
2017-03-22 14:16:53 +00:00
ztenghui
205548561c disable versioning for objectAnimator to support path motion
bug:33527757

Test: replace the AAPT in local SDK, and make sure the propertyX/YName
still works within ObjectAnimator.

Change-Id: Ic9bb14cd228dcf7e4d250bd0f6cb5f0c31a14183
2017-03-21 16:44:00 -07:00
Diego Perez
ba152c09d3 Fix build following change 0763650
Test: N/A
Change-Id: Ie376cb34f0a6ea1f33fab3871abb9db43c5fcf62
2017-03-21 11:48:46 +00:00
Guang Zhu
d5da694f83 Merge "Revert "AAPT: Version <adaptive-icon> to v26"" 2017-03-21 05:09:26 +00:00
Adam Lesinski
1f4497c9c0 Merge changes I8c710af6,Iedf30212
* changes:
  libandroidfw: Fix mass logspam of ResourceTypes warnings
  NativeActivity JNI: Retain VM reference to AssetManager
2017-03-21 03:54:16 +00:00
Guang Zhu
8c2df71739 Revert "AAPT: Version <adaptive-icon> to v26"
Bug: 36462965
Bug: 35908647

This reverts commit c7614e5d1e8f9139cccf6ab9b78dda16b98f7656.

Change-Id: I25279e7c53823dad0703c7e2ea8ff91bdbc1a0f2
2017-03-21 03:53:43 +00:00
Adam Lesinski
03b0a277e8 Merge "AAPT: Version <adaptive-icon> to v26" 2017-03-21 00:15:31 +00:00
Adam Lesinski
06460ef0d7 AAPT2: Fix up file IO
This also enables an AAPT behavior that CTS tests have
come to depend on.

Small files that compress negatively (get larger) are stored
uncompressed. Some CTS tests assume this and try to open these
files by mmapping them, which is only possible if they are
uncompressed.

Bug: 35461578
Test: make aapt2_tests
Change-Id: Id622a6150fe72477ad65d67d1bad897a8ee2ffb9
2017-03-20 16:53:46 -07:00
Adam Lesinski
ed69ce84bd libandroidfw: Fix mass logspam of ResourceTypes warnings
An overlay was incorrectly leaking its own resources into the
framework resource package, which caused warnings for every app
that tried to access framework resources (all of them).

This change skips including any resources that are not overlaying
anything (not present in IDMAP).

Bug: 36256974
Test: make libandroidfw_tests
Change-Id: I8c710af6849bb848938825aacca02799ee96c003
2017-03-20 14:51:13 -07:00
Roozbeh Pournader
6099e75df2 Merge "Read emoji addtions from data file" 2017-03-20 02:59:25 +00:00
Charlie Tsai
3ccd67dc9c Merge "Replace rectangle shadow algorithm" 2017-03-19 01:18:39 +00:00
Charlie Tsai
e18bf49be6 Replace rectangle shadow algorithm
Test: Rectangle Shadow test
Change-Id: Id9635df8769e85d835dc6f99201b86e5bba110d2
2017-03-18 21:34:00 +00:00
Roozbeh Pournader
1800ba4ffe Read emoji addtions from data file
We now read the emoji additions from a data file, instead of keeping
them in code.

Test: updated lint script passes.
Change-Id: Ica1ca10eaba0ca2b4a178d08354e31729cb88ce5
2017-03-17 18:28:16 -07:00
Adam Lesinski
10eb1455b9 Merge changes from topic 'configForSplit'
* changes:
  libandroidfw: Search all packages for an identifier
  AAPT2: Finish support for feature splits
  Add support for configForSplit
2017-03-17 23:19:13 +00:00
TreeHugger Robot
935cd789f2 Merge "Update fontchain_lint.py to read Emoji 5.0 data" 2017-03-17 22:49:22 +00:00
Diego Perez
37ecda0eba Merge "Fix BitmapShader to work with adaptive icons" 2017-03-17 18:01:30 +00:00
Jerome Gaillard
3ce947f482 Merge "Update ColorFilter_Delegate following Change I5f74addd" 2017-03-17 16:29:36 +00:00
Andrii Kulian
c1b59ed73e Merge "Separate global and override config sent to client" 2017-03-17 15:39:37 +00:00