Commit Graph

394 Commits

Author SHA1 Message Date
Bo Liu
80c690554a Merge "Rename SC ndk jni API" 2022-11-14 21:07:31 +00:00
Bo Liu
23af702a13 Rename SC ndk jni API
Rename to ASurfaceControl_fromJava / ASurfaceTransaction_fromJava.

Test: Compiles
Bug: 258245761
Change-Id: Ic9cedd83bad3facb46947ecdac6324f4318d8db6
2022-11-11 15:01:01 -05:00
Matt Buckley
354cc0a140 Add support for ADPF HintSession sendHint to JNI
* Add sendHint API to HintManagerService and PerformanceHintManager
 * Plumb relevant calls through the existing implementation
 * Extend existing tests to cover new API calls
 * Update the relevant build files to use power API v4

Bug: b/243973548
Test: atest PerformanceHintNativeTestCases
Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
Test: atest HintManagerServiceTest

Change-Id: Ice7ed8f32e877bd845afad77fcc6ae16f1a1b78c
2022-11-09 01:49:41 +00:00
Bo Liu
dd89c3b56e SurfaceControl ndk-jni API review
ASurfaceControl_fromSurfaceControl should acquire a reference before
returning.

Abort if the arguments are invalid, make the return code nonnull.

Test: ASurfaceControlTest#testSurfaceControl_fromSurfaceControl
      and ASurfaceControlTest#testSurfaceTransaction_fromTransaction
Bug: 253053203
Change-Id: If48ff4a534c5765c4831e518e44f77d0429e8981
2022-10-12 13:08:35 +00:00
Rob Carr
88fa84315b Merge "surface_control NDK: Track frameworks/native changes" into tm-qpr-dev am: 1d3ecebe6c am: 9f4876b6a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20058993

Change-Id: I31c393482d6f285809d033a168f57cef07993697
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-30 18:05:08 +00:00
Rob Carr
9f4876b6a6 Merge "surface_control NDK: Track frameworks/native changes" into tm-qpr-dev am: 1d3ecebe6c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20058993

Change-Id: I46d358e2f2334f224292ccd774f5b57055c37f70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-30 17:32:06 +00:00
Treehugger Robot
a74a1546b8 Merge changes Ifd00d8d4,Id8db2858 am: eb3651fe72 am: a2ba909c39 am: 71db43c5e2 am: 419f137b85 am: 68099d357b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2212407

Change-Id: If0d77d1808f215970bd6bd63aad66794d482e16d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-28 02:52:25 +00:00
Spandan Das
76d971d0d6 Declare the headers of the ndk_library
This creates a dependency edge between the ndk_library and its headers,
which should be a no-op in regular Soong builds. This dependency edge
will be used in the Multi-tree project to export the relevant .h files into a well
known location

The headers are in a different git project (frameworks/native)

Test: m nothing
Bug: 239044713
Change-Id: Ifd00d8d4d3771b2dbd924cea4f2ade0bafc15ed6
2022-09-27 16:58:15 +00:00
Rob Carr
7c70373e25 surface_control NDK: Track frameworks/native changes
A BBQ changes requires adding an additional member to
SurfaceControlStats which requires updating this destructuring
assignment.

Bug: 247246160
Test: Existing tests pass
Change-Id: Ic485fe3ae97c4243ab9993717c674c66b28c7fee
2022-09-27 01:00:08 +00:00
Harry Cutts
2d6d757b00 Merge "Add input owners of native/android/input.cpp" 2022-09-26 14:41:15 +00:00
Harry Cutts
ee431fc08b Add input owners of native/android/input.cpp
Test: none
Change-Id: Ieee0ab493130eba7d825d463cfbdae4369db165c
2022-09-26 14:33:56 +00:00
Harry Cutts
339b0ee4f7 Merge "Add CLASSIFICATION_TWO_FINGER_SCROLL for touchpad scrolling" 2022-09-26 14:19:40 +00:00
Harry Cutts
7013c869e6 Add CLASSIFICATION_TWO_FINGER_SCROLL for touchpad scrolling
This will be used to denote the single-finger touches that
TouchInputMapper creates to simulate scrolling when the user makes
two-finger swipes on the touchpad.

Bug: 246758376
Test: check new value is sent to a test app when scrolling on a touchpad
Change-Id: Id93cba764522e36d850f7013ab8a117f64716fac
2022-09-23 13:38:21 +00:00
Bo Liu
789103b97a NDK methods to get SurfaceControl/Transction from java
Test: ASurfaceControlTest#testSurfaceControl_fromSurfaceControl
      and ASurfaceControlTest#testSurfaceTransaction_fromTransaction
Change-Id: Ic15bfaae22b50f70c1c82c8945c09b749654a00f
2022-09-17 16:17:08 -04:00
Kriti Dang
4bfeeb4ec5 Add Surface.clearFrameRate API
This API is same as using setFrameRate with 0 as frame-rate value. But
this causes confusion, as the remaining two arguments are ignored, when
frame-rate is 0.

Bug: 241096917
Test: android.graphics.cts.SetFrameRateTest#testClearFrameRate
Change-Id: I1324c64ac75dacb78a733df2b91d7a5b46fc7455
2022-08-26 16:29:25 +02:00
Kohsuke Yatoh
1e62e215d4 Consolidate getFamilyAt() calls to minikin.
- Typeface: Use FontCollection::createCollectionWithFamilies() instead
  of creating fallback list inside hwui.
- system_fonts: Use SystemFonts::getFontSet() intead of getFontMap().

Bug: 174672300
Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest
Test: atest CtsGraphicsTestCases:android.graphics.fonts.NativeSystemFontTest
Change-Id: I940f8de441b7bd102eca2d08bc5dd4d0fc4a2685
2022-08-20 03:50:57 +00:00
Kohsuke Yatoh
146c6a93d7 Replace getFamilies() with getFamilyAt().
Following minikin signature change.

Bug: 174672300
Test: m libhwui
Test: m libandroid
Change-Id: I25c5d27c406f49b5ee91a7f4390484296d4a6c7f
2022-07-20 21:48:22 +00:00
Jimmy Shiu
e1cf4b7601 Merge "Send the hint immediately when actual > target" into tm-dev am: 49c95b1618 am: 92a6873890
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17011864

Change-Id: I3b5d080d3acc0b0908ee70be7d6818d9b6b81058
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 14:55:04 +00:00
Wei Wang
9f174f4bbb Send the hint immediately when actual > target
Send the hint immediately when actual duration is longer than target
duration.

Test: boot
Bug: 198379880
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I6c80940b27d65a1e34e40f61eef3f81990957711
2022-04-19 17:19:54 +00:00
Huihong Luo
36b55bc2ac Sync with ISurfaceComposerClient changes
ISurfaceComposerClient in libgui is migrated to AIDL interface.

Bug: 172002646
Test: atest libgui_test
Change-Id: I5301a710a84bcf90ca4a789e184748e889115045
2022-04-07 20:53:48 +00:00
Huihong Luo
4fed9b4544 Sync with FrameTimelineInfo aidl migration
libgui FrameTimelineInfo has been converted to aidl  parcelable.

Bug: 222537482
Test: atest libgui_test libsurfaceflinger_unittest SurfaceFlinger_test
Change-Id: I6bf8433d7786485faef61633917659cca5d7f512
2022-04-05 15:20:02 -07:00
Ken Chen
72d6df3c6f Merge "Update data type and comments on tagSocket/untagSocket APIs" am: ef89731cd3 am: aa82affbc0 am: 292d5f01ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2049804

Change-Id: Id759de693eb64fe729c99b141d267790767a806c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 04:10:28 +00:00
Ken Chen
9c315eb11f Update data type and comments on tagSocket/untagSocket APIs
- Fix comment in version script to say LL-NDK, not NDK
- Use uint32_t for tag

Bug: 223423155
Test: CtsNetTestCases:android.net.TrafficStatsTest
Test: CtsNativeNetPlatformTestCases
Change-Id: Ifb819ed0adeb8f173b98c3f131a4bf2e0715dd4e
2022-03-31 00:28:15 +08:00
Austin Borger
db9165baf2 Add new onUidProcAdjChanged callback to be consumed by the camera
service.

The camera service needs to know when individual process oom adj scores
are changed in order to address bug #124224342. When two separate
processes are displayed in split screen and focus is switched between
them, both proc states will remain the same while their oom scores
change. This is a problem if both have access to the camera - we want
only one owner of the camera stream at any given time and for the app
in focus to be the one to own it.

This patch adds a new IUidObserver registration level for individual
process oom score changes. In addition a new callback has been added to
IUidObserver to track these changes.

Change-Id: I68d964f474d20f819f54b614a4e314ce00aac8fb
Bug: 124224342
Test: -- ActivityManagerServiceTest
      -- ActivityManagerProcessStateTest
      -- ActivityManagerFgsBgStartTest
      -- UidObserverControllerTest
      -- NetworkPolicyManagerServiceTest
      -- ShortcutManagerTest2
      -- HintManagerServiceTest
      -- VibrationSettingsTest
      -- CameraEvictionTest#testCamera2AccessCallbackInSplitMode (x100)
2022-03-28 19:46:45 -07:00
Eric Biggers
4fb38d5fc3 Merge "Remove broken code for mounting encrypted OBB files" am: a4f24f08b0 am: 56c37e5778 am: 089a351d31
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003052

Change-Id: I87cbb67af5e1dc62ddbb8ff7d58a256ee4569b44
2022-03-04 22:11:49 +00:00
Eric Biggers
56c37e5778 Merge "Remove broken code for mounting encrypted OBB files" am: a4f24f08b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003052

Change-Id: Id027c555af21e46922a1c0ce29195d95bb7bb876
2022-03-04 21:27:43 +00:00
Eric Biggers
8bc9340b4c Remove broken code for mounting encrypted OBB files
Mounting encrypted OBB files has never worked reliably across devices,
partly due to its reliance on Twofish encryption support in the kernel.
This is because Twofish support (CONFIG_CRYPTO_TWOFISH) has never been
required or even recommended for Android.  It has never been enabled in
GKI, but even before GKI it wasn't required or recommended.  Moreover,
this is now the only Android feature that still uses dm-crypt
(CONFIG_DM_CRYPT), and some devices don't have that enabled either.

Therefore, it appears that this feature is unused.  That's perhaps not
surprising, considering that the documentation for OBBs
(https://developer.android.com/google/play/expansion-files) says that
they are deprecated, and also it explains OBBs as being app files that
are opaque to the platform; the ability of the platform to mount OBBs
that happen to be in a particular format is never mentioned.  That means
that OBB mounting is probably rarely used even with unencrypted OBBs.
Finally, the usefulness of OBBs having their own encryption layer (in
addition to what the platform already provides via FBE) is not clear
either, especially with such an unusual choice of cipher.

To avoid the confusion that is being caused by having the broken code
for mounting encrypted OBBs still sitting around, let's remove it.

Test: atest StorageManagerTest # on Cuttlefish
Test: atest StorageManagerIntegrationTest # on Cuttlefish
Bug: 216475849
Change-Id: I6e6a6462ab8343299dc5e0145b87dc28b16b0bc1
2022-03-04 04:51:54 +00:00
TreeHugger Robot
92553f3ce8 Merge "Use start time in SurfaceControl setFrameTimeline." into tm-dev 2022-03-02 19:17:38 +00:00
Bo Liu
9acc558c29 adpf: Use one client token per process for all hint sessions
So it doesn't leak when gc is delayed in service process.

Update HintManagerService to allow multiple sessions tied to the same
token.

Bug: 218129784
Test: chrome no longer gets killed
Change-Id: I67a66041cc67d01e4cfcd3ded303a1bed6050f60
2022-03-01 12:04:06 -05:00
Rachel Lee
b6c93aa789 Use start time in SurfaceControl setFrameTimeline.
Users of the API will see in the "Actual Timeline" the actual start time
rather than expected start time.

Bug: 210043506
Test: perfetto log of with & w/o CL, using Chromium apk, bug 198192946
Change-Id: I013bf6e28de32c82c9d645cc4cacf0cc01e0dd9f
2022-02-26 01:23:00 +00:00
Rachel Lee
a52e963d38 Merge "Rename to VsyncCallback & presentation time." 2022-02-17 19:49:55 +00:00
Rachel Lee
1a44c62b74 Rename to VsyncCallback & presentation time.
Bug: 217370454
Test: atest ChoreographerNativeTest
Change-Id: Icf460a82c1f59e930bdfc456e4a75ae341ce4394
2022-02-15 18:25:11 -08:00
Vaibhav
e85c348731 Add implementation for new NDK functions added to input.h
Added new methods for getActionButton and getClassification in input.h.
In this CL we are adding implementations for the corresponding functions

Test: atest android.view.cts.MotionEventTest

Bug: 213266814

Change-Id: Ia7c7b83fe19bac7d5e5c7c107e86328e160ba2b5
2022-02-14 16:19:45 +00:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Ady Abraham
5f7f72779e Merge "surface_control: handle acquire fence on BLAST callbacks" 2022-02-10 18:29:24 +00:00
Treehugger Robot
5c816689a9 Merge "Adjust base/native/android OWNERs" am: d8f74421fb am: 82e8873cba am: e7eb1dce20 am: 8fb92de72b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1977192

Change-Id: I6ddf92eed85ae95a902fc1d1781e67d157b5d2d8
2022-02-10 17:58:08 +00:00
Treehugger Robot
8fb92de72b Merge "Adjust base/native/android OWNERs" am: d8f74421fb am: 82e8873cba am: e7eb1dce20
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1977192

Change-Id: I19f032cabc787356be291a500e639d223ddf41a2
2022-02-10 17:37:21 +00:00
Treehugger Robot
e7eb1dce20 Merge "Adjust base/native/android OWNERs" am: d8f74421fb am: 82e8873cba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1977192

Change-Id: Ifc576cf8e977102786755a7abeb0c8686ae5c9c5
2022-02-10 17:22:13 +00:00
John Reck
f91696e2c3 Adjust base/native/android OWNERs
Test: N/A
Change-Id: Ieb263e6b57b5e4495d45e6c22ac1f97cb1ca7913
2022-02-09 10:11:56 -05:00
Erik Staats
13ca5df169 Add ASensorManager_getDynamicSensorList.
Bug: 217890463
Test: Used uhid-sample to add a dynamic sensor and verified it can be
 used with sensor_test.
Change-Id: Ia930c6993c97527381d30e33f817f37632cb8396
2022-02-08 14:20:32 -08:00
Treehugger Robot
7096d45f59 Merge "Really expose the new NDK socket tagging functions added in T." am: cba72fc987 am: fd5bb81c8a am: f30f967e5a am: 4bc8cb7628
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1967301

Change-Id: Ia93a3556b209aa214233952b838c2e0ca3aeaddb
2022-02-02 16:45:01 +00:00
Treehugger Robot
4bc8cb7628 Merge "Really expose the new NDK socket tagging functions added in T." am: cba72fc987 am: fd5bb81c8a am: f30f967e5a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1967301

Change-Id: Ibf59d43165b336b52030103a3e9e3b95872197c8
2022-02-02 16:24:42 +00:00
Treehugger Robot
f30f967e5a Merge "Really expose the new NDK socket tagging functions added in T." am: cba72fc987 am: fd5bb81c8a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1967301

Change-Id: Ifd16b2ccf8a2fd85d963aa08243385e094aa7c9b
2022-02-02 16:09:35 +00:00
Lorenzo Colitti
2b9e8860ec Really expose the new NDK socket tagging functions added in T.
These functions were already exposed as part of libandroid_net,
but that is not really part of the NDK.

Expose them in libandroid as well, so apps can actually use them.
This is consistent with all the other native networking APIs,
which are exposed in both libandroid_net and libandroid.

Test: atest CtsNativeNetPlatformTestCases
Test: strings out/target/product/bramble/system/lib64/libandroid.so | grep android_tag
Change-Id: I2273cdd48b30a88b82eb3af838031d9fe8897442
2022-02-02 11:59:41 +00:00
Bo Liu
77f35083d1 Merge "Performance hint ndk APIs" 2022-01-28 18:57:27 +00:00
Rachel Lee
abe5a0016f Merge changes from topic "scdocs"
* changes:
  Use AVsyncId typedef in hwui.
  Use AVsyncId typedef.
2022-01-24 19:54:35 +00:00
Ady Abraham
62e15f0a20 surface_control: handle acquire fence on BLAST callbacks
When latching unsignaled buffers, the acquire fence is
not signaled by the time BLAST callback is invoked. In
that case pass a fence instead. For latch signaled, we still
pass the acquire time itself to avoid sending file descriptors
over binder.

Bug: 198190384
Test: TBD
Change-Id: I949fd396ec36ee759327a952239509d10259be1b
2022-01-21 17:01:03 -08:00
Rachel Lee
7e47b3dd7d Use AVsyncId typedef.
Test: atest ASurfaceControlTest
Bug: 214063411
Change-Id: I5dd6a0e467f3acc46bf4ce65dde0df265b590697
2022-01-14 15:38:18 -08:00
Rachel Lee
4832a69444 Merge changes from topic "achoreonanos"
* changes:
  Update hwui with renamed AChoreographer method.
  Update libandroid renamed AChoreographer methods.
2022-01-13 22:44:31 +00:00
Rachel Lee
545adcd1f7 Update libandroid renamed AChoreographer methods.
Test: atest ChoreographerNativeTest
Bug: 214303753
Change-Id: I32d9703c669b2408dddd199c678fca0564668142
2022-01-13 14:14:25 -08:00