Commit Graph

623 Commits

Author SHA1 Message Date
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
Paul McLean
b3ae6d9490 Move JNI init for OpenSLES audio routing to system startup.
Moved AudioTrack.CHANNEL_COUNT_MAX and AudioTrack.native_get_FCC_8() to AudioSystem.

Bug: 115560661
Test: build/install/run native audio routing CTS
Change-Id: I03b14a0302aa0d6a1bc78f4daf5a521446042f66
2018-11-27 14:00:34 -07:00
Courtney Goeltzenleuchter
367ed8b190 Update to EGL 1.5
Test: compile
Bug: 80239516
Change-Id: I1c00ac5e55900260b724e1c298edca15f87f3a01
(cherry picked from commit 63584195b9d15daa9973d280381fd619cd7a0f89)
2018-10-16 14:10:20 -06:00
Seigo Nonaka
70200b0f56 Make LineBreaker public
This CL includes:
- Move NativeLineBreaker/NativeMeasuredParagraph to android.graphics.text
package since these two uses the shaping result of the text which is a
part of graphics responsibility. At the same time, by this moving,
minikin is only used by android.graphics package.
- Rename NativeLineBreaker/NativeMeasuredParagraph to
LineBreaker/MeasuredText.
- Updated comments of the break strategy and hyphenation frequency.

Bug: 112327179
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: Id69c328e7c9097b9fc11b5c0bd04d1c2e0939c6a
2018-10-09 12:16:52 -07:00
Steven Moreland
bc600d3282 Merge "Implementing support for HIDL native handles in Java" am: 1e1d8d2485 am: 6580802918
am: 4a6566440f

Change-Id: I649a10172d93beae9063ec2170e60aa4967ba0be
2018-08-14 10:16:06 -07:00
Nirav Atre
9850dd9751 Implementing support for HIDL native handles in Java
This change implements the equivalent of the C++ native_handle_t type in
Java. Similar to the C++ type, the NativeHandle class wraps an arraylist
of FileDescriptor objects, along with a raw data stream (integer array).

Bug: 35098567
Test: Ran m, hidl_test (C++ and Java). Functionality tests are included
in a separate CL.

Change-Id: Ic53f9a49ae17ce5708577a586230126ab0e222c7
2018-08-13 14:31:17 -07:00
Seigo Nonaka
88930f1df4 Introduce FontFamily and its builder
This CL is a ground work of the new Typeface construction API and
nobody uses this class except for CTS now.
I'll add new builder in Typeface to be able to create Typeface
from this FontFamily.

Bug: 72665240
Test: atest FontFamilyTest
Test: CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I15d412c367037554d911fc9e20c0cfb44aefb89a
2018-08-02 11:04:44 -07:00
Seigo Nonaka
a1b12c82a1 Merge "Introduce Font and its builder class" 2018-07-29 03:16:22 +00:00
Seigo Nonaka
6f11c6e7e2 Extract native methods into isolated classes
StaticLayout/MeasuredParagraph uses native methods which is a pain point
of porting TextView to JetPack.
To make minimize the dependency to the native methods, extract native
methods and put them into a thin wrapper class.

The performance impact is limited:

android.text.StaticLayoutPerfTest:
    PrecomputedText Balanced Hyphenation  :    602 ->    644: ( +42, +7.0%)
    PrecomputedText Balanced NoHyphenation:    457 ->    476: ( +19, +4.2%)
    PrecomputedText Greedy Hyphenation    :    397 ->    412: ( +15, +3.8%)
    PrecomputedText Greedy NoHyphenation  :    397 ->    411: ( +14, +3.5%)
    RandomText Balanced Hyphenation       : 17,594 -> 17,715: (+121, +0.7%)
    RandomText Balanced NoHyphenation     :  7,146 ->  7,236: ( +90, +1.3%)
    RandomText Greedy Hyphenation         :  7,125 ->  7,196: ( +71, +1.0%)
    RandomText Greedy NoHyphenation       :  7,099 ->  7,187: ( +88, +1.2%)
  draw
    PrecomputedText NoStyle               :    614 ->    628: ( +14, +2.3%)
    PrecomputedText Style                 :    778 ->    826: ( +48, +6.2%)
    RandomText NoStyle                    :    537 ->    540: (  +3, +0.6%)
    RandomText Style                      :    786 ->    759: ( -27, -3.4%)

Bug: N/A
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I976df4db63be241af395dd30dd94182f76bdae53
2018-07-27 11:08:43 -07:00
Seigo Nonaka
a1c21c0a02 Introduce Font and its builder class
This CL is a ground work of the new Typeface construction API and
nobody uses this class except for CTS.
I'll add FontFamily class to be able to bundle these Font clases
and register to the Typeface.

Bug: 72665240
Test: atest FontTest
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I68555a8b4bd6dd770ba7baae72d9a3777b2087a5
2018-07-26 16:38:44 -07:00
Andreas Gampe
eb4e1736e3 Merge "Framework: Disable native-bridge for non-zygote" am: 05c09faad2 am: 5b2e5d32d6
am: 779378fab0

Change-Id: I4a3363b247b934b06fe794bbf0a9a3382202b6ce
2018-06-11 09:36:14 -07:00
Andreas Gampe
5b2e5d32d6 Merge "Framework: Disable native-bridge for non-zygote"
am: 05c09faad2

Change-Id: I2aea1bd9c520ca6bb42bf80bd445da0e86db8136
2018-06-11 09:11:28 -07:00
Andreas Gampe
14a1cd9e35 Framework: Disable native-bridge for non-zygote
Non-zygotes may not have the permissions/capabilities to run a
bridge and may abort attempts to load a bridge because of seccomp
rules. So don't tell the runtime to load a bridge when starting
a non-zygote.

Bug: 77878177
Bug: 80118963
Test: m
Test: cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases
Change-Id: I7894b89feec79e4bd478f649c004ad29fc46597e
2018-06-07 11:10:26 -07:00
Nicolas Geoffray
bfa4a608e8 Merge "Add a new dalvik.vm.jitpthreadpriority option." am: d27a9f4465 am: 8223390490
am: 20e63f961d

Change-Id: Ie7f93d2307be9a261e49e93e9bf8b86f6d3ca4f5
2018-05-17 10:46:07 -07:00
Nicolas Geoffray
20e63f961d Merge "Add a new dalvik.vm.jitpthreadpriority option." am: d27a9f4465
am: 8223390490

Change-Id: I2cf8166748f7eb6384ecff6ae711b61df165beaa
2018-05-17 10:35:44 -07:00
Nicolas Geoffray
24934a9c33 Add a new dalvik.vm.jitpthreadpriority option.
To dynamically play with JIT thread priorities.

bug: 79570024
Test: m
Change-Id: I84c691fb57b37e699429b9f511b2e235259d718a
2018-05-16 17:22:37 +01:00
Paul McLean
84b49130ff Moving native MIDI JNI init to AndroidRuntime.cpp.
Remove (non-working) lazy init in midi.cpp

Bug: 79464070
Test: Verify function with NativeMidiTestbed app.
Change-Id: I30182d19d205b4ab952d622824f1a63ab1fef72e
2018-05-11 09:10:38 -07:00
Calin Juravle
135445abe7 Merge "Process "dalvik.vm.profilebootimage" system property" am: dc3fe53d4f
am: 46940a604c

Change-Id: I67ca970bc51f8be39806183ecb55528768eff9b7
2018-05-08 20:49:12 -07:00
Calin Juravle
dc3fe53d4f Merge "Process "dalvik.vm.profilebootimage" system property" 2018-05-09 01:55:51 +00:00
Calin Juravle
62cd4bbcaa Process "dalvik.vm.profilebootimage" system property
Read the profile boot image property and pass the appropriate flags to the
android runtime.

Test: build, flash and check properties
Bug: 73313191
Change-Id: Ie972e2eb693678d268e707b9e892c97dd7dd061b
2018-05-08 12:42:30 -07:00
Andreas Gampe
921b846b80 Merge "Framework: Remove ART tombstoned config" am: 95c5e5c1fd
am: 3c942f040c

Change-Id: I8f5d13a2e9916e82b0e756c1c5002558898d6b99
2018-05-04 17:00:36 -07:00
Andreas Gampe
4b4287f072 Framework: Remove ART tombstoned config
The explicit option is no longer supported.

Bug: 77288304
Test: m
Test: device boots
Test: ANR dumps work
Change-Id: I1ffcf0593e1f6591d1b33882edf79381e59c2121
2018-05-03 14:25:14 -07:00
Andreas Gampe
42f4090f85 Merge "Revert "Frameworks/base: Compiled-classes support"" am: 087bae3ffe
am: f6786aeb64

Change-Id: I52f22c3df2a0a8d99d7be0d68fbf11eec2de8024
2018-04-16 11:21:20 -07:00
Andreas Gampe
5d18eef165 Revert "Frameworks/base: Compiled-classes support"
This reverts commit ca775941f3.

Bug: 76145463
Test: m
Change-Id: I5a368cd01812e16869352ec219eae095df4919c4
2018-04-13 13:07:56 -07:00
Bo Zhu
d4cc378400 Merge "Expose the JNI scrypt function in a standalone Java class so we can use it in RecoverableKeyStore as well" into pi-dev
am: 1364455fd7

Change-Id: I6fc53616ec67bbb2770541958745d10f766f8b3d
2018-04-02 20:36:36 -07:00
Bo Zhu
09856135e3 Expose the JNI scrypt function in a standalone Java class so we can
use it in RecoverableKeyStore as well

Bug: 77325751
Test: It builds. No caller code yet.

Change-Id: I6ff847cff2efbd023612e51fe35be980f27f162d
2018-04-02 15:47:08 -07:00
Elliott Hughes
85b6c0032a Remove non-tombstoned ANR path.
Bug: http://b/73140330
Test: boots with ANR
Change-Id: Ib58724a0a6b831c05cb59d053520a4169ea591fd
Merged-In: Ib58724a0a6b831c05cb59d053520a4169ea591fd
2018-03-28 17:54:26 +00:00
Elliott Hughes
4e4caa7757 Remove non-tombstoned ANR path.
Bug: http://b/73140330
Test: boots with ANR
Change-Id: Ib58724a0a6b831c05cb59d053520a4169ea591fd
(cherry picked from commit 10a30bd9e8)
2018-03-27 20:44:29 +00:00
Elliott Hughes
c4b9320961 Merge "Use ABI_STRING." am: ca7ce49ecc
am: da01ce155f

Change-Id: I410e2e8b4aec29c004e32001f04c8560eef470cd
2018-03-23 21:28:16 +00:00
Elliott Hughes
a1194cb636 Use ABI_STRING.
Bug: N/A
Test: builds
Change-Id: I5a9d2a6604887f1f0e9583086e012a086042b7df
2018-03-23 11:27:04 -07:00