7813 Commits

Author SHA1 Message Date
Jakub Adamek
6bbb63ad91 Change name of overlay subdir 'sku'->'theme'
am: 54dcaaba4f

Change-Id: I4536de644c20171e175cddaff0cd041fb05b3038
2016-10-21 07:05:17 +00:00
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
08a870cd6d Fix race with Asset destruction and printing allocation stats am: 2582465bb4
am: 882f8168b0

Change-Id: I613fabdaad38be88ff9c4527e100e33a87f9d601
2016-10-18 20:53:59 +00: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
George Burgess IV
e76253055c Merge "Fix static analyzer warnings." am: ff5c3ad08b
am: 1db1a86bba

Change-Id: Iafed2ab4df7297ed8e3b0b86cafe15af3e1c8823
2016-10-18 01:49:53 +00:00
George Burgess IV
1db1a86bba Merge "Fix static analyzer warnings."
am: ff5c3ad08b

Change-Id: I655fd765cfeae407c070261cfe07ce8b739b06fa
2016-10-18 01:43:24 +00:00
Treehugger Robot
ff5c3ad08b Merge "Fix static analyzer warnings." 2016-10-18 01:30:55 +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
Mark Salyzyn
6e60ab12e7 Merge "missing includes" am: 78929f3ee0
am: 6a8f0d70b0

Change-Id: I40ff974f4333aaa714a63d5436b822491b9d78d6
2016-10-17 21:31:35 +00:00
Mark Salyzyn
6a8f0d70b0 Merge "missing includes"
am: 78929f3ee0

Change-Id: I3e7a25ded484d516fab453abe434c2e53cf0f27e
2016-10-17 21:25:59 +00:00
Chris Craik
dfe4a1b6ee Fix complex clipping on mergeable ops DO NOT MERGE am: d183e0b988
am: a6bfd8d12c

Change-Id: I5af8d0fac1e47e7bf831ca2f387fe550acf4165c
2016-10-17 19:59:32 +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
Mark Salyzyn
4d6c372eae missing includes
Assumptions are made about header side effects

Test: compile
Bug: 30465923
Change-Id: Icc9415aed5e54b2bc00b70aa0da6df4148f30654
2016-10-17 12:32:54 -07: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
George Burgess IV
e8efec56f0 Fix static analyzer warnings.
frameworks/base/libs/androidfw/ResourceTypes.cpp:742:46: warning: Result
of 'calloc' is converted to a pointer of type 'char16_t *', which is
incompatible with sizeof operand type 'char16_t **'
    mCache = (char16_t**)calloc(mHeader->stringCount,
        sizeof(char16_t**));

frameworks/base/libs/androidfw/ResourceTypes.cpp:4359:28: warning:
Potential leak of memory pointed to by 'set'
     return NO_MEMORY;

Bug: None
Test: Builds without the aforementioned warnings.
Change-Id: I1f84c1b9f4cba05f5cc7c3ae9fec1a07bc9cd8fe
2016-10-13 15:32:33 -07:00
Martin Wallgren
3970c44547 RRO: Synchronize access to overlays.list am: 0fbb608110
am: dce79f10ba

Change-Id: Idc121ffe64f1bc7b5bdcb1a800305165f27f1c0a
2016-10-12 21:09:42 +00:00
Doris Liu
1ef744a3b8 Fix SkShader leak for Gradient VectorDrawable and test am: fc9cf72339
am: c47199bb6a

Change-Id: I261f8f3708f526c15ae93c51d24bdaee054354f6
2016-10-12 21:03:14 +00: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
Adam Lesinski
78382db820 Merge "RRO: Synchronize access to overlays.list" 2016-10-12 14:52:49 +00:00
Martin Wallgren
f12af5e907 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.

Bug: 28032298

Change-Id: I51d39f121d207b11181340b68b164b60020f0c61
2016-10-12 15:42:04 +09: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
e830f351e1 Turn off additional logging in text rendering am: 5bb5626599
am: 4778f6a43e

Change-Id: If031a1d480d8c2e75e9f6268d15c8ccc098a0268
2016-10-11 00:54:34 +00:00
sergeyv
4778f6a43e Turn off additional logging in text rendering
am: 5bb5626599

Change-Id: Ic7f6c59ca2c3a92f81bf55a8916e20d99fcc01a7
2016-10-11 00:43:32 +00:00
John Reck
85ddb2df2f Fix SurfaceViewPositionListener race bugs
Bug: 29628138

1: Make windowPositionLost synchronous as that's
what the Java side was expecting

2: Make the listener ref counted as otherwise
there's a race condition with the GC, which could
end up with use-after-frees

3: Ensure that all position updates are invoked
prior to frame completion

Change-Id: Iedbc017f611ba2878a49b4586612f79249ca2fe3
(cherry picked from commit 7b570deea65bc7ac417a26ce3e4103bcef30e957)
2016-10-10 13:36:36 -07: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
5ef10f1d26 Support calling start() in onAnimationFinished(...) in AVD am: 679fe6ab6f
am: 4a1ea9ba7e

Change-Id: If343048fcbe8e2af46b6cdfcd5953c0d5ffa6c4e
2016-10-08 23:56:52 +00: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
6ff1730df5 Make umbra lighter when the blocker is too high and has no real umbra area. am: 9c555566bf
am: 9ad599930d

Change-Id: I930f1ea0a3620bfdb87e703bbdf927cdde7b809a
2016-10-06 21:37:17 +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
Adam Lesinski
224ffd3cb2 Merge "[AssetManager]:Fix thread race caused double free issue." am: 126e022095 am: f48d0b8f19
am: 73b91c63ad

Change-Id: I27f5cc6106f0a8f0a58721e1e8ed836144347b6a
2016-10-03 20:26:41 +00:00
Adam Lesinski
73b91c63ad Merge "[AssetManager]:Fix thread race caused double free issue." am: 126e022095
am: f48d0b8f19

Change-Id: Ia7da9ff37d813729a8c916a3b6e378110045aa17
2016-10-03 20:21:46 +00: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
Adam Lesinski
126e022095 Merge "[AssetManager]:Fix thread race caused double free issue." 2016-10-03 20:07:37 +00:00
Jakub Adamek
e60842aba3 Change name of overlay subdir property to sku.
am: c03d9483f0

Change-Id: I1368890b9c2dde2c5177473da3af0872c0c937a1
2016-10-03 10:30:14 +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
ryang
44df10ebf7 Merge "hwui: Fix the length of partial updates system property" am: faf945a773 am: 73f2e9b812
am: 3734e98095

Change-Id: I88c1092a7fcce45d80bb2f5cd7d14b25e0660f40
2016-09-28 17:10:58 +00:00
ryang
3734e98095 Merge "hwui: Fix the length of partial updates system property" am: faf945a773
am: 73f2e9b812

Change-Id: Ibcc55a59fd29614e491843a0dbbcfd316f423312
2016-09-28 17:04:26 +00:00
Jakub Adamek
ff5cb98888 Search for runtime resource overlays in subdir.
am: 1c15c63578

Change-Id: Ie6614c07851a2365b623a455b2ccc85672d4c846
2016-09-28 10:27:41 +00: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
ryang
647bc13709 hwui: Fix the length of partial updates system property
The maximum length of a system property is 31 bytes.
debug.hwui.enable_partial_updates is 33 bytes

Change-Id: Idb1b1a00294dd29f84530e8aee1f685094d0096f
2016-09-26 16:05:06 -04:00
songjinshi
49921f2c05 [AssetManager]: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

Change-Id: I5a7d67fdf64c4aa03f505b37a2fa840f4443d158
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
2016-09-20 01:31:19 +00:00
Yuqian Li
49d49fafb8 Ignore HasAlphaLayer flag to fix b/30929229 am: 83427ff222
am: df6b413b63

Change-Id: I994233a48472cd2d11acaa30673504b8589bc303
2016-09-15 14:02:15 +00:00
Yuqian Li
83427ff222 Ignore HasAlphaLayer flag to fix b/30929229
BUG:30929229
Change-Id: Iebadc6b3d224efa0554cbbb99ea43f871c28722b
2016-09-14 11:44:10 -04:00
sergeyv
0ec2fd7bc5 HWUI: track upload & recent usage in font cache am: af102bee51
am: 42c01cf62f

Change-Id: Ieb80108d520aa629c54a40d7c533bf74a71849c4
2016-09-13 02:01:28 +00:00