Commit Graph

3452 Commits

Author SHA1 Message Date
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
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
Nicolas Geoffray
4df43ad959 Merge "Introduce DEBUG_JAVA_DEBUGGABLE." 2017-01-30 15:09:45 +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
Jeff Sharkey
a2ef6b5741 Merge "Add Binder support for Parcelable exceptions." 2017-01-20 22:45:04 +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
Treehugger Robot
cf59ff79c5 Merge "Delete dead code." 2017-01-17 05:44:58 +00:00
Tao Bao
3b2fe9f7b9 Merge "RecoverySystem: Fix the issue in installPackage()." 2017-01-16 18:19:25 +00: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
Alex Naidis
19d9c2d03c StorageManager: Improve exception handling
When "getPrimaryStorageSize" provides a path
to "readLong", the option that the path
doesn't exist is expected, since it tries
all paths from "INTERNAL_STORAGE_SIZE_PATHS"
until there is success.

This patch makes us catch the "FileNotFoundException"
and "NumberFormatException" seperately.

For the above reason a "FileNotFoundException"
is now treated as an information only.
The "NumberFormatException" and other exceptions
are now treated as error since those are not
expected to happen.

Change-Id: I5316f9c3108e36c31b27dc5df8bf8ac4d4257629
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-01-09 16:27:52 +00:00
Felipe Leme
c0d3f0ed52 Dumps total size of primary storage.
BUG: 32069168
Test: manual verification

(cherry picked from commit 281389ac54)

Change-Id: If5dee52a99c03a00dada22736c09d953dc0b66d1
2017-01-08 03:51:37 +01:00
Steven Moreland
c0631d0bb7 HwBinder: get/register checked exceptions.
Bug: 33673120
Test: hidl_test_java
Change-Id: Id19b61b252e756a032ae11f7b59bd8eed82edbe9
2017-01-05 09:20:44 -08:00
Steven Moreland
e62b1f32f3 Add checked exceptions to HwBinder transact.
Bug: 33673120
Test: hidl_test_java
Merged-In: I7b62eb6b066fc24c44ef7e46aaa2a3208c053d11

Change-Id: I7b62eb6b066fc24c44ef7e46aaa2a3208c053d11
2017-01-04 01:13:16 +00:00
Jeff Sharkey
5eb3eb58ac Offer to measure disk stats using quotas.
Now we're getting somewhere!  This CL starts measuring disk usage
using quotactl(), which is almost instant and has much lower impact
on flash memory lifetime.

We now grant the per-app cache GID to every launched app, and the
ContextImpl logic that creates cache directories matches the logic
down in installd.

Test: builds, boots, quota stats match manual stats
Bug: 27948817
Change-Id: Ie269a2958ce0e1c17cb74dbfecc791a5c12922cf
2017-01-03 10:22:39 -07:00
Martijn Coenen
727f7bf84f Add (un)linkToDeath support to HwBinder.
This is mostly copied over from binder's existing
death recipient support. The implementation keeps
a list of registered recipients, both for being
able to map a native recipient back to the corresponding
Java recipient, as well as being able to unregister
recipients correctly.

Test: mma, hidl_test_java
Bug: 31632518
Change-Id: Id313fd248be6925056c4ade8298fe5fb04e007cc
2016-12-29 04:22:30 +00:00
Tamas Berghammer
0ca16fa584 Enable logwrapper functionality on user builds
When an app is debuggable, check whether a script called "wrap.sh" exists
in the app's native library directory. If so, start the app using the
invoke-with functionality over the script. Weaken the invoke-with check
on the zygote side to allow the functionality for debuggable apps.

The goal of the functionality is to make malloc debug, strace and other
similar tools available for NDK based application developers.

Bug: 33668201
Test: manual - debug malloc can be enabled using the new feature
Change-Id: Ia4bec0854cf4dc08446f1671494200f54ef366ee
2016-12-16 09:03:06 -08:00
Tamas Berghammer
b8f7c351b9 Zygote: Add invoke-with to zygote protocol
Add "--invoke-with" to the zygote connection protocol. It was
already understood as an argument by the zygote.

Bug: 33668201
Test: m
Change-Id: I59095f2ac542aadff78a7ff1dded86cf5f192707
2016-12-16 09:03:01 -08:00
Lorenzo Colitti
319146d372 Delete dead code.
Since N, DNS servers are not set by setDnsServersForNetwork, they
they are set by setDnsConfigurationForNetwork.

Test: compiles
Bug: 30944031
Change-Id: I3a3edb9ffe9d5f9652af0b6637eb89b1b044a270
2016-12-16 00:34:49 +09:00
Josh Gao
552d86b520 Add trace category for adb.
Bug: http://b/31289465
Test: systrace
Change-Id: I765c55c264329227556ff25655e3f00c5c3e8b54
2016-12-12 12:32:57 -08:00
Jeff Sharkey
447a3ac16b Catch all exceptions from installd, log codes.
Now that installd is throwing both SecurityException and
IllegalArgumentException, it's time that we turned all these
into InstallerException.

Also extend ServiceSpecificException to include the contained
errorCode value when printing.

Test: builds, boots, apps install/uninstall fine
Bug: 13758960, 30944031
Change-Id: Ic9c1e99ae87f4442402ef528bf352c7978572c85
2016-12-12 10:16:32 -07:00
Lenka Trochtova
13a0519394 Introduce a new user restriction for disallowing Bluetooth.
Only the device owner will be able to set the restriction
and the restriction will prevent usage of Bluetooth on the
entire device - i.e. in all the users.

Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.UserRestrictionsTest
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction

Bug: 32895300

Merged-In: I2875cf178cb16eca1965d0ba965d1cd3d8db2ad5

Change-Id: I2875cf178cb16eca1965d0ba965d1cd3d8db2ad5
2016-12-05 11:53:34 +01:00
Martijn Coenen
8c05ff96fb Merge "Add SystemProperties.reportSyspropChanged()."
am: 45c0c6939f

Change-Id: I83890872ba76161cf2f9a35b23861ab21b452a0f
2016-11-22 09:49:15 +00:00
Treehugger Robot
45c0c6939f Merge "Add SystemProperties.reportSyspropChanged()." 2016-11-22 09:43:23 +00:00
Jeff Sharkey
313456c975 Merge "Stub Binder API."
am: 4db1632b3a

Change-Id: I00e7f39d525a1d6af9a07b192294060113a2f7c2
2016-11-21 20:21:25 +00:00
Jeff Sharkey
4db1632b3a Merge "Stub Binder API." 2016-11-21 20:10:29 +00:00
Jeff Sharkey
1324531355 Stub Binder API.
Provide a stub API for AOSP code to call.

Test: builds
Bug: 32715088
Change-Id: Iab74d269e795a722e82fd3fa304200d57d152f57
2016-11-21 18:11:25 +00:00
Martijn Coenen
0754b27b56 Add SystemProperties.reportSyspropChanged().
To support notifying libutils of system property
changes.

Bug: 31262344
Test: builds
Change-Id: Iea77532eaa84d00f7d640edd1e3a1da66afdadc5
2016-11-21 17:57:13 +00:00
Hidenari Koshimae
9997fcc72c Merge "CountDownTimer: not skip onTick()"
am: 224d9e48fa

Change-Id: I7ade5d057e73f53867747c00fcfc5882a57a2f4c
2016-11-16 08:10:54 +00:00
Treehugger Robot
224d9e48fa Merge "CountDownTimer: not skip onTick()" 2016-11-16 07:55:27 +00:00
Steven Moreland
3dcee9882d Merge "Update for namespaced services in hwservicemanager."
am: 605df82c9e

Change-Id: I38d861ca107665f1f865f19eebd1be368a8c77a4
2016-11-08 21:20:57 +00:00
Steven Moreland
f3c53496c0 Update for namespaced services in hwservicemanager.
Test: end to end, hidl_test_java
Bug: 31861268
Change-Id: I3e91cf8a87f9345d4ae0650e521414407c7fc780
2016-11-08 08:53:16 -08:00
Leonard Mosescu
1ab879be90 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: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6

Merged-In: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
2016-10-27 17:03:57 +00:00
Andreas Huber
8bd63a39f3 Merge "Adds support for specifying the version of a service to register/lookup."
am: c3d8550cf3

Change-Id: I6b12021c6100f33de7f4b4702bdb4bf1a48c0259
2016-10-26 15:49:52 +00:00
Andreas Huber
35eb7994f8 Adds support for specifying the version of a service to register/lookup.
Bug: 32405011
Test: hidl_test_java
Change-Id: I91a31cafa68d570c67f9a1aa7efb9d3dcb35e591
2016-10-25 13:35:44 -07:00
Hidenari Koshimae
0c3149191f CountDownTimer: not skip onTick()
CoundDownTimer internally performs counting down with a handler and
fires onTick() callback at countdown intervals. At this internal
counting down, firing onTick() is skipped if the account of time until
finished is less than countdown interval. Due to this skip of onTick(),
user will miss last onTick() callback.

This change ensures CountDownTimer to fires every onTick() callback
until the time is up.

Bug: 32392931
Change-Id: I951f5cd46743873d7f8c353f8cf8c700999d8ae0
2016-10-25 08:19:36 +00:00
Robert Sesek
f80fab010a Merge "Create the WebViewZygote and implement WebViewZygoteInit."
am: 8be2850546

Change-Id: I608ea53be52cb91f0e8cf73998de4578b39e099a
2016-10-22 03:12:18 +00:00
Treehugger Robot
8be2850546 Merge "Create the WebViewZygote and implement WebViewZygoteInit." 2016-10-22 03:03:10 +00:00
Andreas Huber
abfd527d09 Merge "HIDL Vectors are now exposed to Java as ArrayList<T>, the supporting APIs on"
am: 2202b164d8

Change-Id: I43bec2c6d3e6e4201f7a50981f428ef00f384684
2016-10-19 19:39:03 +00:00
Andreas Huber
ef1a565bd4 HIDL Vectors are now exposed to Java as ArrayList<T>, the supporting APIs on
HwParcel now reflect this change.

Bug: 32237331
Test: hidl_test_java
Change-Id: Ia1ce5a4e3acedd8ebcff15107aea53ce28fde589
2016-10-18 09:36:02 -07:00
Robert Sesek
aa3c463a5b resolve merge conflicts of 0b58f19 to nyc-mr1-dev-plus-aosp
Change-Id: I374d842cab49b58b570d5ad7ef3dffb7b148d236
2016-10-13 16:49:47 -04:00
Dianne Hackborn
50468217c4 Fix issue #32125907: Intent.replaceUnsafeExtras() corrupts original bundle am: 851ec49de7
am: 9774ea3646

Change-Id: I7e27381f7fa4ca8770ca06cdc6c0bdd18a549ae2
2016-10-13 20:38:04 +00:00
Dianne Hackborn
851ec49de7 Fix issue #32125907: Intent.replaceUnsafeExtras() corrupts original bundle
We now recursively generate new Bundle objects if we need to
do any stripping.

Change-Id: I4ca7896a0771c25264591ae7c79df85816d630d4
2016-10-12 18:17:58 -07:00
Jeff Sharkey
6f5f03b8c1 Set MIME type when building BROWSE intents. am: 42a4aaab44
am: ac184d3c46

Change-Id: I3fb6cc86357c6e19efe58a6e4d31d1f79758b332
2016-10-10 23:34:28 +00:00
Robert Sesek
0b58f198df resolve merge conflicts of 8f8d187 to nyc-dev-plus-aosp
Change-Id: I75c7110ee4f0c9717e7276b609caa2402ef5c2be
2016-10-10 18:34:42 -04:00
Jeff Sharkey
42a4aaab44 Set MIME type when building BROWSE intents.
If we created a BROWSE PendingIntent early during boot (while the
device was still locked), we would resolve the MIME type as "null"
meaning the intent would fail to launch.

Since we always know what the MIME type will be, set it explicitly.

Test: boot device while USB device attached
Bug: 30742481
Change-Id: I23c523cbe2660ca63a3b7df1f41300ab803b314c
2016-10-10 21:28:40 +00:00