Commit Graph

243 Commits

Author SHA1 Message Date
Alec Mouri
cf3ad873dd Dispatch refresh rate callbacks from DMS
AChoreographer will consume these callbacks in lieu of going through SF
for the callbacks. This is so that DMS can update its view of display
configs before apps receive the refresh rate callback so that apps can
get consistent information.

Bug: 154874011
Test: ChoreographerNativeTest
Test: Manually verify that HWUI is receiving callbacks
Change-Id: I992c247fd16ef414f94a259bbd300bea3e4c9467
2020-05-07 19:19:23 -07:00
Derek Sollenberger
76e7430bae Merge changes from topic "HWUI_JNI"
* changes:
  Export symbols for the newly exposed APEX/internal headers
  Remove dependence on libandroid_runtime from Bitmap.cpp
  Update Region.cpp to use AParcel NDK APIs
  Cleanup header and build targets for libhwui clients.
  Remove dependencies on headers outside UI module
  Cleanup LOG_TAG when bundled in HWUI
  Move android.graphics JNI & APEX files into HWUI
2020-02-21 11:43:02 +00:00
Derek Sollenberger
ee538a3a85 Cleanup header and build targets for libhwui clients.
Targets that will also be contained within the UI module
are allowed to access internal headers.  All other targets
that depend on libhwui are restricted to using the APEX headers.

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Id92e9874dafb98bd79839d45ab8f22ab999689de
2020-02-20 21:50:06 -05:00
Chris Ye
48dbcaae41 Add native Thermal Throttling API to libandroid.
Add native thermal manager API of thermal mananger service into
libandroid. Export Thermal API as NDK library.

Bug: 137151587
Bug: 136285293
Test: build, atest thermalmanager-test atest CtsThermalTestCases

Change-Id: Ia49fb2133624ffcd6168af804ae612ef2bb190f2
2020-02-19 16:25:25 -08:00
Steven Thomas
dd7bf2fea5 Add compatibility param to setFrameRate() api
Add a compatiblity param to the setFrameRate() api, so the system has
more info to decide the device frame rate when there are multiple
competing preferences.

I also changed the plumbing for setFrameRate() to go directly to surface
flinger, instead of through buffer queue. We're trying to avoid changes
to buffer queue code, to avoid disturbing the prebuilts.

Bug: 137287430

Test: Added new cts tests to verify behavior of the compatibility param.
      cts-tradefed run commandAndExit cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.SetFrameRateTest

Test: /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test --gtest_filter='SetFrameRateTest.*'

Change-Id: I9123afee2ba63d01ff35fb2b257a1ee0e4928ddd
2020-02-17 00:38:43 -08:00
Siarhei Vishniakou
cf07528a0e New VerifiedInputEvent api
The Verified{Input/Key/Motion}Event api are the same as
{Input/Key/Motion}Event api.
The VerifiedMotion class is the same as the MotionEvent class, but
contains less information. It only contains the information that the
system is able to verify.
Same applies to VerifiedKeyEvent.

The class VerifiedInputEvent contains common information applicable to
both Key and Motion.

Test: atest VerifiedKeyEventTest VerifiedMotionEventTest
Bug: 134977432
Change-Id: I4770104eb4c025263da7efeea9c7a658dff74ac9
2020-02-10 13:43:55 -08:00
TreeHugger Robot
c9853809e1 Merge "Pass back frame event stats" 2020-02-06 01:11:19 +00:00
Muhammad Qureshi
006d3ee677 Merge "Fix StatsLog JNI registration" 2020-02-03 17:12:49 +00:00
Muhammad Qureshi
93b4e99d9b Fix StatsLog JNI registration
Re-add StatsLog JNI regsitration in AndroidRuntime.cpp.
This will have to be revisited once StatsLog is moved into statsd apex.

Test: m
Test: fastboot flashall
Test: adb logcat "*:E"
Change-Id: I233a527d00d524cbc2edaed7c2be76ea1c212b29
2020-02-02 08:25:44 -08:00
Alec Mouri
a8f9a9e85f Merge "[AChoreographer] Lift refresh rate callbacks into NDK" 2020-01-31 19:14:20 +00:00
Tej Singh
a2b78e4d6b Create libstats_jni
This cl creates libstats_jni, puts the android_util_StatsLog class in it
to implement the jni StatsLog.writeImpl() call, and puts the library in
the statsd apex.

Right now, it does NOT load the library properly and therefore the
library is still in the platform. It needs to be removed from the
platform.

Test: boots
Test: adb shell cmd stats print-logs shows logs still flow
Bug: 147315667
Change-Id: I0a06b66d4640d00ee75bc273423b33dafc944b05
2020-01-30 13:52:42 -08:00
Valerie Hau
d6a222eab0 Pass back frame event stats
Adding frame event stats to SurfaceControlStats
Not exposing to ASurfaceControlStats

Bug: 141939081
Test: build, boot
Change-Id: If64056514be6b5161d52f5e8c2cc499bd8389099
2020-01-29 20:01:38 -08:00
Steven Thomas
6cf051ef89 Add setFrameRate() api
setFrameRate() is a new api in Android 11 that will enable apps to
specify their intended frame rate.

Bug: 143912624
Bug: 137287430

Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest.

Change-Id: I922573c0d704e2e0ce4cfc2a462f14dce8cb7a79
2020-01-22 13:20:42 -08:00
Stan Iliev
5af5d3077f Refactor TextureLayer JNI to use only APEX APIs
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-17 20:09:19 +00:00
Alec Mouri
26c5fbb065 [AChoreographer] Lift refresh rate callbacks into NDK
Bug: 136262896
Test: ChoreographerNativeTest
Change-Id: Ica2fe31e511045e2007e7d1b3a129e1b8f26f3a7
2020-01-14 08:12:29 -08:00
Automerger Merge Worker
b0ec4f6bde Merge "Add AConfiguration_getScreenRound." am: c44bffa46a am: 7a93b588c0 am: 42c621eea9
Change-Id: Id7632e38f4d49cdfd50d8c745dd232ba486d74fd
2019-12-20 02:33:05 +00:00
Elliott Hughes
241393a30b Add AConfiguration_getScreenRound.
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-18 14:30:46 -08:00
Alec Mouri
2ae4572e6a Merge "[AChoreographer] Consolidate AChoreographer source files" 2019-11-14 19:00:45 +00:00
Jiyong Park
d0c8d9bd22 Rename # vndk tag to # llndk
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 a9258ab2e1)
Change-Id: I7ae77e232ec25cbe7afd98d1b68fc7a7fcf9bdfd
2019-11-13 05:51:59 +00:00
TreeHugger Robot
224bccea58 Merge "Rename # vndk tag to # llndk" 2019-11-13 00:31:32 +00:00
Alec Mouri
440c5ac251 [AChoreographer] Consolidate AChoreographer source files
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-11 15:38:02 -08:00
Stan Iliev
aaa9e834d4 Decouple SurfaceTexture from HWUI
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-08 15:37:17 +00:00
Jiyong Park
a9258ab2e1 Rename # vndk tag to # llndk
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-11-08 11:23:19 +09:00
Seigo Nonaka
01709c7469 Make AFont_getLocale work
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-29 19:53:35 +00:00
atrost
5076854633 Add userId to the package name API.
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-22 21:10:53 +01:00
TreeHugger Robot
69a5323a46 Merge "Add userId to the package name API." 2019-10-22 19:57:55 +00:00
atrost
ff948d8a2f Add a native aidl API.
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-22 18:54:13 +00:00
atrost
53bca9377d Add userId to the package name API.
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-22 18:57:08 +01:00
Valerie Hau
d4dac416ae Merge "Adding transformHint to callbacks" 2019-10-22 16:13:59 +00:00
Valerie Hau
ec453e1423 Adding transformHint to callbacks
Bug: 141939598, 133512804
Test: build, boot, manual
Change-Id: I58411368e5187b3a23eb9e8ac9abbf1cb1a5d97e
2019-10-21 14:43:28 -07:00
atrost
874883536a Add a native aidl API.
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-10-17 11:53:47 +01:00
Valerie Hau
5e18c43fa7 Do not crash on invalid dataspace
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-08-26 14:23:52 -07:00
Vishnu Nair
1ad69541a4 Handle NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY flag in ASurfaceTransaction
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-05-23 09:09:09 +00:00
Marissa Wall
bb9b14f020 ASurfaceControl: fix surface damage
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-23 14:10:15 -07:00
Seigo Nonaka
ddc877300f Pass runMax = 1 to stop unnecessary itemization
Bug: 130044291
Test: N/A
Change-Id: I124b211f9a3db24d4c70c6d6bc0b1a9fdc93b9f7
2019-04-05 15:20:19 -07:00
Seigo Nonaka
b3a7bcea2a Update the system font implementation for new API change
Bug: 129559385
Test: TEMPORARY_DISABLE_PATH_RESTRICTIONS=true m ndk-docs
Test: atest CtsGraphicsTestCases:android.graphics.fonts
Change-Id: I73fd366762e4923886529a49a682cdc1cdceb1aa
2019-04-02 14:28:45 -07:00
Valerie Hau
5a9151e492 Adding AHardwareBuffer lockAndGetInfo to libandroid
Bug: 123423521
Test: build, boot,
android.hardware.nativehardware.cts.AHardwareBufferNativeTests

Change-Id: I81d7fa7352b7720103975ab0910d57953e0a7ec4
2019-03-21 12:39:04 -07:00
Bernie Innocenti
a7de534a93 Merge "Add junyulai@ as owner of the core networking dirs" am: e5e3ac639b am: b0498ba448
am: 6f6fc40839

Change-Id: I5902959b76797a58884480e3fd219ba53497ae8e
2019-03-09 06:04:09 -08:00
Bernie Innocenti
ea89cf2c6e Add junyulai@ as owner of the core networking dirs
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-08 13:04:05 +00:00
Santos Cordon
458d3df21f Add explicit 64-bit postFrameCallback APIs
Bug: 123660572
Test: atest -a android.view.cts.ChoreographerNativeTest
Change-Id: Idff869a435ddb9b858a95993c1e4c6a5c668322f
2019-03-06 16:24:55 +00:00
Ady Abraham
a5a21f70e1 DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGED
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-22 17:54:06 -08:00
Marius Renn
0e636a8b5f Merge "Adds new HardwareBuffer plane-locking functions to NDK" 2019-02-13 01:16:12 +00:00
TreeHugger Robot
5ea4f3ce4e Merge "ASurfaceControl: dataspace (1/2)" 2019-02-11 20:36:39 +00:00
Marissa Wall
7f24f79bc8 ASurfaceControl: dataspace (1/2)
Allow dataspace to be set on the SurfaceControl.

Test: atest CtsViewTestCases:android.view.cts.ASurfaceControlTest
Bug: 80477568
Change-Id: Idc12d0a4024fc21d570c5190af33559b818b4b08
2019-02-08 10:53:56 -08:00
Dominik Laskowski
9e7dce3833 Merge "Generalize physical display management" 2019-02-06 22:46:09 +00:00
Dominik Laskowski
3316a0a08e Generalize physical display management
This CL enables the framework to manage an arbitrary number of physical
displays. It also surfaces physical display IDs, which are stable across
reboots and encode (model, port) information that will be propagated
further up in a follow-up CL.

Bug: 116025192
Test: Boot with more than two displays
Test: Hotplug works with any number of displays
Test: Verify stable display IDs with "dumpsys display"
Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
2019-02-04 10:06:15 -08:00
Valerie Hau
6bc48231fc Combining background color transactions
Bug: 122326454
Test: ASurfaceControlTest cts test
Change-Id: Ie6d6c5d4d8a27cbf936936200d1c81619d83ca87
2019-02-01 13:18:56 -08:00
Peiyong Lin
0d04f32385 Eliminate the usage of ConfigStore.
Ideally modules above SurfaceFlinger should query ConfigStore through
ISurfaceComposer APIs. Previously getWideColorSupport directly evaluate wide
color support for built-in display, we don't want that, we should align it with
SurfaceFlinger.

BUG: 123312783
Test: Build, flash and boot. Verify in logcat.
Change-Id: I6299fe1a5483075a98adbb903d3bb68255afb699
2019-01-24 17:57:50 -08:00
Valerie Hau
5bbfd51757 Add setColor, setColorAlpha, and setColorDataspace to ASurfaceControl
Bug:122326454
Test: atest CtsViewTestCases:android.view.cts.ASurfaceControlTests

Change-Id: If41f0a6b736315dbdb829cf3f8fefc654ede9bcf
2019-01-23 12:12:27 -08:00
TreeHugger Robot
9ce77e9b7f Merge "ASurfaceControl: add more support to NDK (1/2)" 2019-01-22 22:38:20 +00:00