2659 Commits

Author SHA1 Message Date
Chad Brubaker
0d277a7b18 Change ANDROID_ID for Instant Apps
ANDROID_ID for Instant Apps now has the following properties:
1) per-app scoped
2) reset if the user clears the Instant App
3) remains the same if the Instant App gets upgraded to an installed
app.

Note that if the user goes instant -> installed_1 -> uninstall ->
installed_2 the ANDROID_ID at installed_1 will not be the same as
installed_2. This was deemed better than the id changing on the upgrade
step.

Test: manual
Change-Id: I532975c50049c94ff80902a897e001dd35a69f9f
2017-04-19 11:10:53 -07:00
Christopher Tate
242ba3e997 Turn down the preliminary foreground service API
The NotificationManager.startServiceInForeground() experiment is over,
and will not ship as API, so it's time to tidy up and get rid of it.

Bug 36130212
Test: manual

Change-Id: I834d1ce059aa464ff27f69f5e5d3625cc5e61d8a
2017-04-17 14:22:18 -07:00
Todd Kennedy
801e65905b expose the instant app installer component
Bug: 35873804
Test: TreeHugger
Change-Id: I4d962927587bb10833bfe3c3db27fdceab668fc3
2017-04-14 09:49:13 -07:00
Seigo Nonaka
1e924df63e Merge "Update Typeface.Builder API to reflect API feedback." into oc-dev 2017-04-12 19:39:50 +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
Colin Cross
c12fde4f25 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.

Bug: 36902714
Test: layoutlib-tests
Change-Id: I522d9e3786ad7deeb291c7c1a61ec4b86be03dc2
(cherry picked from commit 15d18782065c05d6566841da43ce311e5000eddd)
2017-04-11 10:02:54 -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
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
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
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
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
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
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
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
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
Diego Perez
f4291b03cc Fix BitmapShader to work with adaptive icons
Test: Existing test should pass
Change-Id: Ie4c78eab4dfacf1eb6060d71edb98b836c4eff78
2017-03-17 15:09:00 +00:00
Jerome Gaillard
5aa62827ca Update ColorFilter_Delegate following Change I5f74addd
Test: layoutlib tests
Change-Id: Ifb18946edb0c40e0120868e211c99a304801e740
2017-03-17 12:15:36 +00:00
Andrii Kulian
446079600e Separate global and override config sent to client
There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
2017-03-16 19:13:02 -07:00
Jerome Gaillard
95f36e23c3 Update layoutlib following Changes I2500bd4c and If456266f
Test: layoutlib tests
Change-Id: Idd3993bdc4010fa80a8c78ad80998bc7586322a5
2017-03-16 12:42:37 +00:00
Rob Carr
287452cf40 Merge "Delete some SurfaceView support code." 2017-03-16 05:07:10 +00:00
Robert Carr
d0a2cd3061 Delete some SurfaceView support code.
repositionChild, performDeferredDestroy, and SurfaceControl with
background were all only used by SurfaceView and are now no longer
required in the wm.

Test: Only red.
Change-Id: Icb773572e6d6202f78a6d23b2431fbfacbe272c6
2017-03-15 14:40:20 -07:00
TreeHugger Robot
5fff20cac1 Merge "Clean up public FontConfig APIs" 2017-03-15 18:52:04 +00:00
Seigo Nonaka
ac873c9f25 Clean up public FontConfig APIs
This CL contains following clean up:

- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.

Test: ran android.content.res.FontResourcesParserTest

Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
2017-03-15 10:16:55 -07:00
TreeHugger Robot
be4cf58436 Merge "Add API to mark apps that have an update available" 2017-03-15 17:04:22 +00:00
Todd Kennedy
ab53289c59 Add API to mark apps that have an update available
Ostensibly for instant apps, we allow play to mark an app as having
an update available. This will trigger instant app resolution even
if the instant app is already installed on device.

Bug: 35143464
Test: Manual; launch URI of installed instant app, see it runs w/o resolution. set bit. launch URI of installed instant app, see it runs resolution
Change-Id: I511df2b2a3eab39377167c770255ccbe02d5dad2
2017-03-15 07:31:09 -07:00
Diego Perez
e49ba39172 Workaround for broken BitmapShader in AdaptiveIconDrawable
This removes the need of using BitmapShader while we debug the problem
in layoutlib.

Bug: 36204957
Test: Added new test for adaptive icons
Change-Id: I4ff9968b996a1563be8caa0873e7aec8fb5cb151
2017-03-14 14:45:36 +00:00
TreeHugger Robot
376c6471da Merge "Associate rotation watchers with displays" 2017-03-14 08:30:05 +00:00
Andrii Kulian
35fa3c26ad Associate rotation watchers with displays
Displays can be rotated separately and rotation watcher clients
are only interested in rotation of some specific display. This CL
adds displayId to rotation watchers and only informs them about
changes on their display.

Bug: 34242678
Test: Manual and debug.
Change-Id: If0f03804da0392c2b14a4e7c2d6a06068ad8760b
2017-03-13 18:27:24 -07:00
Eugene Susla
ef4351cc72 Dont dispatch a11y events that have no subscribers
This allows to avoid A11yManager -> A11yManagerService IPC, when there's no
subscribers to a given event

Test: steps:
  - Enable A11yManager.DEBUG
  - Navigate through a few random activities
  - In logcat, ensure log messages are present, notifying that certain events
  won't be dispatched
Change-Id: Ia019fb66053f10095b3651407d09de8e89cdd227
2017-03-13 17:51:04 -07:00