Commit Graph

652 Commits

Author SHA1 Message Date
Marco Nelissen
f0ef85669c Move JetPlayer implemention and JNI
The JetPlayer implementation in libmedia was only used by the
JetPlayer JNI code in libandroid_runtime. This change moves
both implementation and JNI to libmedia_jni. This reduces
libandroid_runtime's dependency on libmedia, and results in
a net size reduction of the libraries involved.

Test: atest JetPlayerTest
Change-Id: I028c774fdea167924b064855267254c15f22fddb
Merged-In: I028c774fdea167924b064855267254c15f22fddb
2019-10-17 21:33:07 +00:00
Mathieu Chartier
a557554def Use APEX boot image for profilebootclasspath
To get profiling info, we need to avoid having compiled code.

Also pass down the --count-hotness-in-compiled-code for measuring
performance in compiled code.

Bug: 139883463
Test: manual
Change-Id: Ib02b476522b7709172fc06d6517446cad59045d4
2019-09-25 15:55:40 +00:00
vichang
4a09c691bf Merge "Check ANDROID_I18N_ROOT when starting the runtime" 2019-09-25 12:01:15 +00:00
Victor Chang
3079c6c74b Check ANDROID_I18N_ROOT when starting the runtime
Bug: 137009149
Test: treehugger
Change-Id: I0f34d433c73a44c051724769067bd6ccf5d4a0db
2019-09-24 14:55:02 +01:00
Martin Stjernholm
5bbffbc827 Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change.
Test: Boot
Bug: 135753770
Change-Id: I930027fb0ad18d9d06165bbfbfe54d88bc28530d
2019-09-20 16:14:22 +01:00
Mathieu Chartier
d5f1fed45f Merge "Add phenotype property for enabling profiling of boot class path"
am: eb247e7abf

Change-Id: Ie09d3490e8da9712e2af70499295866c8c4975a8
2019-08-23 20:02:00 -07:00
Mathieu Chartier
58f4208dc1 Add phenotype property for enabling profiling of boot class path
If specified, does the same behavior as the dalvik.vm.profilebootimage
property used to do. The new property is called profilebootclasspath
and is in the runtime_native_boot namespace.

Added logic to pass down Xjitsaveprofilinginfo if profilebootclasspath
is specified.

Bug: 139883463
Test: adb shell setprop dalvik.vm.profilebootclasspath true
Test: look at logcat to verify the right options are passed down

(cherry picked from commit 7253961bd0)

Merged-In: I3e2ec37931a6f9239c5d0fa9fcaea61637061ac1
Change-Id: Iab2118822e522f9f80016c2c6ad42af9cd7eba03
2019-08-22 13:06:26 -07:00
Mathieu Chartier
fd36670bd0 Merge "Remove support for image classes" am: 566bfcf475
am: e8131249e5

Change-Id: I52062c008a9b658471e4adfca8d5d116dd35790c
2019-06-28 09:49:41 -07:00
Mathieu Chartier
96fab6e32d Remove support for image classes
--image-classes is no longer supported by ART.

Test: make
Change-Id: I2d2a26594ab61a59237db730dd402ab9e53ecfab
2019-06-27 15:43:39 -07:00
Nicolas Geoffray
b06bed082a Merge "Pass to the runtime the primary zygote option." am: c9bcf869db
am: e21b8c9b57

Change-Id: I8285b5822b45f3d817ed9b1cf0fa269ec646f5b9
2019-06-14 01:43:06 -07:00
Nicolas Geoffray
ce4f5c44dd Pass to the runtime the primary zygote option.
Will be used to customize when methods get JITted in jitzygote mode.

Test: boots
Bug: 119800099
Change-Id: Ib6c70cccfd1be6c867319cf78b5b2e4aec00bc80
2019-06-13 16:06:13 +01:00
David Sehr
f47b38277a Merge "Add system option to disable lock profiling" am: b1ec00b5ea
am: f7da2c5812

Change-Id: I6e9c783a346d181fef7446beedf324de1e40daae
2019-05-31 07:37:52 -07:00
David Sehr
26a6427c44 Add system option to disable lock profiling
Disable lock profiling to test for overhead.

Bug: 133257467
Test: build
Change-Id: Ida5f83e626c82266de69b13dc2def0477cc87b0f
2019-05-30 18:04:16 -07:00
Chiachang Wang
a3d942b43f Public StatsLog API for generic mainline logging.
This is a cherry pick to aosp.

Sets up a public api for logging atoms to statsd. The API excepts a
buffer which is already encoded in the proper format for the socket, as
well as the number of bytes of the buffer to write. It performs a JNI
call to perform the socket write. Autogenerated app code will be built
for each mainline module that needs to use this API to log.

Test: builds
Test: existing logs flow properly
Bug: 126134616
Change-Id: I8a9a91e638d730e3ff69cb9345692e49e0db3c96
Merged-In: I8a9a91e638d730e3ff69cb9345692e49e0db3c96
2019-04-16 10:22:38 +08:00
David Brazdil
34bf2fc088 Merge "Pass core platform API policy property to ART" am: e4f9b348a5
am: 14432304bf

Change-Id: Ibd933c855553c2061661973bda365c22a92501dd
2019-04-12 09:22:53 -07:00
David Brazdil
1e58e8e3d7 Pass core platform API policy property to ART
When starting ART, read property
""persist.debug.dalvik.vm.core_platform_api_policy" and pass its value
on the command line. This enables users to enable core platform API
violation reporting on demand. Note that the settings take effect after
a reboot.

Bug: 125701194
Test: compiles, boots, reporting observed
Change-Id: I97507afc85d8e186736700979c5dbf2ad0f79f12
2019-04-12 11:18:07 +01:00
Orion Hodson
02440d3b1b Use libnativehelper to get access to NIO buffer internals
Changes to android_opengl_* are generated by editing glgen stubs and
re-running gen script.

Bug: 124338141
Test: atest CtsGraphicsTestCases

(cherry picked from commit 61783592df)

Change-Id: I179f90177c8b1b50a923baecef3b5071a9a25ccf
Merged-In: I715123e66f4ace1d6a11a42c8eafc1d02995e88b
2019-04-11 16:51:33 +01:00
Chenbo Feng
061cec7755 Move NetworkStatsFactory into service directory
In order to notify netd to swap eBPF maps before pulling the
networkStats from eBPF maps, NetworkStatsFactory need to use the
NetdServices to issue binder calls. So it need to be moved from
framework/base/core to framework/base/service since object in
framework/base/core cannot get any system services. This change is also
necessary for setting up a lock inside NetworkStatsFactory to prevent
racing between two netstats caller since the lock need to be hold before
netd trigger the map swap.

Also fix the compile problem caused by moving the NetworkStatsFactory
and the related tests. Rename the packages and the jni functions to a
more proper name.

Bug: 124764595
Bug: 128900919
Test: NetworkStatsFactoryTest
      android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
2019-04-03 14:28:41 -07:00
Chenbo Feng
f2f1f27098 Move NetworkStatsFactory into service directory
In order to notify netd to swap eBPF maps before pulling the
networkStats from eBPF maps, NetworkStatsFactory need to use the
NetdServices to issue binder calls. So it need to be moved from
framework/base/core to framework/base/service since object in
framework/base/core cannot get any system services. This change is also
necessary for setting up a lock inside NetworkStatsFactory to prevent
racing between two netstats caller since the lock need to be hold before
netd trigger the map swap.

Also fix the compile problem caused by moving the NetworkStatsFactory
and the related tests. Rename the packages and the jni functions to a
more proper name.

Bug: 124764595
Bug: 128900919
Test: NetworkStatsFactoryTest
      android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Merged-In: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
Change-Id: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
2019-04-03 11:33:40 -07:00
Tej Singh
e5f5a10478 Merge "Public StatsLog API for generic mainline logging." 2019-03-23 05:00:52 +00:00
Neil Fuller
69b90a4a6a Merge "Require the ANDROID_TZDATA_ROOT env var" am: f6c4aa1f67 am: 20fd6bdc01
am: 1f36ba9bef

Change-Id: I57438a71f9de6d18cc94734437af723c8747f4e3
2019-03-21 12:13:37 -07:00
Tej Singh
be0482b421 Public StatsLog API for generic mainline logging.
Sets up a public api for logging atoms to statsd. The API excepts a
buffer which is already encoded in the proper format for the socket, as
well as the number of bytes of the buffer to write. It performs a JNI
call to perform the socket write. Autogenerated app code will be built
for each mainline module that needs to use this API to log.

Test: builds
Test: existing logs flow properly
Bug: 126134616
Change-Id: I8a9a91e638d730e3ff69cb9345692e49e0db3c96
2019-03-20 17:44:53 -07:00
Neil Fuller
b99050d89c Require the ANDROID_TZDATA_ROOT env var
The ANDROID_TZDATA_ROOT serves a similar purpose to the
ANDROID_RUNTIME_ROOT: it determines the location that can be used to
find time zone data files. Since the Android Core Library will soon
require it to be set it makes sense to check it alongside the
ANDROID_RUNTIME_ROOT variable.

Bug: 128422035
Test: build / boot
Change-Id: Ie4860f60760905a06a744bd48fd773d0a4e8cf6d
2019-03-14 14:36:42 +00:00
François Gaffie
adcd00a7c8 AudioVolumeGroup introspection & callback JAVA APIs
This CL adds introspection APIs for Audio Volume group
and callback notification on group volume change.
It allows to keep the same level of service available today
in CarAudioManager and is a starting point to get rid of Stream Alias
hard coded in AudioServer.

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: I48909df93c146f071acd24cd3ecc608cb98b4d7e
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-27 16:21:27 -08:00
Nicolas Geoffray
83624df78e Merge "Query the enable_apex_image flag from native experiment." am: ed74814369 am: 32498c5c0c
am: d63481be77

Change-Id: Ib41e65bd247e2b5c620b72ca024aab868f8f6ea6
2019-02-26 03:52:14 -08:00
Nicolas Geoffray
7a6a0dab57 Query the enable_apex_image flag from native experiment.
Bug: 119800099
Test: m
Change-Id: I730ffaae640ad6c427b3fbc898d838af0962fe5f
2019-02-25 14:25:26 +00:00
Roland Levillain
72a1815e6f Replace generic GC type flag with a specific Generational CC flag.
The "gctype" device configuration flag (from the "runtime_native_boot"
namespace) was a string passed verbatim as an argument to the runtime
option "-Xgc". It was too generic, conveyed no typing information, and
was error-prone (there was no control over what was passed from the
server to the zygote, and then to the runtime).

This change replaces "gctype" with a specific, Boolean
"enable_generational_cc" flag. This new flag better reflects the
nature of the experiment to be conducted (either enable or disable
generational garbage collection in ART's concurrent copying
collector).

Test: core/jni/runtime_native_boot-flags-test.sh
Bug: 72446017
Bug: 120794191
Bug: 123754583

(cherry picked from commit 72b16f0ad0)

Change-Id: I5f30f38914bb44d6ce9dc6870ee2c566ce66278a
Merged-In: I30a73171c0dc3c7bc891c4f164eed0ba42b0f420
2019-02-25 14:25:12 +00:00
Roland Levillain
688ed594ba Read "gctype" flag from namespace "runtime_native_boot".
ART does not support changing the garbage collector type/configuration
dynamically at the moment, so we can only change it when the runtime
starts, i.e. at boot time.

Also materialize "gctype" and "runtime_native_boot" as named constants.

Bug: 120794191
Bug: 72446017
Test: adb shell device_config put runtime_native_boot gctype nogenerational_cc && adb reboot
Test: adb shell device_config put runtime_native_boot gctype generational_cc && adb reboot

(cherry picked from commit 7b098c8487)

Change-Id: Ied0eacf46ab92ba128d0a538a314f42c18c5b8f5
Merged-In: Ibf765a5f442136d6327be99786ea9ae4b4537d59
2019-02-25 14:24:45 +00:00
Mathieu Chartier
28cfcec6f6 Add gctype device config property for GC experiments
Added to the runtime_native namespace.

The new property overrides dalvik.vm.gctype if it's set.

Bug: 120794191
Test: adb shell device_config put runtime_native gctype CC,preverify
Test: adb reboot

(cherry picked from commit d2a975adb5)

Change-Id: I9ca29e9a5a0c94234fb14a725334dae82171679b
Merged-In: I30a2a3bcfb83f502f168c0d8588d80982a5f7d76
2019-02-25 14:17:57 +00:00
TreeHugger Robot
6944910037 Merge "Add CompositionSamplingListener" 2019-02-20 23:44:26 +00:00
Adrian Roos
9b963d3ce4 Add CompositionSamplingListener
Adds a facility to sample the median luma in a region
of the SurfaceComposer's result.

Test: atest CompositionSamplingListenerTest
Bug: 124305231
Change-Id: I78eececa9aef420f488a860f4e6891d4af84d27f
2019-02-20 15:16:36 +01:00
Roland Levillain
ede2b3bdc3 Merge "Replace generic GC type flag with a specific Generational CC flag." 2019-02-20 10:57:14 +00:00
TreeHugger Robot
e6e13284bf Merge "Add Introspection API to retrieve AudioProductStrategies" 2019-02-20 10:51:30 +00:00
Roland Levillain
72b16f0ad0 Replace generic GC type flag with a specific Generational CC flag.
The "gctype" device configuration flag (from the "runtime_native_boot"
namespace) was a string passed verbatim as an argument to the runtime
option "-Xgc". It was too generic, conveyed no typing information, and
was error-prone (there was no control over what was passed from the
server to the zygote, and then to the runtime).

This change replaces "gctype" with a specific, Boolean
"enable_generational_cc" flag. This new flag better reflects the
nature of the experiment to be conducted (either enable or disable
generational garbage collection in ART's concurrent copying
collector).

Test: core/jni/runtime_native_boot-flags-test.sh
Bug: 72446017
Bug: 120794191
Bug: 123754583
Change-Id: I30a73171c0dc3c7bc891c4f164eed0ba42b0f420
2019-02-20 10:46:55 +00:00
François Gaffie
c01fa3a7de Add Introspection API to retrieve AudioProductStrategies
Bug: 124767636
Test: Build
Change-Id: I24b95f11217e80310d123c7183bdcb0e17b5f02b
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-19 19:17:42 +00:00
Nicolas Geoffray
8b9abc98b5 Merge "Add a dalvik.vm.boot-image option for zygote and installd." am: 80e697a297 am: f2bcd619a1
am: bda2cb3b18

Change-Id: Ia60c8b93f1dec2285d2d539377e49b8bf79f7734
2019-02-19 07:03:10 -08:00
Nicolas Geoffray
79eeb98d74 Add a dalvik.vm.boot-image option for zygote and installd.
Bug: 119800099
Test: adb shell setprop dalvik.vm.boot-image "/system/framework/boot.art"

Change-Id: Iccafc56b5c95e848efca2699e16306a26d856478
2019-02-14 15:56:15 +00:00
Roland Levillain
7b098c8487 Read "gctype" flag from namespace "runtime_native_boot".
ART does not support changing the garbage collector type/configuration
dynamically at the moment, so we can only change it when the runtime
starts, i.e. at boot time.

Also materialize "gctype" and "runtime_native_boot" as named constants.

Bug: 120794191
Bug: 72446017
Test: adb shell device_config put runtime_native_boot gctype nogenerational_cc && adb reboot
Test: adb shell device_config put runtime_native_boot gctype generational_cc && adb reboot
Change-Id: Ibf765a5f442136d6327be99786ea9ae4b4537d59
2019-02-05 01:36:54 +00:00
Mathieu Chartier
d2a975adb5 Add gctype device config property for GC experiments
Added to the runtime_native namespace.

The new property overrides dalvik.vm.gctype if it's set.

Bug: 120794191
Test: adb shell device_config put runtime_native gctype CC,preverify
Test: adb reboot

Change-Id: I30a2a3bcfb83f502f168c0d8588d80982a5f7d76
2019-01-29 18:08:12 -08:00
François Gaffie
b4691282f2 audio: add JNI AudioAttribute helper class
-Factorize code between AudioRecord & AudioTrack
-Prevent memory leak

Test: Audio capture and playback smoke tests

Change-Id: I06a06cd607754fbbc3e74dd38a66994873c8d9d1
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-01-28 18:17:51 +00:00
TreeHugger Robot
fd8f7cd721 Merge "Correct jni declarations of input handle" 2019-01-24 03:31:28 +00:00
Riddle Hsu
cd958bcca9 Correct jni declarations of input handle
InputWindowHandle and InputApplicationHandle are moved from
com.android.server.input to android.view since commit 788f574.
The related jni declarations should also change to match the
java package for the invocation from java side.

Bug: 111440400
Test: atest WindowStateTests
      Observe no UnsatisfiedLinkError in log

Change-Id: Iea4a1bfee25484d3633a8c4860106378908fd2fa
2019-01-23 07:48:39 +00:00
Brian Duddie
cfa5b5b63c Revert "Remove Activity Recognition from the Android Code."
This reverts commit e24f1b095b.

Reason for revert: b/123172409

Change-Id: Ic5863a8e8b36c8c4d8636cc4c004ad9606a3f523
2019-01-22 18:02:36 +00:00
Leon Scroggins
a1809f383d Merge "ColorSpaces have native SkColorSpaces" 2019-01-22 14:32:11 +00:00
Ashutosh Joshi
e24f1b095b Remove Activity Recognition from the Android Code.
Removing AR from the Android code base. We had already severed the
connection to the AR HAL in Android Oreo. This change simply removes all
unused references and uses of the stubs.

Test: Build compiles. Ensure that clients that provide AR through other
channels continue to work.

Change-Id: I79d19c0bd2b80962cdecc8ad88065911fd6311ac
2019-01-18 22:31:53 +00:00
Leon Scroggins III
0e443d1633 ColorSpaces have native SkColorSpaces
Bug: 120904891
Bug: 122844033
Bug: 122514935
Test: CtsGraphicsTestCases

Create an SkColorSpace when creating an android.graphics.ColorSpace.Rgb.
This allows simplifying getNativeColorSpace, so that each time we need
it, we do not need to call back up into Java or reconstruct the
SkColorSpace.

Funnel all ColorSpace.Rgb constructors into one, so we can set a final
mNativePtr in the base constructor. Update TransferParameters to also be
final.

Use the same TransferParameters as SRGB in EXTENDED_SRGB and DISPLAY_P3.

When passing a BitmapFactory.Options to native, call getNativeInstance()
(which may throw an Exception) and pass the result to native.

Move native ColorSpace code into its own file.

Make Paint methods @CriticalNative again, now that they do not need the
JNIEnv.

Remove unused decodeBitmap.

Change-Id: I60adbb060b87ab6f92559f1217bfefc0b9ea72e1
2019-01-18 16:19:48 -05:00
Svet Ganov
8455ba2341 Historical app ops.
This change is the main check in for the historical app op feature.
The idea is to store a historical data about past app op rejections,
accesses, and durations per op for any UID state indefinitely.

Keeping all operations on record is not practical as app ops are
very frequently performed. To address this we are storing aggregated
data as snapshots where we store for every UID and its packages
how many times each op was accessed, rejected, lasted as an aggregate.

To allow history scaling indefinitely we are taking a logarithmic
approach with only the most recent state stored in memory and all
preceding state stored on disk. State on disk is stored in separate
files where each preceding file, i.e. for an older period, would
cover X times longer period with X number of snapshots covering
X times longer period. Initially X is ten but can be tweaked. For
example, the first file could contain data for ten days with daily
snapshots, while the file for older period would have data
for a hundred days with snapshots every ten days, etc.

The implementation is optimized for fast history update and no impact
on system runtime performance and minimizing memory footprint. We
are lazily persisting state to disk on a dedicated thread as this is
slow. We are also reading the relevant historical files on a query
as this is very rare as opposed to state updates.

The base snapshot interval, i.e. snapshot time span, in the initial
iteration and the logarithmic step are configurable. These can be
changed dynamically and the history would be rewriten to take this
into account.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I55c32c79911ba12b2ace58d2a782b8df1e6bff60
2019-01-10 19:31:31 -08:00
Eric Laurent
7c31847e08 AudioSystem JNI: refactor audio effect descriptor conversion
Factorize native to JAVA audio effect descriptor conversion and
place in separate library so that it can be reused by components outside
of AudioEffect class.

Bug: 111438757
Test: make and run CTS tests for AudioEffects
Change-Id: I11eb13cfc08abb8d94ce30ab0d702df04943e1be
2018-12-11 13:53:41 -08:00
Neil Fuller
a068624dce Merge "Make ANDROID_RUNTIME_ROOT a required env variable" am: 6dc466fd3a am: 84cbaf603e
am: beb24a9764

Change-Id: Iebc2f4a8769f2f2da5459862cb2d6370dd105c83
2018-12-04 05:34:21 -08:00
Neil Fuller
3ce4ccec69 Make ANDROID_RUNTIME_ROOT a required env variable
Make ANDROID_RUNTIME_ROOT a required environment variable
for AndroidRuntime.cpp.

Bug: 119935277
Test: build / treehugger
Change-Id: I1098b4d7de8a8642ca5f431ec56a3f086f22b44f
2018-11-29 19:28:02 +00:00