Commit Graph

10833 Commits

Author SHA1 Message Date
Orion Hodson
18f7afccb6 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f am: 6963d8e1c8
Change-Id: I2fdf3826653466d65e3d63fa896d1ec23c5716cd
2020-04-16 10:58:50 +00:00
Orion Hodson
6963d8e1c8 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f
Change-Id: I8c84a9de389c0f82c307d835344038373d75f61a
2020-04-16 10:45:48 +00:00
Orion Hodson
63f06b738d Add explicit dependencies on jni_headers
Preparation for removing implicit include paths for jni.h from soong.

Also remove unnecessary jni.h includes from PathParser.{h,cpp}.

Bug: 152482542
Test: lunch aosp_x86_64 && m checkbuild
Change-Id: Ib18afa3d2c93ed3ce69204286d5177991100fd7e
Exempt-From-Owner-Approval: build refactoring
2020-04-16 08:26:14 +00:00
TreeHugger Robot
a3263bb756 Merge "Restore preserving mutability over parceling" into rvc-dev am: ac774e3304
Change-Id: I164641b941a37b3b576acccb0cf9d8c77340683f
2020-04-13 21:21:33 +00:00
TreeHugger Robot
ac774e3304 Merge "Restore preserving mutability over parceling" into rvc-dev 2020-04-13 21:12:54 +00:00
John Reck
9054ca2b34 Restore preserving mutability over parceling
Bug: 150836900
Test: CTS test BitmapTest#testWriteToParcelPreserveMutability
Change-Id: I2caba900a3259e2fb7b4e83d7241cebd7441fa06
Merged-In: I133047acfccae7af81199098caaf20ea8d641a89
2020-04-13 16:14:21 +00:00
Ryan Mitchell
5a57f52b6b Merge "Fail install when resources.arsc is compressed" into rvc-dev am: b8a61d13c2
Change-Id: Ib01a8e7b83525cf420dae44758fcc214669d887d
2020-04-13 15:14:05 +00:00
Ryan Mitchell
b8a61d13c2 Merge "Fail install when resources.arsc is compressed" into rvc-dev 2020-04-13 14:57:19 +00:00
Ryan Mitchell
cca1593b23 Merge changes from topic "invalidate_idmap" into rvc-dev am: 6cb79cdfb7
Change-Id: Iec3d0e3bab28964442c5aada00c2586e284feb92
2020-04-10 15:53:05 +00:00
Ryan Mitchell
192400cf33 Fail install when resources.arsc is compressed
If an application targets R+, prevent the application from being
installed if the app has a compressed resources.arsc or if the
resources.arsc is not aligned on a 4-byte boundary. Resources tables
that cannot be memory mapped have to be read into a buffer in RAM
and exert unnecessary memory pressure on the system.

Bug: 132742131
Test: manual (adding CTS tests)
Change-Id: Ieef764c87643863de24531fac12cc520fe6d90d0
2020-04-09 11:01:54 -07:00
Ryan Mitchell
a90930528d Invalidate idmap when target updates
When the target package update, check if the idmap file must change.
If so, propagate the idmap changes to the targets overlay paths, and
invalidate cached overlay ApkAssets in ResourcesManager.

Bug: 147794117
Bug: 150877400
Test: OverlayRemountedTest
Test: libandroidfw_tests
Change-Id: I6115c30bae3672b188a5ff270720a0eea15b43b5
2020-04-07 12:14:51 -07:00
TreeHugger Robot
96803c27ad Merge "Don't reset the capture mode after each frame when using the CallbackAPI" into rvc-dev am: 5d3fc109ec
Change-Id: I7feb37ac52dcf074e548c5950520777f28a23f54
2020-04-07 17:20:50 +00:00
TreeHugger Robot
5d3fc109ec Merge "Don't reset the capture mode after each frame when using the CallbackAPI" into rvc-dev 2020-04-07 17:04:49 +00:00
Derek Sollenberger
5f9753d770 Don't reset the capture mode after each frame when using the CallbackAPI
When multiframe skp support was introduced it set the capture mode to
none for everything but the multiframe use case. This was incorrect in
the case of the CallbackAPI where we want to continue to capture frames.

Bug: 152084866
Test: hwui_unit_tests
Change-Id: I7e3caf41a3725d03252df1ab7bedfe1b69a238c2
2020-04-07 11:26:52 -04:00
TreeHugger Robot
df8afda623 Merge "Don't update the genID for an immutable bitmap" into rvc-dev am: 10dd5e9a18
Change-Id: I54d13f204587340eac67775212811f4b4b344c43
2020-04-07 13:54:55 +00:00
TreeHugger Robot
10dd5e9a18 Merge "Don't update the genID for an immutable bitmap" into rvc-dev 2020-04-07 13:46:17 +00:00
Leon Scroggins
63b3c143ac Merge "Switch get_env_or_die to requireEnv" into rvc-dev am: b1dfb8e575
Change-Id: I238a70ad499571e29587395925d90210708994b6
2020-04-07 13:39:02 +00:00
Leon Scroggins III
f97b29d2e3 Switch get_env_or_die to requireEnv
Fixes: 153099745
Test: manual

The heif decoder may need to continue reading the input from a
JavaInputStreamAdaptor on the AnimatedImageThread. Attach the JVM like
we do for ByteBufferStream and ByteArrayStream.

Similarly, if the AnimatedImageThread is holding a reference to an
AnimatedImageDrawable, it is possible to call its destructor, and
ultimately InvokeListener's destructor or ByteBufferStreamAdaptor's
release_proc on that thread without the JVM attached. Attach in that
case, too.

Change-Id: I84d236eed2fb5c8617533aed0cae4c762d1eb6dd
2020-04-06 21:11:37 +00:00
Derek Sollenberger
d3e9eecf5b Don't update the genID for an immutable bitmap
AndroidBitmap_unlockPixels is the only way to release the ref on
pixels acquired using AndroidBitmap_lockPixels.  Apps that lock an
immutable bitmap therefore are forced to call unlock pixels. Prior
to this CL the unlock would update the GenID of the bitmap and also
print a warning that the app was modifying an immutable bitmap. After
this CL the bitmap's GenID will not be updated and no warning will be
printed.

As a result, apps that were using the NDK to allow them to mutate
immutable bitmaps will break without getting a warning message.

Test: hwui_unit_tests
Bug: 150823341
Change-Id: Ie5e5cf86a7a83d53c179c9b3cf9be1a0566cfd93
2020-04-06 20:26:49 +00:00
Tianjie Xu
289e25ee9b Merge "Change the parameter type of offset in read" am: 74a5df06af am: eead9e3eda
Change-Id: Ie2996a6fc8f7d08f3f77589e439557b42f4ed56a
2020-04-04 20:40:28 +00:00
Tianjie Xu
b2415d3b32 Merge "Change the parameter type of offset in read" am: 74a5df06af am: eead9e3eda
Change-Id: I4ad529b54e83421488d341d8f25def5d1cc2df54
2020-04-04 20:39:31 +00:00
Ryan Mitchell
d856e14c8d Merge "Begin moving FrameworkResourceLoaderTest to cts" into rvc-dev am: 1b922d56c0
Change-Id: Ia9e28c0697da0f848c9e1996b345e3b18f8ae9b6
2020-04-03 16:09:59 +00:00
Ryan Mitchell
1b922d56c0 Merge "Begin moving FrameworkResourceLoaderTest to cts" into rvc-dev 2020-04-03 16:03:24 +00:00
TreeHugger Robot
3b2288dd2f Merge "AImageDecoder: Suppress log messages" into rvc-dev am: 0a5b54560d
Change-Id: Iff0114dcd3099b729cce77d7735341263d08c118
2020-04-03 15:17:01 +00:00
Leon Scroggins III
f889444fa9 AImageDecoder: Suppress log messages
Bug: 153071768
Test: AImageDecoderTest

For simplicity, I1aff544e8d6932b9ed0931a00da66a0aba6cd536 made
ImageDecoder skip specifying kOpaque when setting the SkImageInfo for
decoding. For some formats (e.g. jpeg and heif), this results in a log
message:

"Warning: an opaque image should be decoded as opaque - it is being
 decoded as non-opaque, which will draw slower"

This isn't relevant to AImageDecoder, which doesn't let you specify
kOpaque or not (since the intent is not to create an SkBitmap for Skia).

Now that ImageDecoder specifies kOpaque properly, the JNI code no longer
needs to correct it.

Replace another opacity check with ::opaque() for simplicity.

Change-Id: I7c270d9b9db61a61a338f40b056ce5d23a56e14d
2020-04-02 16:01:52 +00:00
Tianjie
01ae3f4157 Change the parameter type of offset in read
As we support zip64 in libziparchive, we change the parameter of
the ReadAtOffset() in zip reader from uin32_t to off64_t. So the
derived class needs to be updated as well.

Bug: 150900468
Test: build
Change-Id: Icbfd2dd54b01ff62da988ba8598c1057f9bb6368
2020-04-02 06:16:21 +00:00
Ryan Mitchell
199b09a1a7 Begin moving FrameworkResourceLoaderTest to cts
This changes removes FrameworkResourceLoaderTest from frameworks/base
before it is moved to CTS.

Bug: 152979463
Test: atest CtsResourcesLoaderTest
Change-Id: I4b899564ab93472cb6d2a5ed0917026753c2827f
2020-04-01 20:09:29 +00:00
TreeHugger Robot
a1a64dc32d Merge "[HWUI] Add null check for CanvasContext" into rvc-dev am: c2e20c4b8a
Change-Id: Ib452de51c1b76cd6f5d5db4b04f70a4744d309ed
2020-03-28 04:04:55 +00:00
TreeHugger Robot
c2e20c4b8a Merge "[HWUI] Add null check for CanvasContext" into rvc-dev 2020-03-28 04:02:31 +00:00
Ryan Mitchell
3769911736 Merge changes If7ea17d5,If6364fd6 into rvc-dev am: 8275fb7d66
Change-Id: Iaa34df4fc6cce09177547a11497d28fa1ce9cdb5
2020-03-27 17:49:56 +00:00
Ryan Mitchell
8275fb7d66 Merge changes If7ea17d5,If6364fd6 into rvc-dev
* changes:
  Assigned package ids to overlays last
  Revert "Assign shared libraries stable package ids"
2020-03-27 17:38:32 +00:00
Tobias Thierer
0b4d263ca7 Merge "OWNERS: tobiast -> ngeoffray." am: 9c0d26b4cb am: d9b0a60742
Change-Id: I5b781cfc5b6383c61087b796e0e344be084d3dc9
2020-03-27 11:51:34 +00:00
Tobias Thierer
5bd921f8c3 Merge "OWNERS: tobiast -> ngeoffray." am: 9c0d26b4cb am: d9b0a60742
Change-Id: I34cec5528243e6655287ba020eef5abf7e2ca114
2020-03-27 11:51:27 +00:00
Alec Mouri
026106f6d6 [HWUI] Add null check for CanvasContext
If ReliableSurface is forced to acquire a fallback buffer then the
Surface may be abandoned. When getting frame timestamps we need to check
that the Surface still exists.

Bug: 152262035
Test: builds, boots
Test: dumpsys gfxinfo
Change-Id: Ifdb198ebf74cc9dc681c4ab51c4901176a7f5fc9
2020-03-26 18:09:53 -07:00
Tobias Thierer
fa82e757dd OWNERS: tobiast -> ngeoffray.
This CL topic was created via:

  find . -name OWNERS | xargs grep -l tobiast | xargs sed \
  -i 's/tobiast/ngeoffray/g'

Plus appropriate repo start, git commit, repo upload commands:

  while read proj; do croot $proj ; repo start OWNERS-tobiast-ngeoffray ; \
  git commit -F ~/commit-message.txt; croot ; done \
  < ~/owners-projects.txt

  repo upload -t --br=OWNERS-tobiast-ngeoffray

No attempt was made to sort the files after the replacement.

Exempt-From-Owner-Approval: Both old and new owner are on this CL.
Test: Manually inspected the result.
Bug: 152399425
Change-Id: I2f100a71d399a7d4d46ea036fff564ff5c5dbda7
2020-03-26 14:10:06 +00:00
Mike Ma
af4b4f48cc Merge "Optimize memory usage in incidentd" into rvc-dev am: 06b3aaee39
Change-Id: I1c670ced7fe8ca3e4770ddabad0216e284006de5
2020-03-24 20:31:38 +00:00
TreeHugger Robot
925972ebf9 Merge "Native API Council asked that we remove the C++ class from the public header." into rvc-dev am: 14f33ae83e
Change-Id: Ibfaba0a7bd05cae259c13c82a1059e3428730198
2020-03-24 01:54:05 +00:00
Mike Ma
892ccd9bd5 Optimize memory usage in incidentd
EncodedBuffer is used a lot in incidentd. EncodedBuffer uses malloc
internally to acquire memory. Frequently creating and destroying
EncodedBuffer creates memory fragmentation, leading to high memory
usage after taking an incident report.
Also fixes a few other places with lots of malloc/free operations.

This change:
* Creates a pool of EncodedBuffer in incidentd. The saving is
significant. It reduces EncodedBuffer creation from 3 per section to
3 per report.
* Replaces malloc with mmap inside EncodedBuffer. mmap is guaranteed
to be mem page aligned, so there will be no mem fragmentation after
destroying EncodedBuffer.
* Replaces new with mmap inside TombstoneSection
* Forks a process to execute LogSection, because liblog malloc & free
significant amount of memory

Result:
PSS before taking a report: 1295 KB
PSS after taking a report: 1336 KB

Bug: 150311553
Test: heapprofd
Change-Id: I83bd9c969b751c80b2f42747020799bd85d8aae6
2020-03-23 18:46:58 -07:00
TreeHugger Robot
14f33ae83e Merge "Native API Council asked that we remove the C++ class from the public header." into rvc-dev 2020-03-24 01:35:40 +00:00
Ryan Mitchell
824cc490c5 Assigned package ids to overlays last
Before overlays could reference internal resources, overlays were
added to AssetManagers before shared libraries. Overlays are now
loaded as shared libraries so they must be assigned package ids
after non-overlay shared libraries so enabling and disabling
overlays does not affect the package ids of the non-overlay shared
libraries.

Since overlays are added to the end of the AssetManager by
ResourcesManager, enabling and disabling overlays will not change
the assets cookie of shared libraries loaded through ResourcesManager,
but it will change the apk assets cookie or overlays added through
AssetManager#addAssetPathAsSharedLibrary.

The package ids of shared libraries added through
AssetManager#addAssetPathAsSharedLibrary will not be affected by
overlays since overlay package ids are assigned last.

Bug: 146685730
Test: CtsHostsideWebViewTests
Change-Id: If7ea17d51b18769bf2465e29af3ae6a71004d06c
2020-03-23 18:14:11 -07:00
Ryan Mitchell
b894c274d0 Revert "Assign shared libraries stable package ids"
This change must be reverted because it broke packages with the same
package name but different package ids loaded at once.

Bug: 146685730
Test: MultiSplitInstallTest
This reverts commit fe50d739f7.

Change-Id: If6364fd660c76284452f77e7d4f09a3df9dede1d
2020-03-23 18:05:40 -07:00
TreeHugger Robot
be6970b281 Merge "Fix security issue in DynamicRefTable::load." into qt-qpr1-dev am: 084cc32ce8
Change-Id: Ie35cf55cff2162394abae816d1cfb0eefdc0aab6
2020-03-23 19:38:50 +00:00
Joe Onorato
084aa3cb17 Native API Council asked that we remove the C++ class from the public header.
The API is simple enough, so just reimplement everything using the
C API directly.

Bug: 148940365
Test: treehugger
Change-Id: I0a75744e975e8d3c2a557e533eacd03200388ddc
2020-03-21 18:33:28 -07:00
TreeHugger Robot
764b48015d Merge "Statsd update for native puller api feedback" into rvc-dev am: 1e377304cb
Change-Id: I262405b3861a97fbf037538b9bb710ad7fae9c3f
2020-03-21 03:17:00 +00:00
TreeHugger Robot
1e377304cb Merge "Statsd update for native puller api feedback" into rvc-dev 2020-03-21 03:15:06 +00:00
Ryan Mitchell
c5f968d58b Merge changes from topic "res_loader_dir" into rvc-dev am: b0544a733c
Change-Id: I18c28c7293a24d712940c9e80e7817f9547512f8
2020-03-20 18:21:20 +00:00
Ryan Mitchell
b0544a733c Merge changes from topic "res_loader_dir" into rvc-dev
* changes:
  Allow using loaders on non-RM Resources instances
  Move AssetsProvider to native layer
  Add ResourcesProvider.loadFromDirectory
  Refactor tests for ApkAsset loading APIs
  Refactor ApkAsset loading APIs
  Fix bugprone-use-after-move warnings
  Fix bugprone-use-after-move warnings
2020-03-20 18:16:30 +00:00
Tej Singh
73597dcb9a Statsd update for native puller api feedback
Update statsd to take in times in milliseconds instead of nanoseconds.

Also make appropriate updates for graphics stats, odpm, subsystem sleep
state, and LibStatsPullTests

Test: atest LibStatsPullTests
Test: bit statsd_test:*
Bug: 150788562
Change-Id: I593552d6c50bb4dcb89ca9cc1c737781653e7cc5
2020-03-20 11:16:18 -07:00
Ryan Mitchell
39cacf2de7 Allow using loaders on non-RM Resources instances
Currently there is a limitation where ResourcesLoaders cannot be  used
on Resources object not created through ResourcesManager. This change
creates an update handler for Resources objects that are not registered
with ResourcesManager.

The handler changes the loaders on the asset manager owned by the
Resources instance.

Bug: 151666644
Test: atest ResourceLoaderValuesTest
Change-Id: I5a89f686386bdb088dc964014e7becc0c2b4770f
2020-03-19 18:33:55 -07:00
Ryan Mitchell
4ea1e42889 Move AssetsProvider to native layer
Querying in the native layer for assets provided through
AssetsProviders does not currently work. This change refactors the
AssetProvider API to return a file descriptor that is read in the
native layer and can bubble up to the java layer.

This change also removes the InputStream API to favor of developers
using memfd_create.

Bug: 142716192
Test: atest ResourceLoaderValuesTest
Change-Id: I1a7eca0994c3b7cc32008d9a72bf91086ff0e816
2020-03-19 18:33:55 -07:00