Commit Graph

3509 Commits

Author SHA1 Message Date
Calin Juravle
b1818b8a36 Merge "PackageManager: Clean up code related to foreign dex use"
am: eef66fd0c7

Change-Id: I443f001c15daddd63a17685c2e82fc9a619c45ee
2017-03-07 21:23:03 +00:00
Calin Juravle
4c06f55f14 PackageManager: Clean up code related to foreign dex use
We simplified the way we track whether or not a dex file is used by
other apps. DexManager in the framework keeps track of the data and we
no longer need file markers on disk.

Test: device boots, foreign dex markers are not created anymore

Bug: 32871170

(cherry picked from commit 74f0a3450c)

Change-Id: I2a9daca15e5120518852584fa17aa94012af8f1a
Merged-In: I3660e2f3913a73904181449c2d910af0a0477950
2017-03-07 11:39:24 -08:00
Tobias Thierer
50351bd85c Merge "Move value for the Build.CUR_DEVELOPMENT constant into libcore"
am: 3e6c189c68

Change-Id: I981b746a28cda09d7a75fa79faeacb2cc58b1fc4
2017-03-03 12:07:59 +00:00
Tobias Thierer
3e6c189c68 Merge "Move value for the Build.CUR_DEVELOPMENT constant into libcore" 2017-03-03 12:02:09 +00:00
Elliott Hughes
6f00e6e977 Merge "Remove the name length limit for system properties."
am: c657b769ab

Change-Id: I700b379c0482d7d9609183a39a5c9664746ea5aa
2017-03-03 00:30:10 +00:00
Elliott Hughes
c657b769ab Merge "Remove the name length limit for system properties." 2017-03-03 00:22:31 +00:00
Elliott Hughes
33cc60ccc9 Remove the name length limit for system properties.
Bug: http://b/33926793
Test: builds
Change-Id: Ib89b66b7abebc9a28961a0c9032b99947e3db0d6
Merged-In: Ib89b66b7abebc9a28961a0c9032b99947e3db0d6
2017-03-02 14:17:03 -08:00
Shubham Ajmera
c847aae2cf Merge "Fix Javadoc for StrictMode#permitUnbufferdIo"
am: b8648ae07a

Change-Id: I86adc3e40c083c999b717384ae38e437a17a9557
2017-03-02 17:32:14 +00:00
Treehugger Robot
b8648ae07a Merge "Fix Javadoc for StrictMode#permitUnbufferdIo" 2017-03-02 17:23:45 +00:00
Elliott Hughes
91c1048bc7 Merge "Basic javadoc for android.os.UpdateEngine."
am: cbafc8d682

Change-Id: I927f7e3014d7e27b4e003d2f4f4fdaa7ea0645c5
2017-03-02 03:01:34 +00:00
Shubham Ajmera
ade21170a7 Fix Javadoc for StrictMode#permitUnbufferdIo
Bug: 35813076
Test: no tests
Change-Id: I2f71cad7a7a3f85908b322e2b83ba265c49adbad
2017-03-01 09:26:41 -08:00
Tobias Thierer
8bacd9bd02 Move value for the Build.CUR_DEVELOPMENT constant into libcore
This matches a corresponding libcore change. It is to allow
libcore to use this value as a default when no other value is
explicitly set, e.g. in the system server or during testing
with vogar.

Bug: 34072201
Test: Device boots with CLs from this CL's topic.
Change-Id: Id812339a343ecea84a08bfdf4b873f3b156a13d4
2017-03-01 12:44:01 +00:00
Elliott Hughes
e3ce3e8bab Basic javadoc for android.os.UpdateEngine.
Bug: N/A
Test: N/A
Change-Id: Icb870e7720e8b50082d353e7ea08007e1f4e2fdc
2017-02-28 15:19:32 -08:00
Leonard Mosescu
de021d8162 Merge "Adding "attach-agent" to ActivityManagerShellCommand" am: 05dfd10254 am: db0803b4e8
am: 7bf598cbd9

Change-Id: If7b73860cc8249b997d5e9a7a4d149732b08449b
2017-02-16 23:37:48 +00:00
Leonard Mosescu
02758a9a80 Adding "attach-agent" to ActivityManagerShellCommand
This new command is used to attach runtime agents to a running application:

attach-agent <PROCESS> <FILE>
   Attach an agent to the specified <PROCESS>,
   which may be either a process name or a PID.

Test: m test-art-host, manual testing:
    . invalid syntax, missing arguments
    . invalid syntax, extra arguments
    . invalid numeric PID
    . invalid process name
    . valid process, not debuggable
    . valid process, missing agent
    . valid process, valid agent

Bug: 31682382

Change-Id: I61cc8bf20addb1702acc8e7aae65b2f9ed7c5ca0
Merged-In: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
2017-02-16 13:19:41 -08:00
songjinshi
78a3d9dab4 Merge "[Debug]: Add timeout for dumpNativeBacktraceToFile." am: b6f7a85b85 am: ec69bd0aa3
am: 36bcc913f7

Change-Id: Icf40ff98196d885e6974eb679532064b30bc68cd
2017-02-08 20:28:48 +00:00
songjinshi
e02e3ea7f9 [Debug]: Add timeout for dumpNativeBacktraceToFile.
If the debuggerd be blocked, the watchdog and
activitymanager thread will be blocked when the
ANR or watchdog occurs,so we needed to add
timeout for dumpNativeBacktraceToFile.

Change-Id: Iab1a64328e70257025d860638d93a4fb8eaaeea2
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
2017-02-07 19:17:45 +00:00
Justin Klaassen
46d3d6d313 Remove experimental twilight-based automatic brightness
am: 614f40ea01

Change-Id: I1b0ec1645f38892adb894900b3b3725fc0b23452
2017-02-06 23:28:27 +00:00
Paul Lawrence
fde0a41065 Install seccomp into zygote not init am: ef85477470 am: 521d25294b
am: e6e8c7a1dd

Change-Id: I97d2843a2c2940b558f216cf550891a80963be54
2017-02-02 18:37:22 +00:00
Paul Lawrence
ef85477470 Install seccomp into zygote not init
Bug: 34710876
Test: Boots, correct size filter installed, blocks unallowed calls

Change-Id: I3e66e8724ace37f7d30451b98a5e574766252ea0
2017-02-02 17:45:11 +00:00
Justin Klaassen
614f40ea01 Remove experimental twilight-based automatic brightness
Bug: 31602449
Test: verified adaptive brightness no longer varies with twilight with
"brightness_use_twilight" set to "1".

Merged-In: I6b5f7310020b2128c2b292414a205b6052270a0a
Change-Id: Ife9bf6d0f76df791cb7e6a22505d9f551da19731
2017-02-02 09:23:49 -08:00
Shukang Zhou
bb44e42de9 [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-30 13:07:40 -08:00
Nicolas Geoffray
96ea5ccef6 Merge "Introduce DEBUG_JAVA_DEBUGGABLE." am: 4df43ad959 am: 27ffe754a4
am: 1852c380e0

Change-Id: I8fcc8b0329269a0b21057f973b3a7dc5d8d80284
2017-01-30 15:26:29 +00:00
Nicolas Geoffray
4df43ad959 Merge "Introduce DEBUG_JAVA_DEBUGGABLE." 2017-01-30 15:09:45 +00:00
John Reck
6e4f930457 Merge "Fix a bunch of repeated reads of a ro.* property" am: 4265991701 am: e4c2e8f303
am: 3c2837e77e

Change-Id: Idbcb9dfeac57036d3621474ee65ba967cc7bc499
2017-01-27 23:05:52 +00:00
Treehugger Robot
4265991701 Merge "Fix a bunch of repeated reads of a ro.* property" 2017-01-27 22:49:04 +00:00
Nicolas Geoffray
347b1df988 Introduce DEBUG_JAVA_DEBUGGABLE.
For notifying ART it will run a debuggable app.

Also rename ENABLE_DEBUGGER to ENABLE_JDWP.

Test: builds and runs
bug: 28769520
Change-Id: Ic096a176edfd5bf0bbe92b8367fbaa687a07d284
2017-01-27 11:26:53 -08:00
John Reck
ed065024a5 Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
(cherry picked from commit aa67f684ff)
2017-01-27 11:04:39 -08:00
Shukang Zhou
6ec0b7e21d [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-25 16:53:41 -08:00
Jesse Hall
e8a5df8530 Don't lower priority of EGL Init thread
am: 37e63c705e

Change-Id: Icd21c9243558f4427d48f967f4ea4ae7aa1e2b02
2017-01-24 18:13:07 +00:00
Jesse Hall
37e63c705e Don't lower priority of EGL Init thread
The EGL Init thread spends a lot of time loading shared libraries,
which involves reading pages and adjusting VM pages. Previously it was
a low priority thread, which meant that when it blocked while holding
a VM lock, it might take a while to be scheduled again once ready, so
it would hold the VM lock longer than necessary, blocking other
threads waiting on soft faults, etc. Classic priority inversion.
Leaving the thread at normal priority causes it to interfere *less*
with critical-path Activity launch work.

Bug: 34611670
Test: go/platform-startup, specifically:
    ./tradefed.sh run google/template/local --template:map test
    google/test/performance/app-launch-perf
    --post-boot-command "service call persistent_data_block 6 i32 1"
    --post-boot-command "service call persistent_data_block 7 i32 1"
    --apps Clock alarmclock --trial-launch --launch-iteration 10
    --launch-order cyclic --drop-cache --trace-directory sdcard
    --trace-iteration 2 --simple-perf-cmd "simpleperf stat -a"
    --report-metrics all --force-skip-system-props --alt-dir `pwd`

Change-Id: I17647c657da64d15f40f8f2b97ee3400e1f0be7f
2017-01-24 00:09:27 -08:00
Jesse Hall
fd104e7fde Load EGL early in Activity launch, instead of in Zygote
Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I6a0f6b90ade21848a10d51ddae62c936f70151b5
Merged-In: I887aa09bd35b088b16f53a89838a0c7c98f15761
2017-01-20 15:58:20 -08:00
Jesse Hall
0d3537c67b Merge "Load EGL early in Activity launch, instead of in Zygote" into nyc-mr2-dev-plus-aosp 2017-01-20 23:57:34 +00:00
Jeff Sharkey
7bb9ccc1e5 Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011
am: 4a0a4664b9

Change-Id: I9b5667ca6e5497a4eedaaf88979a1a3d0e22c174
2017-01-20 23:03:40 +00:00
Jeff Sharkey
a2ef6b5741 Merge "Add Binder support for Parcelable exceptions." 2017-01-20 22:45:04 +00:00
Jesse Hall
5fa7fb1d9f Load EGL early in Activity launch, instead of in Zygote
Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I887aa09bd35b088b16f53a89838a0c7c98f15761
2017-01-20 13:50:41 -08:00
Tao Bao
0770c86e5c Merge "Revert "RecoverySystem: Fix the issue in installPackage()."" am: 9311dbf9e4 am: 731445ebf7
am: b20ce70cca

Change-Id: I931ce2f47714032b27cb092699ae3fbc69563fc0
2017-01-19 02:04:18 +00:00
Tao Bao
cc76991f37 Revert "RecoverySystem: Fix the issue in installPackage()."
This reverts commit 9f7a0acd2d.

Bug: 34350643
Bug: 34396955
Test: installPackage() doesn't cause deadlock if it doesn't call
      processPackage() prior to that.
Change-Id: I1da055c86a3326ae341da1b4d5dc79ab4be256fb
2017-01-19 01:31:57 +00:00
Jeff Sharkey
e628b7d446 Add Binder support for Parcelable exceptions.
If an Exception thrown by a Binder call implements the Parcelable
interface, then parcel it and rethrow back at the caller.  There is
strict requirement that these Parcelable exceptions must be defined
by the system (as determined by checking the ClassLoader).  We prefix
the Parcelable contents with a length so that native code can skip
over the blobs.

Define a new ParcelableException class that can be used to transport
exceptions that cannot be modified to add Parcelable behavior, and
switch ExceptionUtils to use this new class for sending IOExceptions.

Test: builds, boots, wrapped exceptions work
Bug: 33749182
Change-Id: I1352ea1566ddf01120d9d0e819ba6f70fc407e11
2017-01-17 14:22:07 -07:00
Lorenzo Colitti
bb79257dbf Merge "Delete dead code." am: cf59ff79c5 am: d305a7c894
am: 8cf7169564

Change-Id: Ia662fd845fcfb4ade631d8aacf6bcff3c92a1543
2017-01-17 06:08:28 +00:00
Treehugger Robot
cf59ff79c5 Merge "Delete dead code." 2017-01-17 05:44:58 +00:00
Tao Bao
448716eec1 Merge "RecoverySystem: Fix the issue in installPackage()." am: 3b2fe9f7b9 am: 6bb3a9e6df
am: 5c610492c8

Change-Id: Ic9fa3bb8c7d4c04fa6e55b600cd7cccc9b186db1
2017-01-16 18:36:43 +00:00
Tao Bao
3b2fe9f7b9 Merge "RecoverySystem: Fix the issue in installPackage()." 2017-01-16 18:19:25 +00:00
Martijn Coenen
098bbc455d Merge "Add nullable parameter to readEmbeddedBuffer." am: c5e5442acd am: b529858c0b
am: 714c8596ad

Change-Id: I792c4ac6a20e4665b152a5ebea1227b549cca7ef
2017-01-16 15:06:01 +00:00
Jesse Hall
17ee3aac28 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
(cherry picked from commit b12249b671)
2017-01-15 05:55:46 +00:00
Jesse Hall
79bf392dc6 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Change-Id: I4e4e7fb21f1bcc67122e9173514af5f18c063991
Merged-In: I5820d3d1301d5461e10706f551b268c54d4f8926
2017-01-14 19:19:28 -08:00
Tao Bao
9f7a0acd2d RecoverySystem: Fix the issue in installPackage().
Commit 794c8b0b3f fixed the race condition
when requesting data wipes via uncrypt. We have similar issue with
RecoverySystem.installPackage(). It first requests to set up the BCB,
then triggers a reboot. These two steps should finish atomically.

This CL switches to calling
RecoverySystemService.rebootRecoveryWithCommand(), which guards the two
steps with synchronized blocks.

Bug: 34239871
Test: Having two apps: one calls RecoverySystem.cancelScheduledUpdate()
      continuously, and the other calls RecoverySystem.installPackage()
      just once. The install request should not be cancelled by the
      other.

Change-Id: I5ec56fcaa70eae7c33e3cc8e6cfc7472b935ce4e
2017-01-13 09:59:38 -08:00
Martijn Coenen
14fae06b60 Add nullable parameter to readEmbeddedBuffer.
To support reading embedded buffers that can be
nullptr (currently only in empty hidl_vec).

Bug: 34255213
Test: hidl_test_java
Change-Id: I72028f580b7863b6bfeb31a5c0f43deed36dfd64
2017-01-13 14:17:12 +01:00
Santos Cordon
f85ab8306f Add Brightness setting for VR Mode.
am: d6a5660a2c

Change-Id: If371f485471eb1ab0a3e07964c197cb9b8ef1c9f
2017-01-11 03:12:05 +00:00
Santos Cordon
d6a5660a2c Add Brightness setting for VR Mode.
This change saves and loads a different brightness setting when the user
goes in and out of VR Mode.

Bug: 30984614
Change-Id: If3c3e81b592e0c6fd037e5783559683e5cb58379
2017-01-09 17:33:14 -08:00