571 Commits

Author SHA1 Message Date
Adam Lesinski
bde1df21ad Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit 1187590da38457809dd368d4901c9c47ac5a6958.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
2018-02-09 12:43:24 -08:00
Adam Lesinski
1187590da3 Replace AssetManager with AssetManager2 implementation
Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
2018-02-05 18:38:49 -08:00
Android Build Merger (Role)
c1aa80ab44 Merge "Merge "Revert "Revert "Make AndroidRuntime only start the debugger for zygote forked apps.""" am: 3b50dc3d34 am: 98568f57ad" into oc-mr1-dev-plus-aosp
am: e8626dee42

Change-Id: Ia800a77c6c172770726e4fd2a132137ae209eb45
2018-02-01 04:03:42 +00:00
TreeHugger Robot
490d323003 Merge "Add support for getting all available microphones characteristics." 2018-01-31 22:20:25 +00:00
Alex Light
c50928b763 Revert "Revert "Make AndroidRuntime only start the debugger for zygote forked apps.""
This reverts commit ff5d60b268dfd848c236b62ae241370a68aae39f.

Reason for revert: Fixed issue breaking go/art-build.

Bug: 72400560
Test: Build
Change-Id: Ie8943068302bec02d149917ccf738c0d935f8fe0
2018-01-31 17:03:20 +00:00
David Brazdil
cb6ae3a1f8 Merge "Revert "Make AndroidRuntime only start the debugger for zygote forked apps."" am: b3cef78e8d am: e49f4ef9fa
am: 434bee350b

Change-Id: I4dbbda8510ccaaacd07c6748586a1e76e3c1531b
2018-01-31 13:37:44 +00:00
David Brazdil
ff5d60b268 Revert "Make AndroidRuntime only start the debugger for zygote forked apps."
This reverts commit daf17d415c1a99c515ffa75f3ec3bb0fb87627fe.

Reason for revert: Topic broke go/art-build. Reverting as ART Sheriff. 

Change-Id: I913dcb82532d448116b0c60d98a91b9b7442d5c9
2018-01-31 10:43:17 +00:00
Alex Light
c3ad975aa2 Merge "Make AndroidRuntime only start the debugger for zygote forked apps." am: 5cdf28f38b am: 710b7c6626
am: b65fecd875

Change-Id: Iddea47fca8954f435c81a63695efdbd18aa30a66
2018-01-30 22:05:48 +00:00
Alex Light
daf17d415c Make AndroidRuntime only start the debugger for zygote forked apps.
This got changed unintentionally in commit fffb273. Restore the
original behavior where JDWP will not be enabled for non-zygote apps.

Bug: 72400560
Test: atest CtsJdwpSecurityHostTestCases
Change-Id: I364a9d8b6e87efc1604741a7e5dd68221ed8e491
2018-01-29 23:50:45 +00:00
jiabin
c0f4944038 Add support for getting all available microphones characteristics.
Add MicrophoneInfo to represent the microphone characteristics which
including location, orientation, frequency response, sensitivity,
channel mapping and other useful information.
Add a new API in AudioManager to query all current available
microphones.

Bug: 64038649
Test: Run test and check the print log.
Change-Id: Ie0dbfeeb84b88db426518b93c7bb83c8913bca85
2018-01-26 17:16:45 -08:00
David Srbecky
4ce53a04d3 Merge "Add dalvik.vm.minidebuginfo property for ART" am: 418a96457c am: 637814eebf
am: 8d4f8127e1

Change-Id: Ia4869cc2012ec7e7409c6ebb42a2d8291ed08bbf
2018-01-26 14:13:45 +00:00
Adam Lesinski
f7d01dd7e1 Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit dcb3c6559b09ec89771858ec27a787027da9af50.

Bug:72511998
Change-Id: I665966ca109f66f85d8665db388c71ea2303c3b8
2018-01-25 17:39:40 -08:00
Adam Lesinski
dcb3c6559b Replace AssetManager with AssetManager2 implementation
Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I572eb13c6a4372c7f656f5912821cececd5bf3d4
2018-01-24 15:19:04 -08:00
David Srbecky
3bb32503d4 Add dalvik.vm.minidebuginfo property for ART
The property enables generation of mini-debug-info for JIT.

Change-Id: I1cfce8b1b463d9e45bbe823c285c1639653bb1b5
2018-01-24 15:54:27 +00:00
Adam Lesinski
7fb3831136 Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit b20a0ce59f59cb5ec857748e056cc341dbd13b92.
2018-01-23 03:17:26 -08:00
Adam Lesinski
1f62f7c72e Merge changes from topic "assetmanager-refactor"
* changes:
  libandroidfw: Improve performance of AssetManager2
  libandroidfw: Add ApplyStyle and SetConfiguration benchmark
  Make idiomatic use of ApkAssets and AssetManager
  Replace AssetManager with AssetManager2 implementation
2018-01-23 05:28:11 +00:00
TreeHugger Robot
4ef6684925 Merge changes Ie2ec98d9,I81ce2bef
* changes:
  Make ImageDecoder return animated Drawables
  Ensure that PostProcess Canvas is released
2018-01-18 15:34:28 +00:00
Victor Hsieh
217682248b Merge "Reland: Move zygote's seccomp setup to post-fork" am: 7839672e22 am: 4249466562
am: dec688691d

Change-Id: Ibcf5eeef74b69112f568ebb1f146c2990ffed30a
2018-01-18 01:31:09 +00:00
Leon Scroggins III
671cce2605 Make ImageDecoder return animated Drawables
Bug: 63909536
Bug: 63908092
Test: TODO

If ImageDecoder.decodeDrawable is called with an animated image Source
(currently GIF or WebP), return an object of a new (hidden) Drawable
subclass. The new Drawable animates, and it implements Animatable (TODO:
implement Animatable2) so users have some control over the animation.

In addition to the normal features of Drawable, this new one supports
many of the features of ImageDecoder, including scaling, cropping and
PostProcess, which enables circle masks/rounded corners and other
arbitrary after-effects. It does *not* support decoding directly to a
Hardware Bitmap, since it cycles through frames and reuses the same
bitmap memory. But it could be made to use shared memory (TODO?).

TODO: Use a better number for the native allocation registry
TODO: Use the RenderThread to drive the animation, and remove decoding
on the UI thread.
TODO: Add support for modifying the loop count

Android.bp:
- build new AnimatedImageDrawable.cpp

AndroidRuntime.cpp:
- register new native methods

AnimatedImageDrawable.java
AnimatedImageDrawable.cpp:
- new Drawable that handles animated images

Canvas.h, SkiaCanvas.h/.cpp
- New virtual method and implementation for drawing SkAnimatedImages

RecordingCanvas.h/.cpp
- Stub implementation of drawing SkAnimatedImages

ImageDecoder.h/cpp
- Allow code sharing with AnimatedImageDrawable.cpp
  - postProcess
  - access the ImageDecoder struct

Depends on https://skia-review.googlesource.com/c/skia/+/94660 in Skia.

Change-Id: Ie2ec98d9c52deda4d439c6ef8e5dea2861bb93a3
2018-01-17 17:06:57 -05:00
Victor Hsieh
c8176efe2e Reland: Move zygote's seccomp setup to post-fork
Before this change, seccomp filter setup is as early as in zygote's main
function.  To make it possible to split app and system server's filter,
this postpone the setup to after fork.  It also starts to call app
specific and system server specific setup function.

The filter setup is done in Zygote's ForkAndSpecializeCommon.  This is
because adding a seccomp filter must be done when either the caller has
CAP_SYS_ADMIN or after the PR_SET_NO_NEW_PRIVS bit is set.  Given that
setting PR_SET_NO_NEW_PRIVS breaks SELinux domain transition
(b/71859146), this must be done after Zygote forks but before
CAP_SYS_ADMIN is droppped.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Test: no selinux denial flood in dmesg with selinux enforced
Test: debuggerd -b `pidof com.android.phone`  # logcat shows tombstoned
      received crash request
Bug: 63944145
Bug: 71859146

Change-Id: I8215c8530d3d0de504a270488f8e29635805e8b0
2018-01-17 09:30:44 -08:00
Seigo Nonaka
9d3bd08eba Rename PremeasuredText to MeasuredText
There is already MeasuredText, so renamed existing MeasuredText to
MeasuredParagraph, then renamed PremeasuredText to MeasuredText.

Bug: 67504091
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsTextTestCases:*
Change-Id: Ie20bea9501b18fabb36f64d388a7851c4643d4c3
2018-01-11 11:33:32 -08:00
Adam Lesinski
b20a0ce59f Replace AssetManager with AssetManager2 implementation
Test: Existing CTS tests pass
Test: make libandroidfw_tests
Change-Id: I858f7e1d909c08273b096601136e3f28e15eb5d4
2018-01-09 16:28:58 -08:00
Chenbo Feng
71436b32e9 Merge "Use NetworkStatsService to get stats for apps" am: 693d8a2ab1 am: fa7f4015fc
am: 09a81e4da1

Change-Id: I90ce68a72afbf596e28d987e925795709d24dd52
2017-12-21 19:49:25 +00:00
Treehugger Robot
693d8a2ab1 Merge "Use NetworkStatsService to get stats for apps" 2017-12-20 20:30:54 +00:00
Alex Light
3ee64f8d50 Merge "Add support for selecting alternate JDWP implementations" am: cbeea23861 am: f5ec7f2e26
am: b24c17efa3

Change-Id: I200e5430fd9696affa37f6330999379173837f2b
2017-12-20 15:31:14 +00:00
Chenbo Feng
d3d9c4ed9b Use NetworkStatsService to get stats for apps
Move the native implementation of TrafficStats to NetworkStatsService
and apps need to get the NetworkStatsService binder interface from
system_server in order to get the network usage stats since boot. This
implementation can hide the detail of retrieving network traffic
information from apps and the NetworkStatsService can choose which
methoed it use to get the data depending on the kernel version of the
device.

Bug: 30950746
Test: CtsNetTestCases -t android.net.cts.TrafficStatsTest
Change-Id: I53bbefd19aa0b783b9b4b42ea4d76db3e9ec07a3
2017-12-19 19:57:44 -08:00
Leon Scroggins III
0c01dbf8f2 ImageDecoder (BitmapFactory 2.0)
Bug: 63909536
Bug: 63908092

Test: CTS: I0f36ce34c968fd7fae4d8edebabea3a421859615

One-pager:
https://docs.google.com/document/d/1IWSdXb5O9lu-Zbj7SaNWo5pS7-FHlonFnqazjnecozM/
Design doc:
https://docs.google.com/document/d/15S6DSAV4EwOuJLv29UC_9cdSGdPg3KvOJVn2EHoP3fw/

ImageDecoder is designed to streamline certain patterns of BitmapFactory
use:
- choosing sample size based on actual dimensions
- choosing a specific output size
- post-processing (e.g. for rounded corners)
- copying to HARDWARE
- decode directly to ashmem
- creating a Drawable
- use as an alpha mask
- save RAM (e.g. use RGB_565)

In addition, it will include new features:
- animated drawables (TODO)
- report failures *and* optionally create a partial image
- crop

Add PostProcess to handle post-processing. It is separate from
ImageDecoder so that it may be used in the future by other commands that
might want something similar (e.g. capturing a View).

Consolidate NinePatch code for sharing between BitmapFactory and
ImageDecoder.

Some features left out of this CL:
- Create from ContentResolver + URI
- animation
- report more info in ImageInfo
- more overloads (e.g. null OnHeaderDecodedListener)

Change-Id: Icf011dc1b97b492788e47cf51fcf8abe8e9c7b88
2017-12-19 20:22:17 +00:00
Alex Light
fffb273aff Add support for selecting alternate JDWP implementations
Change the '-Xagentlib:jdwp=...' option to instead use the new
'-XjdwpOptions:...' syntax and remove the explicit transport-lib.

Add a '-XjdwpProvider:...' option. Set it to 'default' by default and
get its value from the 'dalvik.vm.jdwp-provider' property.

Test: Boots. Can debug apps
Test: Set dalvik.vm.jdwp-provider=adbconnection, stop, start, debug

Bug: 62821960
Change-Id: I1605030b94b38676c18885fcf2fa3490bccd3e0d
2017-12-14 13:49:26 -08:00
Seigo Nonaka
6f1868b813 Associate native MeasuredText with Java one.
To measure text beforehand, remove static layout dependency from
MeasuredText. Now MeasuredText can compute native measured text
by itself and StaticLayout use it for line breaking.

This CL introduce one additional JNI method call per paragraph during
line breaking but looks negligible cost.

Here is a raw performance test result on walleye-userdebug.

StaticLayoutPerfTest (median, N=100):
createRandom:          7,879,440 -> 7,964,789 (+1.08%)
createRandom Balanced: 7,835,192 -> 7,848,151 (+0.17%)

TextViewOnMeasurePerfTest (median, N=100):
measure_AtMost:       92,599,175 ->  93,027,121 (+0.47%)
measure_Exactly:      89,949,922 ->  90,439,886 (+0.54%)
measure_Unspecified: 148,645,916 -> 150,047,694 (+0.94%)

Bug: 67504091
Test: bit CtsTextTestCases:*
Test: bit CtsWidgetTestCases:*
Test: bit CtsGraphicsTestCases:*
Test: bit FrameworksCoreTests:android.text.StaticLayoutTest
Change-Id: Ie932903845645e50cfa0cb428babb31a44babc47
2017-12-05 14:56:06 -08:00
Yifan Hong
6f813c6a98 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs" am: e72b6f0d31 am: 8cf7761747
am: 523665a293

Change-Id: I901c938c2c56ab1c1649c218b37d4ab131cd3c7b
2017-11-22 23:28:56 +00:00
Yifan Hong
8cf7761747 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs"
am: e72b6f0d31

Change-Id: I7ea5895cdfd09786732b597be600329a334c1cb4
2017-11-22 23:06:33 +00:00
Yifan Hong
bb0bd00b00 android.os.HidlSupport: add getPidIfSharable() for HALs
... that returns PID of the process for debuggable builds.
This calls into the C++ equivalent of the function.

Test: lshal
Bug: 68992575

Change-Id: Ia177c709c6930510035cff33dc2389441a76351d
2017-11-20 11:51:07 -08:00
Cody Northrop
86cedcb583 Rootless GPU Debug
Add the ability to load GPU debug layers from the base
directory of debuggable applications.

This commit:
* Adds a new Setting to Developer options: "Enable GPU debug layers"
* Adds a new way to discover and specify GPU debug layers per app
* Moves much of the layer enabling logic into GraphicsEnvironment
* Removes the JNI component of ApplicationLoaders

Bug: 63708377
Test: Manual, CTS tests to follow
Change-Id: I7d33e9f835f49aa8d86e63bdb32037728bc8b6a4
2017-11-16 22:58:45 -07:00
Roozbeh Pournader
a5511eb648 Merge "Replace JNI portion of AndroidBidi with calls to ICU4J" 2017-10-19 22:55:57 +00:00
Roozbeh Pournader
a15fd848cb Replace JNI portion of AndroidBidi with calls to ICU4J
We no longer need the native calls to ICU since we have ICU4J.

Fixes: 67786879
Test: bit FrameworksCoreTests:android.text.
Change-Id: Ib2ec93017000b4f0343756814ca388bd31457849
2017-10-19 11:20:46 -07:00
Yao Chen
d54f9dd625 Revert "Revert "Start auto-generating the stats log API.""
Test: builds successfully

This reverts commit 931945399859ab91545ba2c2a914f044092d5e2e.

Change-Id: I22bca4a32adf86040b9d72ad5b45999aba28f586
2017-10-17 10:42:44 -07:00
Joe Onorato
bcc8478d2b Merge "Revert "Start auto-generating the stats log API."" 2017-10-16 22:46:21 +00:00
Joe Onorato
9319453998 Revert "Start auto-generating the stats log API."
This reverts commit b81d1a7b9a38dcb4d356ae3435a82fb52ba7d585.

Change-Id: I189684d8913ffffca42d9514ac88ea5cc4a44f05
2017-10-16 22:41:28 +00:00
Joe Onorato
22910ada9a Merge changes Idf402222,I8eb7e341
* changes:
  Start auto-generating the stats log API.
  Make bit able to build native tests.
2017-10-16 21:19:16 +00:00
Mathieu Chartier
00d31c2760 Merge "Add dalvik.vm.foreground-heap-growth-multiplier property" into oc-mr1-dev am: 2baa393238
am: 64a636c8bd

Change-Id: Ic784a133d04aed855a0150eb7597375cc053c0e0
2017-10-16 18:14:48 +00:00
Mathieu Chartier
64a636c8bd Merge "Add dalvik.vm.foreground-heap-growth-multiplier property" into oc-mr1-dev
am: 2baa393238

Change-Id: I5c35bae390870d6582d863e16013afb897117d0b
2017-10-16 18:02:36 +00:00
Mathieu Chartier
ebc3b4c033 Add dalvik.vm.foreground-heap-growth-multiplier property
Corresponds to the -XX:ForegroundHeapGrowthMultiplier ART option.

Bug: 67416130
Test: make, flash, setprop
Change-Id: Ia9c70c62d8faa3b9aeb7b50dba237095abd53e80
2017-10-15 21:31:26 -07:00
Joe Onorato
b81d1a7b9a Start auto-generating the stats log API.
Both native and java bindings.

TODOs:
- Finish WorkSources.
- Clean up the package names for the protos.
- Put the protos in a more suitable location.

Test: stats-log-api-gen-test
Change-Id: Idf4022225e2be05106dbcf7de8e97a3337fc63e2
2017-10-15 20:25:19 -07:00
Mathieu Chartier
790016aef5 Merge "Add property reading logic for dalvik.vm.madvise-random" into oc-mr1-dev am: a354ec973d
am: ecc8bdc227

Change-Id: I401df22e24210ac7aa47f5a8341f657403ebdece
2017-10-15 03:17:12 +00:00
Mathieu Chartier
ecc8bdc227 Merge "Add property reading logic for dalvik.vm.madvise-random" into oc-mr1-dev
am: a354ec973d

Change-Id: Ic75411af539a08e215b5c9e076688fd39b46569d
2017-10-15 02:31:19 +00:00
Mathieu Chartier
cd0caf5e8e Add property reading logic for dalvik.vm.madvise-random
The property is passed to runtime init as
-XX:MadviseRandomAccess.

Bug: 67772594
Test: make and getprop
Change-Id: I7cbab5d028067810276bc58c312806ea3785f93f
2017-10-13 12:00:53 -07:00
Tom Cherry
3c71e833b8 Merge "Move to some properties users to libbase properties" am: 2b20612e77 am: 9e4bfdb0b6 am: 506f89a250
am: 0ca5b37250

Change-Id: I82ba46567c1982e8bc4f90eb7a4c38a73dc15600
2017-10-12 21:45:09 +00:00
Tom Cherry
0ca5b37250 Merge "Move to some properties users to libbase properties" am: 2b20612e77 am: 9e4bfdb0b6
am: 506f89a250

Change-Id: I1ba14d9729dba38dd6f67768ea2c83972a853847
2017-10-12 21:26:43 +00:00
Tom Cherry
9e4bfdb0b6 Merge "Move to some properties users to libbase properties"
am: 2b20612e77

Change-Id: I376b9179ed242810c529d289558a44b422c1e8f5
2017-10-12 21:01:53 +00:00
Tom Cherry
93099e4485 Move to some properties users to libbase properties
The libcutils interface cannot read properties with value length > 92
characters, whereas the libbase one can.  ro.build.fingerprint may be
larger than this size in the future, so we move to libbase to prepare.

Bug: 23102347
Bug: 34954705
Test: build
Change-Id: Ic91aa63c7db1a7a01b9a1ee321b7854a9bcf6d12
2017-10-12 09:30:59 -07:00