summaryrefslogtreecommitdiff
path: root/native
AgeCommit message (Collapse)Author
2020-01-17Refactor TextureLayer JNI to use only APEX APIsStan Iliev
Move ASurfaceTexture JNI implementation from libandroid to libnativedisplay. TextureLayer uses ASurfaceTexture_fromSurfaceTexture from libnativedisplay instead of libandroid_runtime code. libgui is no longer leaked through surface_texture_platform.h. DeferredLayerUpdater uses ASurfaceTexture_release instead of private ASurfaceTexture dtor. Test: pass CtsUiRenderingTestCases and CtsViewTestCases Bug: 147060713 Exempt-From-Owner-Approval: Changed only a header path in android_hardware_camera2_legacy_LegacyCameraDevice.cpp Change-Id: I9720d9c383f8120f9db116fd2b74fc241af84396
2020-01-17Merge "Implement native compress API"TreeHugger Robot
2020-01-16Implement native compress APILeon Scroggins III
Bug: 135133301 Test: Ifbcb41388a48afc64bb22623bb7e981b288b2457 Refactor the bulk of Bitmap_compress into hwui/Bitmap::compress, so that it can be shared by the new API. Update its enum to match the proper style. Also make the enum a class so it does not need to have a special return value for a bad parameter, which is now handled by the caller. Add ABitmap_compress, which implements the new API by calling hwui/Bitmap::compress. Change-Id: Ia8ba4c17b517a05b664c6e317e235836473fd7f6
2020-01-16Replace setAlphaFlags with setUnpremultipliedRequiredLeon Scroggins III
Bug: 135133301 Test: I48e49ee08ab1954eddf62ecae87942aeb128c10d As described in I3381582e27894e1072db9b8635f3762b801f5d69, this is a more sensible API. In addition, remove unused methods on ImageDecoder. Lastly, update AImageDecoder methods in the map to document which API level they were introduced in. Change-Id: I1aff544e8d6932b9ed0931a00da66a0aba6cd536
2020-01-15Update AImageDecoder_getAlphaFlags return valueLeon Scroggins III
Bug: 135133301 Test: I2ea58bede5cf49a7947c96e7e6e37f967632ad6b BAD_PARAMETER is a more sensible value than -1. The other return will not be reached, but the code is clearer. Change-Id: I4bee8f238f61a6c6cd13b5458f201f34d34315d9
2020-01-14Merge "Reland "Implement AndroidBitmap_getDataSpace""TreeHugger Robot
2020-01-14[AChoreographer] Lift refresh rate callbacks into NDKAlec Mouri
Bug: 136262896 Test: ChoreographerNativeTest Change-Id: Ica2fe31e511045e2007e7d1b3a129e1b8f26f3a7
2020-01-13Reland "Implement AndroidBitmap_getDataSpace"Leon Scroggins III
Originally reviewed in Ie05a45da32b2fd670abdae35626cd6548cfb102c (and reverted in I0b06312f6583f766512cc771a35d3d735debcce1) Bug: 135133301 Test: I7a5fcb726fba0c832bbb86a424d7534a7cfa35b6 This supplements AndroidBitmap_getInfo, allowing NDK clients to know how to interpret the colors in an android.graphics.Bitmap. Only build android_bitmap.cpp on Android so that it can rely on libnativewindow (which is Android-only) for data_space.h Change-Id: I4b23c68c7e62ed733e95af6f76c47fecbc2c5747
2020-01-12Merge changes from topic "ndk_imagedecoder"Leon Scroggins
* changes: Implement new NDK image decoding apis Create AAssetStreamAdaptor, for reading from AAssets
2020-01-10Merge "Revert "Implement AndroidBitmap_getDataSpace""Kweku Adams
2020-01-10Revert "Implement AndroidBitmap_getDataSpace"Kweku Adams
Revert "Add AndroidBitmap_getDataSpace" Revert "Test AndroidBitmap_getDataSpace" Revert submission 9940762-_getDataSpace Reason for revert: Breaks build: http://screen/kBMYHusKiOV.png Reverted Changes: Ie05a45da3: Implement AndroidBitmap_getDataSpace I7a5fcb726: Test AndroidBitmap_getDataSpace Ia46dfb39d: Add AndroidBitmap_getDataSpace Change-Id: I0b06312f6583f766512cc771a35d3d735debcce1
2020-01-10Merge "Implement AndroidBitmap_getDataSpace"Leon Scroggins
2020-01-10Implement new NDK image decoding apisLeon Scroggins III
Bug: 135133301 Test: Ib84462ea5fa8a7779eaa44494775e182e52ecaca Separate out the code for encodedFormatToString into a piece which returns a const char* that can be used by AImageDecoder (with its own header) and the part that the JNI code uses to convert that into a Java String. Change-Id: I4cf8bfb0aacfb8e22c3f9b1689bd614ed1253673
2019-12-20Merge "Add AConfiguration_getScreenRound." am: c44bffa46a am: 7a93b588c0 am: ↵Automerger Merge Worker
42c621eea9 Change-Id: Id7632e38f4d49cdfd50d8c745dd232ba486d74fd
2019-12-18Add AConfiguration_getScreenRound.Elliott Hughes
This was actually added in M, but because it wasn't in the version map (and there's no CTS test) it's not actually reliably available until next year... Bug: https://issuetracker.google.com/146458518 Change-Id: I5eed970118b627c7e74800f04751a07ce64d86da
2019-12-18Create AAssetStreamAdaptor, for reading from AAssetsLeon Scroggins III
Bug: 135133301 Test: Ib84462ea5fa8a7779eaa44494775e182e52ecaca, once I4cf8bfb0aacfb8e22c3f9b1689bd614ed1253673 lands AAssetStreamAdaptor lives in libjnigraphics, for use by AImageDecoder. Change-Id: I4e2559c3c21c866d61fb431a0a1368150c7d39cb
2019-12-18Implement AndroidBitmap_getDataSpaceLeon Scroggins III
Bug: 135133301 Test: I7a5fcb726fba0c832bbb86a424d7534a7cfa35b6 This supplements AndroidBitmap_getInfo, allowing NDK clients to know how to interpret the colors in an android.graphics.Bitmap. Depends on I8e06071060ab19b103900ff04d60f1c3d3fccda9 Change-Id: Ie05a45da32b2fd670abdae35626cd6548cfb102c
2019-11-21Consolidate NDK and APEX implementationsDerek Sollenberger
the NDK APIs are implemented in terms of the APEX APIs to reduce the number of different implementations serving the same fundamental purpose. Bug: 137655431 Test: CtsGraphicsTestCases Change-Id: Idc7b85403a7e546843b9c1d822acc0a1e740059a
2019-11-14Merge "[AChoreographer] Consolidate AChoreographer source files"Alec Mouri
2019-11-13Rename # vndk tag to # llndkJiyong Park
The APIs that are tagged with # vndk are actually for LLNDK libraries. Although LLNDK is part of VNDK, calling those APIs 'vndk' has given users a wrong perception that the APIs don't need to be kept stable because that's the norm for most of the VNDK libraries that are not LLNDK. In order to eliminate the misunderstanding, rename the tag to 'llndk' so that people introducing new such API will realize what they are signing themselves up for. Exempt-From-Owner-Approval: cherry-pick from internal gerrit Bug: 143765505 Test: m Merged-In: I7ae77e232ec25cbe7afd98d1b68fc7a7fcf9bdfd (cherry picked from commit a9258ab2e16669da63ad6a423bb65a11f3ad9a6c) Change-Id: I7ae77e232ec25cbe7afd98d1b68fc7a7fcf9bdfd
2019-11-13Merge "Rename # vndk tag to # llndk"TreeHugger Robot
2019-11-11[AChoreographer] Consolidate AChoreographer source filesAlec Mouri
Now that AChroeographer is defined in libnativedisplay, libandroid should not need its own copy. Instead what we do is: * Statically link libnativedisplay into libandroid * Delete choreographer.cpp This structure is the same as that of ANativeWindow. Bug: 136262896 Test: builds Change-Id: I159d69398bb33ccd7b01aae798d14c04438355c1
2019-11-08Decouple SurfaceTexture from HWUIStan Iliev
Remove all Skia and HWUI types from SurfaceTexture implementation. Move SurfaceTexture to libgui (ag/9578265). Define private C++ API for SurfaceTexture, which is consumed by DeferredLayerUpdater. Move AutoBackendTextureRelease/Skia code from SurfaceTexture to HWUI. Test: pass CtsUiRenderingTestCases and CtsViewTestCases Bug: 136263580 Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213
2019-11-08Rename # vndk tag to # llndkJiyong Park
The APIs that are tagged with # vndk are actually for LLNDK libraries. Although LLNDK is part of VNDK, calling those APIs 'vndk' has given users a wrong perception that the APIs don't need to be kept stable because that's the norm for most of the VNDK libraries that are not LLNDK. In order to eliminate the misunderstanding, rename the tag to 'llndk' so that people introducing new such API will realize what they are signing themselves up for. Bug: 143765505 Test: m Change-Id: I7ae77e232ec25cbe7afd98d1b68fc7a7fcf9bdfd
2019-10-29Make AFont_getLocale workSeigo Nonaka
There are multiple problems here: - Java Font.equals and hashCode doesn't look at locale list. Due to this issue, the CTS tests have been passing unexpectedly. - The null pointer check in the AFont_getLoacle was inversed. Should return only when it is non-null. - Looks like we cannot get the parent's attribute which always returns null. Instead, read the "lang" attribute when we read the family tag. Bug: 139201432 Test: atest NativeSystemFontTest Test: atest TypefaceEqualsTest Change-Id: I0514847bbf46a73358afab374ccfce2db09b2ec0
2019-10-22Add userId to the package name API.atrost
The service would query package manager with the provided userId, and will return true if the package is not visible. Test: locally, b/143129258 Change-Id: Iab8ddaa76358d5fad63e10d7c4c3f92e2a0f51a2 Merged-In: I92ea650b49743c388bff9943a7ec620e3d61a5d6
2019-10-22Merge "Add userId to the package name API."TreeHugger Robot
2019-10-22Add a native aidl API.atrost
Introduce a platform_compat_native service that just calls the platform_compat service. The new service is needed as it needs a slightly different (more limited, no ApplicationInfo in cpp) aidl API, and a class can only extend one stub. Test: Call the service from dumpsys.cpp (http://aosp/1142055) Bug: 138275545 Change-Id: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac Merged-In: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac
2019-10-22Add userId to the package name API.atrost
The service would query package manager with the provided userId, and will return true if the package is not visible. Bug: 142942524 Bug: 143129258 Test: m, treehugger Change-Id: I92ea650b49743c388bff9943a7ec620e3d61a5d6
2019-10-22Merge "Adding transformHint to callbacks"Valerie Hau
2019-10-21Adding transformHint to callbacksValerie Hau
Bug: 141939598, 133512804 Test: build, boot, manual Change-Id: I58411368e5187b3a23eb9e8ac9abbf1cb1a5d97e
2019-10-17Add a native aidl API.atrost
Introduce a platform_compat_native service that just calls the platform_compat service. The new service is needed as it needs a slightly different (more limited, no ApplicationInfo in cpp) aidl API, and a class can only extend one stub. Test: Call the service from dumpsys.cpp (http://aosp/1142055) Bug: 138275545 Change-Id: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac
2019-08-26Do not crash on invalid dataspaceValerie Hau
Prior logic caused device to crash when setting the dataspace for a layer to hdr on a non-hdr device. Update to log the failure and perform a no-op to match framework APIs. Bug: 140029823 Test: build, boot, CtsViewTestCases:android.view.cts.ASurfaceControlTest Change-Id: I9baf88a6d787e043b440ad4c2ebeb4c7a1fd90a2
2019-05-23Handle NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY flag in ASurfaceTransactionVishnu Nair
BufferStateLayer ignores NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY flag if its set as part of the transform. Fix this by calling Transaction::setTransformToDisplayInverse when calling ASurfaceTransaction_setGeometry. Bug: 133330435 Test: Test landscape orientation in test app Test: go/wm-smoke Change-Id: Id499448d822425e5b7be4efed7f448c4e4378b87
2019-04-23ASurfaceControl: fix surface damageMarissa Wall
There are two problems with surface control. 1) By merging the rects, the Region turned into 0,0,0,0 instead of an or of the Rects. 2) In the case where an app intends to have a region of 0,0,0,0, we should treat it the same as a region of 0,0,-1,-1. Bug: 131175047 Test: ASurfaceControl Change-Id: Ib2e3b90ac215e069d3d3c2eca81ff1013b4287aa
2019-04-08Merge "Pass runMax = 1 to stop unnecessary itemization" into qt-devTreeHugger Robot
2019-04-05Pass runMax = 1 to stop unnecessary itemizationSeigo Nonaka
Bug: 130044291 Test: N/A Change-Id: I124b211f9a3db24d4c70c6d6bc0b1a9fdc93b9f7
2019-04-04Allow the WebView native library to have dependencies.Torne (Richard Coles)
The WebView native library has so far only depended on native libraries that were already loaded by the zygote, and has only shipped a single .so file in its APK. Splitting the code into multiple libraries worked, but only the top-level library would have its RELRO section shared, causing a memory regression. To avoid this regression if we do decide to split up the native code in future, load the native library using the new RESERVED_ADDRESS_RECURSIVE flag in the linker, which means that any depended-upon libraries will also be loaded into the reserved address region and will have their RELRO sections saved and reused. Fixes: 128623590 Test: tested manually with modified WebView Change-Id: I19ee3ff971e8dcd1c683f94af304abf918860a10
2019-04-02Update the system font implementation for new API changeSeigo Nonaka
Bug: 129559385 Test: TEMPORARY_DISABLE_PATH_RESTRICTIONS=true m ndk-docs Test: atest CtsGraphicsTestCases:android.graphics.fonts Change-Id: I73fd366762e4923886529a49a682cdc1cdceb1aa
2019-03-25Deprecate is_layer for vulkan functorBo Liu
Webview no longer needs this. Bug: 124123583 Test: comppiles and vulkan webview in layer keeps working Change-Id: Ib54e33649eb027a03184c5d7588cfd9568c90a6c
2019-03-21Adding AHardwareBuffer lockAndGetInfo to libandroidValerie Hau
Bug: 123423521 Test: build, boot, android.hardware.nativehardware.cts.AHardwareBufferNativeTests Change-Id: I81d7fa7352b7720103975ab0910d57953e0a7ec4
2019-03-09Merge "Add junyulai@ as owner of the core networking dirs" am: e5e3ac639b ↵Bernie Innocenti
am: b0498ba448 am: 6f6fc40839 Change-Id: I5902959b76797a58884480e3fd219ba53497ae8e
2019-03-08Add junyulai@ as owner of the core networking dirsBernie Innocenti
Also removed emeritus accounts ek@ and silberst@ from various places. A cleanup using 'include' would probably be in order... Test: N/A Change-Id: I575e60dd5e600e42d9571ce8e8d7661d30e99bfe
2019-03-06Add explicit 64-bit postFrameCallback APIsSantos Cordon
Bug: 123660572 Test: atest -a android.view.cts.ChoreographerNativeTest Change-Id: Idff869a435ddb9b858a95993c1e4c6a5c668322f
2019-02-22DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGEDAdy Abraham
Add a new event for display configuration change. This event will be sent by SF anytime it changes the display config. Test: Generate DISPLAY_EVENT_CONFIG_CHANGED and observe the log Bug: 122905403 Change-Id: Ifa473a34d7b313501e5e4e8a67186fb82754fdcd
2019-02-13Merge "Adds new HardwareBuffer plane-locking functions to NDK"Marius Renn
2019-02-11Merge "ASurfaceControl: dataspace (1/2)"TreeHugger Robot
2019-02-08ASurfaceControl: dataspace (1/2)Marissa Wall
Allow dataspace to be set on the SurfaceControl. Test: atest CtsViewTestCases:android.view.cts.ASurfaceControlTest Bug: 80477568 Change-Id: Idc12d0a4024fc21d570c5190af33559b818b4b08
2019-02-06Merge "Generalize physical display management"Dominik Laskowski
2019-02-04Do not call postDrawVk if did not call drawVkBo Liu
Reland enable vulkan webview functor Bug: 123877499 Bug: 115613038 Test: Gmail in bug no longer crashing. Change-Id: I7df761a4691ceaa6c2a02b256d61554e57139409