7547 Commits

Author SHA1 Message Date
Jakub Adamek
54dcaaba4f Change name of overlay subdir 'sku'->'theme'
The name 'sku' does not fit well as we recommend to use the same
value for different SKUs if vendors wish to have the same colors
on those SKUs.

Bug: 32268656
Change-Id: Ib5e5a3386676453dafeb13a6a6bf91f81bb48a11
2016-10-19 14:06:32 +01:00
Adam Lesinski
882f8168b0 Fix race with Asset destruction and printing allocation stats
am: 2582465bb4

Change-Id: I1dbb7609fa4d770e513e6f628e4c598600607383
2016-10-18 20:40:50 +00:00
Adam Lesinski
2582465bb4 Fix race with Asset destruction and printing allocation stats
A race could occur when printing the list of Asset allocations for
debugging purposes.

Each Asset object would insert themselves into a global linked list
on construction and remove themselves on destruction. Iterating the list
and the insertion/remove operations all acquire a global lock.

The race occurs after the Asset subclass destructor runs but before the Asset
base class destructor runs, which performs the actual removal from the list.

The vtable of the object being destroyed ends up pointing at the base Asset class'
vtable, and during the iteration of the global list, a pure virtual method is called
leading to an abort, since the wrong vtable is dereferenced.

This change moves the insertion/removal of the Asset object into the global list
to the concrete class, which adds some maintenance overhead but solves the problem.

Bug:31113965
Test: make libandroidfw_tests
Change-Id: I1a620897e5e04a8519ee247883bba0719b1fa6f3
(cherry picked from commit 0358efe4f76f42d9eea91600202a5ab0831d9cef)
2016-10-18 01:27:39 +00:00
Chris Craik
a6bfd8d12c Fix complex clipping on mergeable ops DO NOT MERGE
am: d183e0b988

Change-Id: Icb357a11cb8a4be473aa8b0acdb4d799973ff54a
2016-10-17 19:52:53 +00:00
Chris Craik
d183e0b988 Fix complex clipping on mergeable ops DO NOT MERGE
Fixes: 32106003

Change-Id: I519bc38a1fa8c25c9ae317ffdb7e59e5a0824f59
2016-10-17 10:51:11 -07:00
Martin Wallgren
dce79f10ba RRO: Synchronize access to overlays.list
am: 0fbb608110

Change-Id: I44a716df3954b6d2d58d7c9784f8b55cf041b10b
2016-10-12 21:03:11 +00:00
Doris Liu
c47199bb6a Fix SkShader leak for Gradient VectorDrawable and test
am: fc9cf72339

Change-Id: I493a8c52cd4cca79971a4fd2e3eed7f566ce8ecd
2016-10-12 20:56:55 +00:00
Adam Lesinski
baac85ec1f Merge "RRO: Synchronize access to overlays.list" into nyc-mr1-dev 2016-10-12 20:55:55 +00:00
Martin Wallgren
0fbb608110 RRO: Synchronize access to overlays.list
idmap --scan is executed as a part of the pre-loading in ZygoteInit.
The pre loading is executed in parallel for each supported architecture
(32/64 bit). This will cause a race condition in the creation of the
overlays.list file and the idmap files for the system overlays.

Apply flock on overlays.list to prevent the file from being thrown away
and recreated when it is in use by another Zygote.

Cherry-picked from AOSP.

Bug: 28032298
Test: manual
Change-Id: I51d39f121d207b11181340b68b164b60020f0c61
2016-10-12 14:56:31 +00:00
Doris Liu
fc9cf72339 Fix SkShader leak for Gradient VectorDrawable and test
This CL fixes a SkShader leak in VD when applying local matrix
to the shader. Specifically, the usage of newWithLocalMatrix(...)
increments the shader's ref count in every draw() call for
Gradient VectorDrawable, whereas there's no balancing call to
decrement the ref count in draw(). In this CL, we assume
the ownership of the shader returned from newWithLocalMatrix(...)
to ensure the correct ref count management.

Also, add test to verify that shader is no longer being leaked

BUG: 32067647
Test: this CL

Change-Id: Ic15fe46cde06a73d81b44e2d3c56b51907344cc0
2016-10-12 01:22:11 +00:00
sergeyv
4778f6a43e Turn off additional logging in text rendering
am: 5bb5626599

Change-Id: Ic7f6c59ca2c3a92f81bf55a8916e20d99fcc01a7
2016-10-11 00:43:32 +00:00
sergeyv
5bb5626599 Turn off additional logging in text rendering
Change-Id: If5f11489c05e320e4436fb57680857b29228a755
b:30427106
2016-10-10 12:25:06 -07:00
Doris Liu
4a1ea9ba7e Support calling start() in onAnimationFinished(...) in AVD
am: 679fe6ab6f

Change-Id: I2999f6fc543f56d73cd03fe74b466c033d6c7d1a
2016-10-08 23:52:20 +00:00
Doris Liu
679fe6ab6f Support calling start() in onAnimationFinished(...) in AVD
This CL fixed an issue where calling start() from onAnimationFinished()
caused AnimationListenerBridge::onAnimationFinished(...) to be unsafely
re-entered and the new start listener was (incorrectly) reset to null.

BUG: 31971397
Test: test apk in the bug linked above
Change-Id: Ica809ef2dab884950b93b54f2d0cb4b81e9830f1
2016-10-08 21:00:14 +00:00
Teng-Hui Zhu
9ad599930d Make umbra lighter when the blocker is too high and has no real umbra area.
am: 9c555566bf

Change-Id: I785f5a25aae97f8852bb1cc4833f2662411eabc3
2016-10-06 21:06:36 +00:00
songjinshi
09901f3bc9 Fix thread race caused double free issue.
am: 5754b41c20

Change-Id: Ic9dd6e9c6d216753d997da99158816682d5464d1
2016-10-06 20:13:00 +00:00
Teng-Hui Zhu
9c555566bf Make umbra lighter when the blocker is too high and has no real umbra area.
b/31939390
Test: CTS testShadowLayout && Manual FrameworkShadow test

Change-Id: Ib0b6c4239ac8a521a827be246e912daf2ad3b885
2016-10-04 17:26:09 -07:00
songjinshi
5754b41c20 Fix thread race caused double free issue.
The SharedZip's Asset is not thread-safety,the getResourceTableAsset()
and setResourceTableAsset(Asset* asset) function of the SharedZip is
not sync with a same lock.

Consider the following sequence of events:
Thread A calls setResourceTableAsset(Asset* asset),it will set
mResourceTableAsset = asset; then to calls getBuffer() of the asset.
Thread B calls getResourceTableAsset(),which return mResourceTableAsset,
then to calls getBuffer() of the mResourceTableAsset,the asset and
mResourceTableAsset is same one object.
Thread A to delete mZipInflater in getBuffer().
Thread B to delete mZipInflater in getBuffer().

It will cause crash becuase double delete mZipInflater in getBuffer().

https://code.google.com/p/android/issues/detail?id=211941

Bug:31734545
Change-Id: I5a7d67fdf64c4aa03f505b37a2fa840f4443d158
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
2016-10-03 20:13:12 +00:00
Jakub Adamek
c03d9483f0 Change name of overlay subdir property to sku.
Also move the SKU subdirectories directly under /vendor/overlay.

Bug: 31692079
Change-Id: I68c712b13918cc99629534580ee4f77d9e5b3823
2016-10-03 10:14:12 +01:00
Jakub Adamek
1c15c63578 Search for runtime resource overlays in subdir.
See go/sku-colors. This changes the directory to search for framework
overlays if the right system property is defined. This allows
OEMs to specify different resources based on device SKUs.

Bug: 31692079
Change-Id: I9cb121b286b7f52aa26de1757fde1f3110cd47fd
2016-09-28 10:09:20 +01:00
Yuqian Li
83427ff222 Ignore HasAlphaLayer flag to fix b/30929229
BUG:30929229
Change-Id: Iebadc6b3d224efa0554cbbb99ea43f871c28722b
2016-09-14 11:44:10 -04:00
Sergei Vasilinetc
e3a9785386 Merge changes Ic26b25e7,I653571d6 into nyc-mr1-dev
* changes:
  HWUI: track upload & recent usage in font cache
  HWUI: calculate used memory in FontCache for gfxinfo
2016-09-13 01:41:12 +00:00
sergeyv
af102bee51 HWUI: track upload & recent usage in font cache
FontCacheHistoryTracker should be turned off before shipping: b/31438876

bug:30427106
Change-Id: Ic26b25e790d4ee69e484ca0cb23dc9cc522b2ed3
2016-09-12 15:45:26 -07:00
TreeHugger Robot
c1c0421f67 Merge "Hold a weak reference to PointerController when handling vsync" into nyc-mr1-dev 2016-09-09 19:28:10 +00:00
Vladislav Kaznacheev
33c5903e77 Hold a weak reference to PointerController when handling vsync
Currently PointerController starts listening to display events
immediately (in its constructor) and never explicitly removes
the callback. The reference dangling from the looper
prevents the PointerController instance from being deleted
when all the clients have released their references.

As a result, when USB or BT mouse is disconnected,
the mouse stays frozen on screen and only goes away
after a 15 sec inactivity timeout.

This change introduces an intermediary LooperCallback
which holds only a weak reference to PointerController.
The pointer now disappears immediately upon mouse
disconnect.

Bug: 30824220
Change-Id: I5f7208dbfa381b3e21f248cc0da402f307faa184
2016-09-09 10:03:31 -07:00
sergeyv
baf29e7cf4 HWUI: calculate used memory in FontCache for gfxinfo
bug:30427106
Change-Id: I653571d6a4e974e975fb0dc03fc2364eecbf2f84
2016-09-08 14:50:50 -07:00
John Reck
02913603bd Merge "Fix EGLImage memory leak" into nyc-mr1-dev 2016-09-02 15:07:25 +00:00
John Reck
f8b0360298 Fix EGLImage memory leak
Bug: 31247709
Change-Id: I9e36206b0d7bdb75b84cd53b70f7746ca34a3469
2016-09-01 14:10:20 -07:00
Chris Craik
06e2e9cf4c Wait on frame work fences when frames are dropped
bug:30895941

Prevents a race where frame work could interleave between frames,
causing SurfaceView position updates to be delivered out of order.

Change-Id: I01e4cc557b69dcf33e877a0e16c0d115ec95e4cc
2016-08-31 17:32:47 -07:00
John Reck
cd68212f08 Make updateSurface non-blocking
Bug: 30442298

We already do this for initialize(), fix
it so that update() is parallel with the
UI thread as well.

Shaves ~7ms off of the 99th percentile on
NotificationShade open & close

Change-Id: I1791df495453fb9e1e12362c68e3d20e837e62be
2016-08-09 12:11:13 -07:00
Chris Craik
a9bef43149 Merge "Prevent EndLayerOps when Begin was rejected" into nyc-mr1-dev 2016-08-08 23:44:08 +00:00
Chris Craik
3c53ec51ef Prevent EndLayerOps when Begin was rejected
bug:30537130

BeginLayerOps were being rejected in a way that allowed the associated
EndLayerOps to still be recorded. This was a violation of DisplayList
content expectations, and caused crashes in FrameBuilder when trying to
play these DisplayLists back.

Change-Id: I531b840aa5c4ffb1ee458da3f4b366978eaeafbe
2016-08-08 15:15:58 -07:00
Doris Liu
18e08a0170 Fix infinite AVD not running
This CL fixed an integer overflow error caused by using integer literal
when it should be a float literal that defines a double.

BUG:30739855
Change-Id: If2bdb0eb7a2e93d28434bfe72ec11e8f1f2a1eda
2016-08-08 19:57:34 +00:00
John Reck
295d81c360 Merge "Ensure Dequeue/Queue duration is always set" into nyc-mr1-dev 2016-08-08 14:52:05 +00:00
Doris Liu
7ae119ebff Merge "Remove animation value change from push staging" into nyc-mr1-dev 2016-08-06 01:07:15 +00:00
John Reck
70e89c9c37 Ensure Dequeue/Queue duration is always set
Bug: 30662749
Change-Id: I35a4c26ce78536fc7a506ec2f92a8b9eecb12ec2
2016-08-05 10:50:36 -07:00
Doris Liu
f7167e8f28 Support repeatMode = reverse in AVD
BUG: 30641232
Change-Id: I34c823a0a45c8441873a9b467275174c5529994b
2016-08-05 01:44:20 +00:00
Doris Liu
6725d581eb Remove animation value change from push staging
This CL ensures that animation values are only updated during
animation pulses.

This CL also includes the revert of
https://googleplex-android-review.git.corp.google.com/#/c/1285913/

BUG: 30659748

Change-Id: Iadc84462dc61157efd3c18a23767bba9faf00f6e
2016-08-04 22:43:07 +00:00
John Reck
d58230c7f7 Fix RNA crash
Bug: 30632377
Change-Id: I5d53fba0f469553ae90bebad1482ef28965dd853
2016-08-03 10:28:10 -07:00
Doris Liu
a3c35852a1 Merge "Ensure layer update include the dirty rect from AVD" into nyc-mr1-dev 2016-08-02 20:36:20 +00:00
Doris Liu
0cf4d47a40 Merge "Put VD animators on paused list when RT stops drawing" into nyc-mr1-dev 2016-08-02 18:08:05 +00:00
John Reck
65ddb154c7 Fix FrameMetricsObserver crash
Bug: 30587465

Someday maybe the technology will exist to
allow sharing a simple constant between
Java and C++, but today is not that day.

Change-Id: I17694746cb8712058133cd5ea10c47b9909f740b
2016-08-02 09:38:26 -07:00
Doris Liu
b51b2864e8 Ensure layer update include the dirty rect from AVD
BUG: 30166063
Change-Id: Ia14a2fe3c653e0172a28b4ef22f5171ccf7390c1
2016-08-02 03:01:48 +00:00
TreeHugger Robot
e733f862f0 Merge "Eliminate recents upload jank" into nyc-mr1-dev 2016-08-02 01:07:19 +00:00
John Reck
4387190d8e Eliminate recents upload jank
Bug: 30342017

Upload recents thumbnails in the
dead gaps between frames instead of
at the start of a frame. This eliminates
jank caused by the large texture
upload.

Change-Id: I507cd286d199109c7a9a1511d68ba5ab5d28069f
2016-08-01 16:36:14 -07:00
John Reck
882d515cd5 Fix null deref crash
Bug: 30560152
Change-Id: Ic4bae380e27de5bea80cec484e83d205e078ec43
2016-08-01 14:52:25 -07:00
Doris Liu
c82e879e56 Put VD animators on paused list when RT stops drawing
When we stop scheduling for new frames on RenderThread, we should
put the running animations on pause, rather than purge the list
of the running animations, such that in the next full
sync, the animations that were paused will continue to run.

BUG: 30226711
Change-Id: I36ff6f5d26ffa7999f60ca0ff676a35157577dc2
2016-08-01 21:42:15 +00:00
TreeHugger Robot
34921ac110 Merge "Teach JankTracker about new swap behaviors" into nyc-mr1-dev 2016-07-29 16:25:51 +00:00
John Reck
2d5b8d7392 Teach JankTracker about new swap behaviors
Bug: 30440166

If we are using HWC2, there's a change in timing
when in triple buffering with the pipelined offsets.
This changes JankTracker to recognize that and silently
erase that from the total duration

Change-Id: Ib1fd4209070f17dbd2baed707c8cf73fb11c3cf2
2016-07-29 07:56:02 -07:00
John Reck
abf66de147 Merge "Drop less aggressively" into nyc-mr1-dev 2016-07-28 19:59:13 +00:00