5334 Commits

Author SHA1 Message Date
Fabrice de Gans-Riberi
c8fcac116b Merge "AAPT2: expose return values through JNI." into oc-dev
am: 3f1febbedb

Change-Id: I2d145aaeb975dfa6abc34f1d5c4e0e9a5708a8b4
2017-04-11 20:11:40 +00:00
Fabrice de Gans-Riberi
3f1febbedb Merge "AAPT2: expose return values through JNI." into oc-dev 2017-04-11 19:56:19 +00:00
Roozbeh Pournader
028312c74c Merge "Update fontchain_lint to test new emoji font" into oc-dev
am: f72b0eec6e

Change-Id: Ie4e8d0621e8b5d133248f457c3a734ef035d7b80
2017-04-11 17:55:45 +00:00
Roozbeh Pournader
f72b0eec6e Merge "Update fontchain_lint to test new emoji font" into oc-dev 2017-04-11 17:24:32 +00:00
Chris Warrington
014d315653 AAPT2: expose return values through JNI.
Test: Tests for JNI in the studio-master-dev branch.
Change-Id: I709595aabf31c9c2fea659c7af20a5c50d1e3d34
2017-04-11 09:21:29 +00:00
Adam Lesinski
c9b051fc18 Merge "AAPT2: Share split functionality between link and optimize" into oc-dev
am: 3750fd24c6

Change-Id: I336963f7e70fb77522d8f478b8c0a831e938d9f1
2017-04-10 23:28:58 +00:00
Roozbeh Pournader
aa3ee8e079 Update fontchain_lint to test new emoji font
The new emoji font has been update to Unicode 10/Emoji 5, and has a
new mechanism for flag fallbacks. It also shares glyphs between
gendered emoji and non-genders ones.

Test: make fontchain_lint passes
Bug: 34688862
Bug: 33276970
Bug: 34738377
Change-Id: I4d43b8c777deb93be1e6a784eaa109e2e7febd7d
2017-04-10 13:52:20 -07:00
Adam Lesinski
d0f492db03 AAPT2: Share split functionality between link and optimize
Generating splits should be possible to do from the optimize command.
This means that a lot of infrastructure around split APKs can be
shared by both the optimize and link phase.

Bug: 35925830
Change-Id: Ia88b9e4bff300a56353b2f7a4a2547c8eb43a299
Test: manual
2017-04-10 11:59:18 -07:00
Mihai Nita
ab13d9f9b3 Merge "AAPT2: fixing the -c flag being ignored" into oc-dev
am: 7354ee76aa

Change-Id: Iec7350226e00bca1acf7e24bbf447f95c53b5c51
2017-04-07 22:08:21 +00:00
Mihai Nita
f4dacf29cc AAPT2: fixing the -c flag being ignored
Bug: 36999175
Test: manual

Change-Id: Id9a4a00a3b37bc088d86df7c75bbe711536b980f
2017-04-07 09:27:03 -07:00
Roozbeh Pournader
5ba27c46bb Merge "Use additions/emoji-data.txt instead of hardcoded values" into oc-dev
am: 43fed9afe4

Change-Id: I3c077353adf8040118b0610248848fe3d552a70e
2017-04-06 21:20:03 +00:00
Roozbeh Pournader
43fed9afe4 Merge "Use additions/emoji-data.txt instead of hardcoded values" into oc-dev 2017-04-06 21:13:28 +00:00
Colin Cross
8a7b3ce32a Merge "Update layoutlib to match java library changes" am: ac6414524c am: 72ae1a8958
am: a989576027

Change-Id: Ib1317327abce727809750ff9a82882e27ce24c66
2017-04-06 15:53:37 +00:00
Colin Cross
ac6414524c Merge "Update layoutlib to match java library changes" 2017-04-06 15:30:45 +00:00
TreeHugger Robot
448727bdae Merge "AAPT2: Fix pseudolocalization (again)" into oc-dev 2017-04-05 20:43:23 +00:00
Roozbeh Pournader
f7a68c10c7 Use additions/emoji-data.txt instead of hardcoded values
Previously, characters for which Android defaulted to emoji were
hardcoded in the script. Now they are read from a data file.

Test: make checkbuild passes
Bug: 36536216
Change-Id: I99eeadf89a29b8a3336263dd68520433765ed5e2
2017-04-05 09:22:42 -07:00
TreeHugger Robot
7a7e415967 Merge "AAPT2: Allow multiple -c flags" into oc-dev 2017-04-04 19:14:47 +00:00
Adam Lesinski
113ee09738 AAPT2: Allow multiple -c flags
AAPT allows multiple -c flags in addition to separating -c arguments
with commas.

Bug: 35671619
Test: manual
Change-Id: I90491968e8ea2b28e3cd6e9246bcdd62bd6d6a3c
2017-04-03 19:38:25 -07:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
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
Adam Lesinski
8049f3da71 AAPT2: Fix pseudolocalization (again)
Pseudolocalization didn't properly handle spans in
strings like "<small><small>Hello</small></small>".

The spans would be identical and when doing range checks
only one of them would be updated.

Switched to a more robust way of extracting the relevant
chunks of a styled string. This uses a stack, which is more
in line with the real representation in XML.

Bug: 34088357
Test: make aapt2_tests
Change-Id: Ia4e4501713e688c96a89e26e4e2b1384f4cd3889
2017-03-31 18:30:20 -07: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
Colin Cross
15d1878206 Update layoutlib to match java library changes
javalib.jar is now only used for jars that contain dex files, so
host java libraries are now always called classes.jar.  Update
layoutlib's custom rules to match.  Also remove built_ext_data,
the classes.jar in built_ext_classes already contains the
resources.

Test: layoutlib-tests
Change-Id: I522d9e3786ad7deeb291c7c1a61ec4b86be03dc2
2017-03-29 16:52:16 -07: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