373 Commits

Author SHA1 Message Date
Richard Gaywood
3be5773ec9 Implement puller for new SurfaceFlinger dmabuf stats.
Involves pushing most of the logic down out of StatsPullAtomService
and into KernelAllocationStats.cpp, as well as changing some method
signatures along the way.

At the end of this work, two new fields in atoms.proto will be
populated; these will allow us to tell how much of SurfaceFlinger's
dmabuf memory usage is due to buffers shared with other processes
and how much is due to private internal buffers.

Test: statsd_testdrive 10105
Test: adb shell dmabuf_dump
Bug: 220084049
Change-Id: Ia41cfd693d3db2bd06083801075cae290f67221f
2022-03-17 12:07:09 +00:00
Colin Cross
24e387ae49 Merge "Tweak linux_glibc properties for musl builds in frameworks/base" am: ee415b6dd4 am: 0465454af5 am: 8927c1f94e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2019598

Change-Id: I33e43c2b80acf35e7f9790d82c98d38bf2134697
2022-03-15 05:02:57 +00:00
Colin Cross
e8f6f0becc Tweak linux_glibc properties for musl builds in frameworks/base
For convenience, builds against musl libc currently use the
linux_glibc properties because they are almost always linux-specific
and not glibc-specific.  In preparation for removing this hack,
tweak the linux_glibc properties by either moving them to host_linux,
which will apply to linux_glibc, linux_musl and linux_bionic, or
by setting appropriate musl or linux_musl properties.  Properties
that must not be repeated while musl uses linux_musl and also still
uses the linux_glibc properties are moved to glibc properties, which
don't apply to musl.  Whether these stay as glibc properties or get
moved back to linux_glibc later once the musl hack is removed is TBD.

Bug: 223257095
Test: m checkbuild
Test: m USE_HOST_MUSL=true host-native
Change-Id: I7058c8f1dadd7bbfd7e169bdf0a0441eb6d10ec5
2022-03-09 16:31:28 -08:00
Junyu Lai
2f00b07355 [MS54.1] Move NetworkStats to updatable sources am: 6b708138c1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987467

Change-Id: I97311b503c0f959ed98199c89c6a7b657ab8be43
2022-02-28 06:26:49 +00:00
Junyu Lai
6b708138c1 [MS54.1] Move NetworkStats to updatable sources
This CL builds NetworkStats related code with the
connectivity module instead of platform.

This includes:
1. Add netstats.proto to the module.
2. Add lib dependencies for all callers.
3. Include several source files in platform and add jarjar rule
   to it. Modify callers accordingly.

Test: TH
Bug: 197717846
Change-Id: I244693aebe1782d9e67502638ff8145c51462e1e
Merged-In: I244693aebe1782d9e67502638ff8145c51462e1e
2022-02-18 16:20:47 +08:00
Jerome Gaillard
7c3f628615 Merge "Update definition and loading of host libandroid_runtime" 2022-02-16 16:44:38 +00:00
Xin Li
a6a261b1be Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:12 +00:00
John Reck
529ee8aa30 Merge "Add ability to make SyncFence from EGL" 2022-02-14 14:05:05 +00:00
Maciej Żenczykowski
10120266d6 remove libbpf_android from libandroid_runtime
since it's not actually ever used at runtime,
it's only meant to be part of the bpfloader boot time one shot binary.

(all non-bpfloader bpf implementation is in .h files only)

Test: TreeHugger, m libandroid_runtime
Bug: 218882781
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8d3b8ac80ffdbe293221150f7272f7def80fc1c4
Merged-In: I8d3b8ac80ffdbe293221150f7272f7def80fc1c4
2022-02-11 16:53:03 +00:00
Maciej Żenczykowski
3200f4216b remove libbpf_android from libandroid_runtime
since it's not actually ever used at runtime,
it's only meant to be part of the bpfloader boot time one shot binary.

(all non-bpfloader bpf implementation is in .h files only)

Test: TreeHugger, m libandroid_runtime
Bug: 218882781
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8d3b8ac80ffdbe293221150f7272f7def80fc1c4
2022-02-11 07:44:47 +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
John Reck
1ce46f750a Add ability to make SyncFence from EGL
Bug: 217776226
Test: atest android.graphics.cts.EGL15Test#testEGL15AndroidNativeFence
Change-Id: I5e1356739831f63426521561c45e719fc5f419d9
2022-02-10 19:48:45 -05:00
Jerome Gaillard
7aa5cfb433 Update definition and loading of host libandroid_runtime
This will allow layoutlib to correctly link and run native code from
libandroid_runtime.

Bug: 208827022
Test: N/A
Change-Id: I372d157042ba2e7a491b82b0fa520937ff0c8e74
2022-02-10 15:41:27 +00:00
Junyu Lai
a8f1f762eb [MS54.1] Move NetworkStats to updatable sources
This CL builds NetworkStats related code with the
connectivity module instead of platform.

This includes:
1. Add netstats.proto to the module.
2. Add lib dependencies for all callers.
3. Include several source files in platform and add jarjar rule
   to it. Modify callers accordingly.

Test: TH
Bug: 197717846
Change-Id: I244693aebe1782d9e67502638ff8145c51462e1e
2022-02-07 11:45:17 +09:00
Lorenzo Colitti
34209090dc Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline" am: ec7461850f am: 101bbfd2a2 am: e6dd1b01db am: 5f8c7c2abe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964912

Change-Id: Ie5bdbb43340b8866dff6a68d0375ea2e065e9ba6
2022-01-31 14:39:04 +00:00
Lorenzo Colitti
5f8c7c2abe Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline" am: ec7461850f am: 101bbfd2a2 am: e6dd1b01db
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964912

Change-Id: I6aeb7c5a17dc10232c6fe678330b7a9185c03f9b
2022-01-31 14:36:21 +00:00
Lorenzo Colitti
d0a17ee9d5 Move socket tagging implementation to mainline.
Currently, socket tagging is implemented in the framework. The
Java code is in NetworkManagmentSocketTagger.java and the JNI is
in libandroid and loaded by the general framework JNI loader.

- Move the Java implementation to TrafficStats, which is the only
  caller of NetworkManagmentSocketTagger. This simplifies the
  code a bit because a number of methods can be deleted.

- Move the JNI code to a new JNI library in the APEX. The library
  depends only on the NDK and statically links the NDK-only
  version of libnativehelper. Its size is only 5k on ARM and 10k
  on ARM64.

- Temporarily make the framework depend on this library until the
  rest of the T connectivity code moves to the APEX.

Test: atest NetworkUsageStatsTest CtsNetTestCases:TrafficStatsTest
Change-Id: I050c7c515237f68b78d08987bc443f50a7949c06
2022-01-30 15:59:44 +09:00
Ken Chen
1569dd7a0a Merge "Delete libnetdbpf from linked libs used by libandroid_runtime" am: e0b5cb4c91 am: 2c73071f79 am: 85094a4f40 am: 152f95dd6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956981

Change-Id: Ia7b75ac63472757016b69a9e307078478fc68acb
2022-01-24 04:59:54 +00:00
Ken Chen
152f95dd6a Merge "Delete libnetdbpf from linked libs used by libandroid_runtime" am: e0b5cb4c91 am: 2c73071f79 am: 85094a4f40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956981

Change-Id: I374d4ecb567974705ff1065f4ad0eadedb413aaa
2022-01-24 04:41:27 +00:00
Ken Chen
f6ec5cb588 Delete libnetdbpf from linked libs used by libandroid_runtime
libandroid_runtime does not depend on libnetdbpf

Bug: 202086915
Test: m
Change-Id: I4aab43851b1b3e4faada147d9e70f39777d74648
2022-01-23 17:26:07 +08:00
Peiyong Lin
399e06d648 Raise SurfaceControlFpsListener to System API.
Previously the SurfaceControlFpsListener is a hidden API which only
allows platform code access. This patch renames it to follow the
callback convention and raises it to be a system API in order to allow
system applications to access the FPS count of a task and its children.
The FPS count access is guarded by a permission ACCESS_FPS_COUNTER.

To follow the API convention and properly check the permission, the
register/unregister callback APIs are moved to WindowManager and
permission check is done in the System Server.

Minor: Rename to SurfaceControlFpsCallback to TaskFpsCallback in order
to follow the API naming convention.

Bug: b/199920468
CTS-Coverage-Bug: b/199920468
Test: atest TaskFpsCallbackTest
Change-Id: I6b0a0ad6500278b3da09059e9c2ede28d9a743aa
2022-01-21 09:18:08 +00:00
Treehugger Robot
6320361b43 Merge changes I4753cae7,Ic6554d9b am: d752b7b746 am: 4a14072d74 am: 11e76f17a2 am: e221b4b21f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1948287

Change-Id: I5090eb2aaa01047bdf63e949073ce21fbc77df6d
2022-01-13 10:38:15 +00:00
Treehugger Robot
e221b4b21f Merge changes I4753cae7,Ic6554d9b am: d752b7b746 am: 4a14072d74 am: 11e76f17a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1948287

Change-Id: If337e342c64b0867c8789a5fdfd7a33abb197515
2022-01-13 10:24:44 +00:00
Ken Chen
846fd78c06 Calling NDK version of tagSocket/untagSocket
Calling NDK version of tagSocket/untagSocket from
android_server_NetworkManagementSocketTagger.cpp. This is required since
the file is going to be mainlined. The platform functions it calls must
be stable APIs.

Bug: 29761778
Bug: 202086915
Test: atest TrafficStatsTest NetworkUsageStatsTest

Change-Id: Ic6554d9b98cef9b41b7eae06315d284c574c0a45
2022-01-12 23:21:51 +08:00
Ioannis Ilkos
cc793ab608 Read per-process GPU memory when pulling ProcessMemorySnapshot
This is an eBPF usermap read via libmeminfo. System server
already has permissions to do so (as it already does so for the
total GPU mem stats).

Change-Id: I9e3c4dc9144708c630215e309b7ff394abbdcd76
Test: manual, statsd_testdrive 10064
Bug: 208440056
2021-11-30 17:24:48 +00:00
Yifan Hong
512278bbae Merge "Revert "libandroid_runtime_vm_headers is recovery_available."" am: d69e2b3f13 am: 65f0c883ff am: d24e3c5c42 am: 6a667dcc52 am: 9eac3de696
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1876123

Change-Id: I32d61555d8c1813a048451cb1531c20658427bfd
2021-11-02 19:28:45 +00:00
Yifan Hong
9eac3de696 Merge "Revert "libandroid_runtime_vm_headers is recovery_available."" am: d69e2b3f13 am: 65f0c883ff am: d24e3c5c42 am: 6a667dcc52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1876123

Change-Id: I95490a206353811c683f0267d67ba1d6e07360be
2021-11-02 18:43:33 +00:00
Yifan Hong
0091946349 Revert "libandroid_runtime_vm_headers is recovery_available."
This reverts commit 08e2895ade6af39aa5b9feb72698ee233e7efcb6.

Reason for revert: shouldn't be used in recovery

Change-Id: I2ac8918800b577fc37c1e0ea459ffc872847f60f
2021-10-30 05:43:01 +00:00
Yifan Hong
ab4d8240b5 Merge "libandroid_runtime_vm_headers is recovery_available." am: 4084f95dbc am: 3011d154c5 am: 3e7945e753 am: 5b454f7e58 am: ca6a67a46d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1866395

Change-Id: I02a2396566248aedf6aeac6c8f9d1cb457915564
2021-10-28 03:57:52 +00:00
Yifan Hong
ca6a67a46d Merge "libandroid_runtime_vm_headers is recovery_available." am: 4084f95dbc am: 3011d154c5 am: 3e7945e753 am: 5b454f7e58
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1866395

Change-Id: Ic064fe7a4f7e725c4aafb5693c1ffe1bf509fba9
2021-10-28 03:56:15 +00:00
Yifan Hong
08e2895ade libandroid_runtime_vm_headers is recovery_available.
This is needed by libbinder.

Test: builds
Bug: 170338625
Change-Id: I761515bfd91c0cb7bbc72401787c5988b6b9f05a
2021-10-20 21:48:47 -07:00
Dmitri Plotnikov
fef64ccaec Add LongMultiStateCounter
Bug: 197162116
Test: atest FrameworksCoreTests:LongMultiStateCounterTest
Change-Id: If5af2a7c8d9f56ef5e751aeac4082ac346b276ad
2021-10-15 14:30:00 -07:00
Dmitri Plotnikov
e5292b4a24 Make LongArrayMultiStateCounter parcelable
Bug: 197162116
Test: atest FrameworksCoreTests:LongArrayMultiStateCounterTest
      atest CorePerfTests:LongArrayMultiStateCounterPerfTest

Change-Id: Ibc94620f2f106695fa7f17fc0737496f0e32ba48
2021-09-14 12:40:56 -07:00
Android Build Prod User
60a7931da6 Merge changes from topic "fix-b-188932434-common-types-2"
* changes:
  Move common audio AIDL types to audio.media.audio.common
  MediaFormat: Add more audio MIME types
  Add android.media.audio.common.AidlConversion class
2021-08-25 15:24:06 +00:00
Mikhail Naganov
1571010b20 Move common audio AIDL types to audio.media.audio.common
The following types are being moved from 'android.media':
 - AudioChannelLayout
 - AudioFormatDescription
 - AudioFormatType
 - PcmType

AudioChannelLayout replaces legacy-based AudioChannelMask type.
AudioFormatDescription replaces legacy-based AudioFormat type.
Updated conversion functions.

Bug: 188932434
Test: atest AidlConversionUnitTests
Test: atest SoundHw2CompatTest
Test: atest SoundTriggerMiddlewareImplTest
Change-Id: Id002177f6b7f651389b59b0f476e6e2d28be4592
2021-08-24 14:27:11 -07:00
Eric Laurent
aab0de3c0a Merge "AudioSystem JNI: Add support for spatializer APIs" into sc-v2-dev am: 8c500d5882 am: af8b4f4dc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15557293

Change-Id: Icb020b315920d12fd96515e5fe0136ce20dffef2
2021-08-24 16:20:36 +00:00
Eric Laurent
af8b4f4dc2 Merge "AudioSystem JNI: Add support for spatializer APIs" into sc-v2-dev am: 8c500d5882
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15557293

Change-Id: I32955fb8cdff488ed3cf1ec6a48f8f3173d05c91
2021-08-24 16:00:38 +00:00
Eric Laurent
8500f6c136 AudioSystem JNI: Add support for spatializer APIs
Add support for the following APIs in AudioSystem JNI:
- getSpatializer
- canBeSpatialized

Bug: 188502620
Test: make
Change-Id: I1942edc6c9fec3babfe870586f7a014d55b1ce70
2021-08-24 13:47:03 +02:00
Dmitri Plotnikov
7058a51deb Merge "Add LongArrayMultiStateCounter" 2021-08-24 00:06:46 +00:00
Dmitri Plotnikov
2f618d1bab Add LongArrayMultiStateCounter
Bug: 197162116
Test: atest FrameworksCoreTests:LongArrayMultiStateCounterTest
Test: atest CorePerfTests:LongArrayMultiStateCounterPerfTest

Change-Id: I3e20aa1a64b6bb89658c57c74487f95681d4f0ff
2021-08-20 18:30:44 -07:00
Chavi Weingarten
fa445d02b5 Merge "Add Java and JNI WindowInfosChangedListener hooks to register with SCC" into sc-v2-dev am: 7a72cac392
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14932260

Change-Id: I46253be073fe586c6d376f67addf4de8ba910509
2021-08-13 23:04:47 +00:00
chaviw
296c6554a0 Add Java and JNI WindowInfosChangedListener hooks to register with SCC
Bug: 188792659
Test: Existing tests pass
Change-Id: I0a6fa58e1c8648bf1d9d30f5e2c59e056a07cb88
2021-08-11 14:09:05 -05:00
TreeHugger Robot
495abb7eab Merge changes from topic "native_hint" into sc-dev am: ea52c87596
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: I805e930ede0c22bbcbec62d1b0738dd7c91f5dc5
2021-07-28 14:44:51 +00:00
Yifan Hong
ae046c051d Merge "Remove apex_available on libandroid_runtime_vm_headers" into sc-dev-plus-aosp am: f5e111d389
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15341830

Change-Id: I187cf01319df44794ec1857cc6c42ae877ef5a4f
2021-07-26 18:53:12 +00:00
TreeHugger Robot
dfa32b6bf0 Merge changes from topic "native_hint" into sc-dev am: ea52c87596 am: 2194851f5c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: If0a6ed03108a1ae793cbba0abcdd78e6331c25b3
2021-07-26 18:52:23 +00:00
Yifan Hong
f5e111d389 Merge "Remove apex_available on libandroid_runtime_vm_headers" into sc-dev-plus-aosp 2021-07-22 22:38:33 +00:00
TreeHugger Robot
2194851f5c Merge changes from topic "native_hint" into sc-dev am: ea52c87596
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: I8dde7d37c30d756108b007dd0cf09de057f4b913
2021-07-22 21:33:26 +00:00
Bo Liu
0b2ad9f70d Implement java PerformanceHintManager on top of native
Note some exceptions became silence errors in this conversion.

Test: None
Bug: 194204196
Change-Id: Ia3cc7f2396f2e307a23b40b3f104a2fa90352196
2021-07-22 11:33:13 -04:00
Yifan Hong
59254c74f6 Remove apex_available on libandroid_runtime_vm_headers
Dependency of media APEXes on libbinder has been
cleaned up. Hence, there's no need to make
libandroid_runtime_vm_headers apex_available to
these APEXes.

Fixes: 193742372
Test: TH

Change-Id: Ide613376b94e1680ab7e26ef5cb975a80c44fb01
2021-07-20 21:59:26 +00:00
Yifan Hong
d1c856bbd7 Merge "AndroidRuntime: Expose GetJavaVM" am: baba1f7d96 am: ca676985ad am: 1d695e8000
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767690

Change-Id: I4929e20cce1b2159a5259fada5d1194e7fa13383
2021-07-16 17:17:24 +00:00