Commit Graph

793 Commits

Author SHA1 Message Date
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
Treehugger Robot
5d518bd50c Merge "AndroidRuntime: when CheckJNI is enabled log a message" am: b0993999eb am: 3ef6e00c42 am: 9369a617bd am: 18c24f350f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1892922

Change-Id: I16c302daf8dc8e7559629672626629147b2803d4
2021-11-16 19:50:05 +00:00
Treehugger Robot
18c24f350f Merge "AndroidRuntime: when CheckJNI is enabled log a message" am: b0993999eb am: 3ef6e00c42 am: 9369a617bd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1892922

Change-Id: I0c05ad1c1248fc48867e8abadfd02cd82c1712a1
2021-11-16 19:34:03 +00:00
Orion Hodson
3d2f62fda8 AndroidRuntime: when CheckJNI is enabled log a message
This matches behaviour described in:
 https://developer.android.com/training/articles/perf-jni#extended-checking

All output from CheckJNI state was disabled as part of quietening
logspam, but now we log a message only if CheckJNI is
enabled. CheckJNI is off by default and only used as a developer
correctness tool.

Bug: N/A
Test: adb root; adb shell stop;                        \
      adb shell setprop dalvik.vm.checkjni 1;          \
      adb shell start; adb logcat -d | grep CheckJNI
Change-Id: I93bc2d097a8769b7768c633b705b29fc1aac634a
2021-11-16 11:11:28 +00:00
Dmitri Plotnikov
fef64ccaec Add LongMultiStateCounter
Bug: 197162116
Test: atest FrameworksCoreTests:LongMultiStateCounterTest
Change-Id: If5af2a7c8d9f56ef5e751aeac4082ac346b276ad
2021-10-15 14:30:00 -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
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
18517e9551 Merge changes from topic "native_hint" into sc-dev am: ea52c87596 am: 9533a3db22
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: If8502e41cbc2cf88b6ed9634741e57f066ab3652
2021-07-22 21:51:12 +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
1d695e8000 Merge "AndroidRuntime: Expose GetJavaVM" am: baba1f7d96 am: ca676985ad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767690

Change-Id: I90a1a27d1cae31106c3729921018d3ae3e8c0490
2021-07-16 17:15:53 +00:00
Yifan Hong
c8a33f1688 AndroidRuntime: Expose GetJavaVM
Add a new header library, libandroid_runtime_vm_headers,
that exposes AndroidRuntimeGetJavaVM.

Test: boots
Bug: 190450693
Change-Id: I64053b56eb1290cff8ea191b1cc592fbc9702ce8
2021-07-15 13:28:52 -07:00
Yifan Hong
861b8a40b0 Merge "Revert "AndroidRuntime: Expose javaAttachThread / javaDetachThread."" am: f5c3de0dbd am: 4bff996531
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767688

Change-Id: I9fc4ca15915092959f05084df938ec52e9813ea4
2021-07-15 09:30:32 +00:00
Yifan Hong
f5c3de0dbd Merge "Revert "AndroidRuntime: Expose javaAttachThread / javaDetachThread."" 2021-07-15 05:48:57 +00:00
Yifan Hong
22fb2aff4d Revert "AndroidRuntime: Expose javaAttachThread / javaDetachThread."
Revert "RpcSession attaches/detaches JVM for Java thread"

Revert submission 1751551-rpc_binder_java_threads

Reason for revert: breaks build
Reverted Changes:
Ifedd34a8c:AndroidRuntime: Expose javaAttachThread / javaDeta...
I23f171dd1:RpcSession attaches/detaches JVM for Java thread

Fixes: 193742361
Fixes: 193742372

Change-Id: I979f676fe17227eefa630e2a169b4f45862f2ae3
2021-07-15 04:49:03 +00:00
Yifan Hong
e1ba2e5fbf Merge "AndroidRuntime: Expose javaAttachThread / javaDetachThread." am: 6b45a9a7b9 am: 1149562e10
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751551

Change-Id: I55d43c99df7b81fc9a8d2c04a8ab8069a95e3c5b
2021-07-14 19:07:57 +00:00
Yifan Hong
6b45a9a7b9 Merge "AndroidRuntime: Expose javaAttachThread / javaDetachThread." 2021-07-14 18:16:57 +00:00
Hans Boehm
01bc036469 Add dalvik.vm.force-java-zygote-fork-loop
Bug: 192020504
Test: Check logcat with and without the flag.
Change-Id: Ia46a011125a6e245bbd9065d708d1f905d56e3af
Merged-In: Ia46a011125a6e245bbd9065d708d1f905d56e3af
(cherry picked from commit f2a815dcbf)
2021-07-02 12:58:12 -07:00
Orion Hodson
30202b7abb AndroidRuntime: pass odsign verification status to ART
ART will refuse to load on-device generated artifacts if odsign
verification status suggests files have been tampered with.

(cherry picked from commit a8b24392a1)

Bug: 180949581
Test: manual
Merged-In: I772b5b7b191310bf7c7797161a304a1ab6f53c5e
Change-Id: Ia0e5ebf4c763678fef55139af60b169f0e6fdeee
2021-07-02 11:57:45 +01:00
Orion Hodson
3e5b9d4ab7 Merge "AndroidRuntime: pass odsign verification status to ART" am: 2d2d5467b5 am: 57b6391e7e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1753263

Change-Id: I33d861b530d78772f5707a9d4e808c023a0702a0
2021-07-02 10:44:29 +00:00
Orion Hodson
2d2d5467b5 Merge "AndroidRuntime: pass odsign verification status to ART" 2021-07-02 10:19:45 +00:00
Hans Boehm
13945aadb5 Merge "Add dalvik.vm.force-java-zygote-fork-loop" am: a8540eebc3 am: 12f589735b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1747950

Change-Id: If85e48ca5743b5fd1bf8e1b36fbcb1372ec1b1f3
2021-07-01 23:36:19 +00:00
Orion Hodson
a8b24392a1 AndroidRuntime: pass odsign verification status to ART
ART will refuse to load on-device generated artifacts if odsign
verification status suggests files have been tampered with.

Bug: 180949581
Test: manual
Change-Id: I772b5b7b191310bf7c7797161a304a1ab6f53c5e
2021-07-01 12:14:47 +01:00
Yifan Hong
fc66783499 AndroidRuntime: Expose javaAttachThread / javaDetachThread.
Add a new header library, libandroid_runtime_threads_headers,
that exposes javaAttachThread / javaDetachThread.

Also change the return value from int to bool, since the client
may not know about JNI_OK.

Test: boots
Bug: 190450693
Change-Id: Ifedd34a8c8a1847d89c9f2f7919ff7e4b13b7446
2021-06-30 19:37:38 -07:00
Hans Boehm
f2a815dcbf Add dalvik.vm.force-java-zygote-fork-loop
Bug: 192020504
Test: Check logcat with and without the flag.
Change-Id: Ia46a011125a6e245bbd9065d708d1f905d56e3af
2021-06-30 15:12:54 -07:00
TreeHugger Robot
cc265a58de Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev 2021-06-18 17:28:19 +00:00
Calin Juravle
576201ad6f Parse dalvik.vm.ps-min-save-period-ms property
Test: adb shell setprop dalvik.vm.ps-min-save-period-ms 300;
Bug: 185979271

Merged-In: I2f30675b335ca0b9b1f1d30144fcdfa4fc680b41
Change-Id: I2f30675b335ca0b9b1f1d30144fcdfa4fc680b41
(cherry picked from commit a2ba369d20)
2021-06-09 13:49:44 +00:00
Calin Juravle
a2ba369d20 Parse dalvik.vm.ps-min-save-period-ms property
Test: adb shell setprop dalvik.vm.ps-min-save-period-ms 300;
Bug: 185979271
Change-Id: I2f30675b335ca0b9b1f1d30144fcdfa4fc680b41
2021-06-03 18:20:38 -07:00
Jaegeuk Kim
a3090d41fe Revert "Revert "Release cblocks back to the free pool""
This reverts commit 516cb2d025.

Reason for revert: Add back after merging f2fs/f2fs-tools changes removing immutable bit stuffs

Bug: 188928405
Change-Id: I6a6fcde1190bff14abe1a67a75b8e7be95d89072
2021-06-03 02:18:11 +00:00
John Tsai
5d1934f765 Merge "Revert "Release cblocks back to the free pool"" into sc-dev 2021-06-03 02:13:03 +00:00
John Tsai
516cb2d025 Revert "Release cblocks back to the free pool"
This reverts commit e41b029d85.

Reason for revert: b/189985437

com.android.tradefed.targetprep.TargetSetupError[APK_INSTALLATION_FAILED|520001|DEPENDENCY_ISSUE]: Failed to install com.android.devicehealthchecks with ...

Change-Id: I06fe7d94f6dab474c74b093de8692f08d4031b62
2021-06-03 02:10:26 +00:00
Svetoslav Ganov
1028eb2f62 Merge "Switch media fw permissions checks to AttributionSource" into sc-dev 2021-06-02 23:07:22 +00:00
Svet Ganov
2eebf92965 Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: (added tests for speech reco)
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 23:43:29 +00:00
Todd Kennedy
e41b029d85 Release cblocks back to the free pool
Modern f2fs implementations starting in S support compression
natively within the file system. The data blocks of specific
installation artifacts [eg. .apk, .so, ...] can be compressed
at the file system level, making them look and act like any
other uncompressed file, but consuming a fraction of the space.

However, the unused space is not free'd automatically. Instead,
we must manually tell the file system to release the extra
blocks [the delta between the compressed and uncompressed block
counts] back to the free pool.

Because of how compression works within the file system, once
the blocks have been released, the file becomes read-only and
cannot be modified until the free'd blocks have again been
reserved from the free pool. For these installation artifacts,
that is not a concern.

Test: atest CtsAppSecurityHostTestCases:SplitTests
Test: atest CtsAppSecurityHostTestCases:IsolatedSplitsTests
Test: atest CtsAppSecurityHostTestCases:PkgInstallSignatureVerificationTest
Test: atest CtsLibnativehelperTestCases
Test: atest PackageManagerTests
Test: Manual. Boot the device and see cblocks for stub APKs are released
Test: Manual. Disable and re-enable stub APK and see cblocks are released
Bug: 188928405
Change-Id: I4b29dab263d02a79d7b1593d35ae28101d33679a
2021-05-28 02:59:47 +00:00
Galia Peycheva
fde81bf229 Add TunnelModeStateListener in java+jni
When tunnel mode is being used (meaning when there
is a sideband stream in one of the layers in SurfaceFlinger), the
blur can't be computed over that layer. In that case, SF blurs are
disabled, which results in a translucent buffer to be drawn.

This CL introduces a listener, which is registered with the
SurfaceFlinger and receives a callback whenever the tunnel mode
enabled state changes. This way, the BlurController can properly send
updates to apps that blurs are disabled/enabled.

Bug: 171457637
Test: atest TunnelModeStateListenerTest
Test: atest TunnelModeStateReporterTest
Change-Id: I6ffba1c342352ad65a32c0efc4ecbc07811245d9
2021-05-17 20:55:19 +02:00
Wessam Hassanein
0e86b445bb Merge "Enable PerfettoJavaHeapStackProf in the zygote." am: 45087d31f8 am: 12dfac6247 am: a431288fbe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1692305

Change-Id: I2a54da650a1e8d35530cdf77a41a338ab90582e6
2021-05-07 03:39:05 +00:00
Wessam Hassanein
45087d31f8 Merge "Enable PerfettoJavaHeapStackProf in the zygote." 2021-05-06 21:08:01 +00:00
Treehugger Robot
56d59c655c Merge "Allow ART profile saver period to be parsed from sys props" am: 44da0f67b4 am: 41cb7914b8 am: 55e2972686
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698088

Change-Id: I00b86c46ef1b48bff084858814ad9457bc55e977
2021-05-06 16:47:06 +00:00
Calin Juravle
f93ecde2fe Allow ART profile saver period to be parsed from sys props
Test: manual

Bug: 184714236
Bug: 185979271
Change-Id: I4ab069e8c4de9f73b7951845e7cb80bc00642e22
2021-05-05 17:15:38 -07:00
Wessam Hassanein
f1d719b0a2 Enable PerfettoJavaHeapStackProf in the zygote.
This allows us to collect Java Heap Profiler data directly without
needing to set the flag similar to PerfettoHprof.

Test: Passing Tests
Local Testing

Bug: 160214819

Change-Id: Id4888107c7b12f076de8237fd42bab49319566b5
2021-05-05 11:55:34 -07:00
Treehugger Robot
24875ce692 Merge "Retire ro.kernel.android.checkjni from AndroidRuntime.cpp" am: 25807e2f86 am: 5609c37a4f am: fcd90b1a1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1670529

Change-Id: I350c527e1fe0a6badddddcfd150f97c7207c570c
2021-04-10 00:05:23 +00:00
Roman Kiryanov
d395df7024 Retire ro.kernel.android.checkjni from AndroidRuntime.cpp
this property is deprecated and emulator now
populates `dalvik.vm.checkjni` to use instead.

Bug: 182291166
Test: getprop dalvik.vm.checkjni
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ie94b0d6c2e48b731d9cfe0ead380e0f52f662f37
2021-04-09 12:46:34 -07:00
John Reck
24acd37203 Merge "HDR info listener" into sc-dev 2021-04-02 20:21:51 +00:00
John Reck
35aa049bc4 HDR info listener
Bug: 182312559
Test: SilkFX listener is called

Change-Id: I2c93f6ab51263a905c17a7afabb845317d33419d
2021-03-31 14:29:03 -04:00
Ioannis Ilkos
228fc0293b Per process DMA-BUF stats
In order to detect memory regressions caused by improper handling of
dma-buf buffers we need to measure how this memory is used.

This change:
- Introduces DmabufInfoReader which wraps libmeminfo and provides
per-process DMA-BUF stats.
- Specifically, measures buffers mapped to the process address space
(from /proc/pid/maps). This is supported on all devices.
- For devices running 5.4+ (where the system processes can query fdinfo)
also measures the total retained memory (either by mmap or an open fd).
- Introduces a statsd atom that collects this for all running managed
processes. Non-managed processes will also hold dmabufs, but the
likelihood of them causing issues (post-launch) is smaller so I am
trading them off for cheaper collection (if indeed we encounter such
problems, they will definitely be caught by the total dmabuf counters).

Test: manual
Bug: 183708249
Change-Id: I5e0ef58ac1a66ebe2d280c5733de46ba84f75a46
2021-03-30 10:38:10 +01:00
Remi NGUYEN VAN
7b6b006f5d Use connectivity APIs from framework-connectivity
Instead of compiling framework-connectivity source into
frameworks-minus-apex, have the APIs loaded separately from
framework-connectivity.

Bug: 171540887
Test: device boots, has connectivity
Change-Id: I8f07ff2082c3de80821e121807e66a43a870de7b
2021-03-25 06:34:52 +00:00