2345 Commits

Author SHA1 Message Date
Seigo Nonaka
ecc3afd49a Merge "Update Typeface.Builder API to reflect API feedback." into oc-dev am: 1e924df63e
am: fa4b862518

Change-Id: I0aa32f46d20a5d46454f2a6057db2ca0e70f1d84
2017-04-12 21:37:09 +00:00
Seigo Nonaka
5421e81023 Update Typeface.Builder API to reflect API feedback.
- Stop pooling and remove reset method.
- Introduce overloaded constructors instead of setSource methods.
- Make italic parameter boolean and treat "not called" as
  RESOLVE_BY_FONT_TABLE.
- Remove constants and move them to Typeface with private static
  constant.
- Fix JavaDoc.

Bug: 37082657
Test: android.graphics.cts.TypefaceTest passed
Change-Id: I0c50cf3e2d50c0021f7e12bbb7ed7ae89fa1c2a1
2017-04-12 07:12:41 -07:00
Jerome Gaillard
eadac86670 Merge "Update Bitmap_Delegate following Change I0092fe44" 2017-04-10 18:43:10 +00:00
Jerome Gaillard
04b4f89d9d Update Bitmap_Delegate following Change I0092fe44
Test: Layoutlib tests
Change-Id: I3b1cfb460a6b7ccd6b63bd53194383154a68591c
2017-04-10 17:07:49 +01:00
Diego Perez
0c06555dca Inline some of the files into the tests
Modify LayoutPullParser construction to make clear what the different
constructors do and create a new one to build a parser just from a
String. By using this constructor, the CL inlines some of the smaller
files into the test for easier reading and maintenance.

Test: Modifies existing tests
Change-Id: Ieb20dcad4f62dc09252d01841bff37cf2c3c4a10
2017-04-10 15:00:43 +00:00
Seigo Nonaka
c802751704 Merge "Reorganize font enumeration API." into oc-dev am: 2ac9698271
am: de5fa6b3d8

Change-Id: I72a02f3f681b3b5f82cffc317fe0668e842464fe
2017-04-04 17:04:40 +00:00
Charlie Tsai
f7fe5a7ff8 Fixed Intent parsing error of PreferenceScreen
When PreferenceScreen contains the Intent tag with
the extra tag, the parsing of xml file is failed and
causes the render problem on Layout editor.

Test: N/A
Bug: http://b.android.com/233302

Change-Id: I987de7aa125299d46fc1b7670f07f3dd4427ee21
2017-04-04 02:15:38 +01: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
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
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
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
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
TreeHugger Robot
19f710b8a2 Merge "Fix warnings in Bridge" 2017-03-29 15:22:46 +00: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
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
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
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
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
Diego Perez
ba152c09d3 Fix build following change 0763650
Test: N/A
Change-Id: Ie376cb34f0a6ea1f33fab3871abb9db43c5fcf62
2017-03-21 11:48:46 +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