5386 Commits

Author SHA1 Message Date
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
Jungshik Shin
a36e869191 Merge "Use variable fonts for Noto Sans Khmer" into oc-dev am: f9f1f1c1c3
am: 0a25996c22

Change-Id: Icf3d95ae5763fe51913e98a91d5cf40840f08d4e
2017-04-01 00:18:13 +00:00
TreeHugger Robot
f9f1f1c1c3 Merge "Use variable fonts for Noto Sans Khmer" into oc-dev 2017-04-01 00:00:52 +00:00
Dianne Hackborn
cc88ddd7ea Merge "Implement issue #36590595: Add ability to associated a ClipData with JobInfo" into oc-dev am: 2d161b1d3f
am: 666fe849e3

Change-Id: I61afc96a01bc8bc5d637d65a3f9a84452babd3ed
2017-03-31 23:44:42 +00:00
Winson Chung
c0e2621910 Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev am: 2af994ec03
am: da7ef8060d

Change-Id: I715e2e79b729d28b856a8eda42b099db56cb0184
2017-03-31 23:27:58 +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
Chris Tate
a94c58642f Merge "API refactor: context.startForegroundService()" 2017-03-30 18:24:53 +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
Diego Perez
1a67992704 Merge "Handle the case where no session exists" into oc-dev am: 261dd2305a
am: cd190037af

Change-Id: Ic5271f342f90b5b4d5057bffe38def7a4a107b96
2017-03-30 13:34:57 +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
0d895396f2 Merge "Make layoutlib more lenient with recoverable errors" into oc-dev am: 3134462c5e
am: 510916c13f

Change-Id: I3c02fde71a2fc7b955b9ad124fe81eccf5a983a3
2017-03-30 13:21:51 +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
93e8fa3fdc Merge "AAPT2: Parse an ID encoded as a map" into oc-dev am: c26ace0754
am: 719349cdb3

Change-Id: Icab08b15c92a8b88b7348e0caf61dba2f025de1b
2017-03-30 00:41:25 +00:00
Adam Lesinski
a68551d796 Merge "AAPT2: Allow arbitrary entry names with aapt2 optimize" into oc-dev am: 86cb762ae6
am: 78b5fad19e

Change-Id: Id2bef485de9c4bf90e12846cc80a32da109cd26d
2017-03-30 00:40:28 +00: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
Christopher Tate
79047c62b5 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
2017-03-29 13:12:09 -07: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
fd79fd36a8 Merge "Add kotlinc.xml to gitignore" 2017-03-29 16:21:42 +00:00
TreeHugger Robot
19f710b8a2 Merge "Fix warnings in Bridge" 2017-03-29 15:22:46 +00:00
Diego Perez
61adef11f8 Add kotlinc.xml to gitignore
Test: N/A
Change-Id: Id9b6b81b113a253b843281bbf1240006183e592e
2017-03-29 14:47:22 +01:00
Diego Perez
ab53e46aae Fix warnings in Bridge
Test: N/A
Change-Id: I7ce6c1d78ad02c410eb3c01f29f95aaf9e2417e4
2017-03-29 14:41:18 +01:00
Diego Perez
d3549d5c87 Merge "Add audio service support to BridgeContext" into oc-dev am: 92b3242827
am: c95297654f

Change-Id: Ic9359116c9746565fdecf8b542b22647ea1044b8
2017-03-29 13:35:49 +00:00
Diego Perez
de5a95d42c Fix fonts following 455f1bfc05
Test: Fixes broken tests
Change-Id: I62d001c6d0ed84fe1d1d9865b1027be0e1cad8b4
2017-03-29 12:29:58 +01: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
Chad Brubaker
22a5cf6d9b Merge "Add ACTION_EPHEMERAL_RESOLVER_SETTINGS" 2017-03-28 20:33:35 +00:00
Adam Lesinski
0ec88b0f1f AAPT: Version <adaptive-icon> to v26 am: cf1f1d9128
am: 990b98197e

Change-Id: I99d1c7014553568184b8a61b2f22c317d0469934
2017-03-28 19:37:35 +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
Chad Brubaker
aa49cb86e6 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
2017-03-28 10:25:36 -07:00
TreeHugger Robot
3561b414e3 Merge "Revert "Layoutlib changes to support the new ResourceUrl"" 2017-03-28 12:21:18 +00:00
Diego Perez
e1024bc3f9 Merge "Fix broken perf tests" 2017-03-28 08:48:42 +00:00
TreeHugger Robot
48a153e570 Merge "Fix font golden image using Oracle JDK" 2017-03-27 15:57:21 +00:00
Diego Perez
f1532e36e1 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
2017-03-27 16:49:17 +01: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
a4e82144b2 Revert "Layoutlib changes to support the new ResourceUrl"
This reverts commit 9fb4d6876a78fb336cb3650aca84bce723f96ecb.

Test: N/A
Change-Id: I57a09c6f011b8d8c9c2d054b03536e0a6fcc5688
2017-03-24 11:27:05 +00:00