Commit Graph

819 Commits

Author SHA1 Message Date
Martin Stjernholm
c40ba07dda Merge "Remove dalvik.vm.usejitprofiles system property." 2022-12-01 20:30:55 +00:00
Martin Stjernholm
13f3767498 Remove dalvik.vm.usejitprofiles system property.
Disabling profiles is no longer supported. Most of the profile support
has been active even when this property was false, and it won't be
supported in the ART Service.

Test: Boot with dalvik.vm.usejitprofiles=false
Bug: 254434433
Change-Id: I27e0639ba71ea794a5770263c4d357c52531a99a
2022-11-24 17:26:59 +00:00
felkachang
1039d61b36 Add OverlayManagerImpl to create frro, idmap and get overlayInfos
Add OverlayManagerImpl to let applications create frro and idmap files
for overlaying itself's android resources.
* OverlayManagerImpl.java
  * check the FabricatedOverlayInternal.
* com_android_internal_content_om_OverlayManagerImpl.cpp
  * convert and read Java objects to native data.
  * call the APIs in libidmap2 to create frro and idmap files.

Add OverlayManagerImpl.cpp into AndroidRuntime by modifying Android.bp
* Add register_com_android_internal_content_om_OverlayManagerImpl
  register JNI methods
* add com_android_internal_content_om_OverlayManagerImpl.cpp
    * It's a adapter to delegate the tasks to SelfTargeting.cpp
    * dynamic link with libidmap2 by using dlopen and dlsym to call
      functions in libidmap2.

Add SelfTargeting.cpp into libidmap2
* createFrroFile
* createIdmapFile
* getFabricatedOverlayInfo

for interoperability between libandroid_runtime and libidmap2.
* move OverlayManifestInfo from libidmap2 to libandroidfw
* add FabricatedOverlayEntryParameters into libandroidfw

Bug: 205919743

Test: build
Test: atest \
                  OverlayHostTests \
                  OverlayDeviceTests \
                  SelfTargetingOverlayDeviceTests \
                  OverlayRemountedTest \
                  FrameworksServicesTests:com.android.server.om \
                  CtsContentTestCases:android.content.om.cts \
                  idmap2_tests

Change-Id: I5425f3229e9a3858e57427ef84e6abaf32e89b6e
2022-11-24 10:09:07 +08:00
Sally Qi
fed0301271 Plumb overlayPropertes into DMS side.
- Implement OverlayProperties JNI class
- Call getOverlaySupport() on Diaplay Manager. Inside, provide
  SurfaceControl#getOverlaySupport api to call AIDL function in the back
  end.

Bug: 242588489
Test: build and flash
Change-Id: I23819d21063cd191a06d92295af2be9132bfe1df
2022-11-15 11:08:28 -08:00
Treehugger Robot
0daf902a23 Merge "Fix the logic of parsing profilebootclasspath flags." am: f84d9caba4 am: b5ef8c6fb5 am: 4026cc3ed5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2297438

Change-Id: I0b39466bc7dd1ee7cfa11f1a96082c332bfdf75d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 20:23:20 +00:00
Jiakai Zhang
b3c55fcf55 Fix the logic of parsing profilebootclasspath flags.
There are two pieces of code that parse profilebootclasspath sysprops:
one in ZygoteInit.java
(https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/com/android/internal/os/ZygoteInit.java;l=359;drc=6cbc807a6f11f43054d0d0ff0221bb3e6ab35d1c)
and one in AndroidRuntime.cpp
(https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/jni/AndroidRuntime.cpp;l=704-714;drc=ff1ed5d78df2edaaf1e51e2434548a66cd124366).

Before this change, there are two inconsistencies between them:
1. AndroidRuntime.cpp prefers the "dalvik.vm" property, while
   ZygoteInit.java prefers the phenotype flag.
2. AndroidRuntime.cpp only accepts "true", while ZygoteInit.java accepts
   "1", "y", "yes", "on", and "true".
The device goes into a weird state when the flags are set in a way that
makes the two pieces of code disagree with each other.

This CL changes the logic in AndroidRuntime.cpp to make it the same as
the one in ZygoteInit.java.

Bug: 258486155
Test: -
  1. adb shell setprop dalvik.vm.profilebootclasspath false
  2. adb shell setprop dalvik.vm.profilesystemserver false
  3. adb shell device_config set_sync_disabled_for_tests persistent
  4. adb shell device_config put runtime_native_boot profilebootclasspath true
  5. adb shell device_config put runtime_native_boot profilesystemserver true
  6. adb shell stop && adb shell start
  7. adb shell killall -USR1 system_server
  8. adb shell profman --dump-only --profile-file=/data/misc/profiles/cur/0/android/primary.prof
  9. See the boot image profile being properly generated.
Test: -
  1. adb shell setprop dalvik.vm.profilebootclasspath 1
  2. adb shell setprop dalvik.vm.profilesystemserver 1
  3. adb shell stop && adb shell start
  4. adb shell killall -USR1 system_server
  5. adb shell profman --dump-only --profile-file=/data/misc/profiles/cur/0/android/primary.prof
  6. See the boot image profile being properly generated.
Change-Id: Ifef5a45b47427bc16e0799046bdffc5ab1747e9a
2022-11-10 17:02:02 +00:00
Vova Sharaienko
f7df9bd7a2 Merge "[TeX] Introduced Telemetry Express Logging APIs" am: 42bf7a986d am: 05c391241f am: 6e80081112
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2272886

Change-Id: Ib1933ab27fb42cb200059f7f0d655e2716741686
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 20:13:38 +00:00
Vova Sharaienko
ff1ed5d78d [TeX] Introduced Telemetry Express Logging APIs
- provided Java Counter metric logging API

Bug: 247803110
Test: m
Change-Id: Ib154f8fda2c136a62f4a90fb2b14b816233d3b47
2022-11-02 20:22:03 +00:00
Treehugger Robot
19ba99d34b Merge "Remove libandroid_runtime_vm_headers" am: 3bf2c7e440 am: b62d913cac am: 056b960732
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2268626

Change-Id: Ib5ad5d31ece4ea3b8d27e87f6f4d1cb81115bdaf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-27 15:38:46 +00:00
Jeongik Cha
b7ba45bcaa Remove libandroid_runtime_vm_headers
libbinder doesn't use the headerlib anymore, so remove this lib

Bug: 254459965
Test: m
Change-Id: Iaa0c466b267c6e8010a49980ac20b52622b90261
2022-10-25 11:41:22 +09:00
Chavi Weingarten
17decaa679 Use NativeAllocationRegistry instead of finalizer for SurfaceControl
Finalizer has unclear ordering and can cause issues when cleaning up.
Use NativeAllocationRegistry as a safer option.

Test: CtsGraphicsTestCases
Fixes: 248273657
Change-Id: I8c8e1773c7d49c31b59ae4f7a88e44b2d6ee7f13
2022-10-10 17:47:04 +00:00
Lee Shombert
3e4d9f2007 Record resource access times
Bug: 246953799

Collect timing information for resource acquisition methods.  The
timing has nanosecond resolution and is collected inside the native
runtime code.  Timing values are accumulated in the runtime and are
periodically fetched and published by the java framework.  This
strategy means that normal resource methods incur a small runtime
overhead.  The longer time involved in publishing the values is
handled by an independent Java thread.

A public dumpTimers() method can be called from a dumpsys command, for
debug, but the dumpsys command is not hooked up in this commit.

No APIs are actually monitored in this commit, and the ResourceTimer
loop is not started.

Test: atest
 * androidfw_lib

Change-Id: I5995d3c6518ca2fa4c8ab9d3eb610167758c695d
2022-09-18 18:05:03 -07:00
Chavi Weingarten
2b7f2aee30 Migrate screen capture code to ScreenCapture file
Test: ScreenshotTests
Bug: 242714168
Change-Id: I8061f1717cc4e293ee07672d6d415c2c36010ccd
2022-09-14 15:35:46 +00:00
Eric Biggers
e7783f6371 AndroidRuntime: stop checking for CryptKeeper mode
Since support for Full Disk Encryption was removed in favor of
File Based Encryption, "CryptKeeper mode" no longer exists and the
"vold.decrypt" system property is never set.  Therefore, remove the
unused code from AndroidRuntime::startVm() that set special Java
compiler options in CryptKeeper mode.

Bug: 208476087
Change-Id: I099c199ec4132cd1859255c27c5d97367261cf43
2022-04-12 01:49:40 +00:00
Nicolas Geoffray
1c8eb0109f Merge "Move GraphicsStatsService native method registration to zygote." am: e420bd2635 am: ad7ab1f419 am: 1d7298bcec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2011395

Change-Id: I0f2206fee839f0f20fc465fdd4845d9eda7000f5
2022-03-10 19:41:01 +00:00
Nicolas Geoffray
e420bd2635 Merge "Move GraphicsStatsService native method registration to zygote." 2022-03-10 18:34:29 +00:00
Nicolas Geoffray
13f1f45e1e Move GraphicsStatsService native method registration to zygote.
It used to be in system server, but this is for a class in boot
classpath so we can move it to AndroidRuntime.cpp and avoid system
server dirtying memory for these methods.

Test: m
Bug: 162110941
Change-Id: Ifda5957aab757fe47c97b1aee0a6a8b7a059ac3d
2022-03-07 16:44:50 +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
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
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
368fe9230c Merge "Update JIT Zygote image option." am: 6c8544e068 am: f4e1f24f70 am: 9030aacbc2 am: 9f617fda43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1931584

Change-Id: I423c59dc5436bbbb7a6bb235f3ad64aec2db2d8b
2021-12-24 16:57:40 +00:00
Treehugger Robot
9f617fda43 Merge "Update JIT Zygote image option." am: 6c8544e068 am: f4e1f24f70 am: 9030aacbc2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1931584

Change-Id: Ic6c1f64c63a8361409833f30fba3570d5ad112d7
2021-12-24 16:39:00 +00:00
Jiakai Zhang
5e6fa85a96 Update JIT Zygote image option.
Bug: 203492478
Test: manual -
  1. Build a system image and flash it to a device.
  2. adb shell setprop dalvik.vm.extra-opts '-verbose:image'
  3. adb shell setprop dalvik.vm.profilebootclasspath true
  4. adb shell setprop ctl.restart zygote
  5. See the boot image extension being compiled in memory
     (http://gpaste/4688561208033280).
Change-Id: I69c11e3e41b9ab142b427ee054c2a6275ff089de
2021-12-24 11:47:39 +00: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
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