Commit Graph

3694 Commits

Author SHA1 Message Date
Leonard Mosescu
f3409ceee5 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
2016-10-25 22:42:39 +00:00
Robert Sesek
02bf0b6dbc Merge "Create the WebViewZygote and implement WebViewZygoteInit." am: 8be2850546 am: f80fab010a
am: aa544e975e

Change-Id: I561fff0f56bdbfdeb6c92c11c3fce12cf3fe28be
2016-10-22 03:22:50 +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
Sudheer Shanka
c2c956b3c4 Merge "Move ApplicationThread to aidl." 2016-10-20 17:55:06 +00:00
Andreas Huber
ec36a7a944 Merge "HIDL Vectors are now exposed to Java as ArrayList<T>, the supporting APIs on" am: 2202b164d8 am: abfd527d09
am: 599d51393c

Change-Id: I4be94dcb7e86e74a9f9676e6980f69c35d016f92
2016-10-19 19:54:16 +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
Sudheer Shanka
cc6418feb7 Move ApplicationThread to aidl.
Bug: 30977067
Test: Existing tests are passing, dump commands still working.
Change-Id: Iecb382e8720dfb1b6b707272497e3793e6995edb
2016-10-19 11:29:47 -07: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
26008b9219 resolve merge conflicts of 0b58f19 to nyc-mr1-dev-plus-aosp
am: aa3c463a5b

Change-Id: Ib213dc42ac82d6bf738e727d56794a3cd6b1a35d
2016-10-14 18:40:34 +00:00
TreeHugger Robot
0604869427 Merge "Switch UM to internal isUserUnlockingOrUnlocked" 2016-10-13 20:50:41 +00: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
8888aedc1f Fix issue #32125907: Intent.replaceUnsafeExtras() corrupts original bundle am: 851ec49de7 am: 9774ea3646
am: 50468217c4

Change-Id: I949e6337546835a0673b85ee6e2ad67fb0a0fec4
2016-10-13 20:44:47 +00: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
Fyodor Kupolov
c413f7078d Switch UM to internal isUserUnlockingOrUnlocked
Internal version of UMS maintains a self-locking data-structure of user
states that  is pushed from ActivityManager. Previously there could
be discrepancies between UMS.isUserUnlockingOrUnlocked and
UM.isUserUnlockingOrUnlocked, which is calling a blocking version
in ActivityManager.

Test: manual + UserManagerTests

Bug: 31995235
Bug: 31833240
Change-Id: Ibafe403f57cd32d9052bb55fe7273a861be1d037
2016-10-13 10:07:20 -07: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
Kweku Adams
b0449e01ca Fixing unit issue in dis/charge time remaining parameter.
Although currently not used, the parameter is expected to be in microseconds,
not milliseconds. Hopefully this will avoid issues if the time is used in the
future.

Test: ...make sure it builds locally

Change-Id: Ie131370d3e8c8105623fc60375054f4b22cec110
2016-10-12 22:00:28 +00:00
TreeHugger Robot
e92c3f6398 Merge "power: PowerHAL support for HIDL interfaces." 2016-10-12 00:54:26 +00:00
Dianne Hackborn
1e6f03bfd4 Merge "Move the remaining am commands to ActivityManagerShellCommand." 2016-10-11 17:04:18 +00:00
Tony Mak
6dc428f677 Allow device owner to inflate managed profile
1. Modify DPM.isProvisioningAllowed to allow it to happen
2. Introduce hidden API createProfileForUserEvenWhenDisallowed for
   ManagedProvisioning app to create profile under DO.
   Apps with MANAGE_USERS permission can clear the
   DISALLOW_ADD_USER restriction anyway, so they do not gain extra power.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CustomDeviceOwnerTest#testIsProvisioningAllowed

Bug: 31895999

Change-Id: I10dc3043653130ae717a1d3d8256c9e73231bb21
2016-10-11 12:46:32 +00:00
Dianne Hackborn
331084dca6 Move the remaining am commands to ActivityManagerShellCommand.
The only thing not removed is the "instrument" command, which
really needs to run Java code in the shell.  We'll deal with
that later.

Test: manual
Change-Id: I9df0cdf831ac280cb0eb85c857d27166bc00604d
2016-10-10 16:58:12 -07:00
Jeff Sharkey
46e2afec48 Set MIME type when building BROWSE intents. am: 42a4aaab44 am: ac184d3c46
am: 6f5f03b8c1

Change-Id: Iab359d3b375db98986adf9314b6bec7530326381
2016-10-10 23:40:21 +00: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
Ruchi Kandoi
0d43404a07 power: PowerHAL support for HIDL interfaces.
Bug: 31177288
Change-Id: I3ce5a71958f47d26855513cf7523922e80dd25d2
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-10-10 14:10:09 -07:00
TreeHugger Robot
ba039066d8 Merge "Allow some packages to be excluded during during work profile creation." 2016-10-08 19:23:29 +00:00
Sudheer Shanka
7cb54a34c4 Allow some packages to be excluded during during work profile creation.
Bug: 31657192
Test: adb shell am instrument -e class com.android.server.pm.UserManagerTest#testAddManagedProfile_withDisallowedPackages -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I37eab6084e0f911d0e2407186b789875588194a2
2016-10-07 18:11:11 -07:00
Robert Sesek
8f8d187a78 Split the zygote logic out of android.os.Process into a new ZygoteProcess class.
There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b)
(cherry picked from commit 96b49848e7)

Change-Id: I2e12057e4c2e7567f909d699b487e70b1664cca8
2016-10-07 14:25:36 -07:00
Robert Sesek
ded2098436 Create the WebViewZygote and implement WebViewZygoteInit.
This adds a new init-spawned daemon, webview_zygote, that starts a JVM and
acts as a zygote process for WebView isolated_app services.

Test: m
Test: angler boots
Test: Turn on Settings>Developer>Multiprocess Webview. webview_zygote32 or
      webview_zygote64 start (requires dependent CLs).

Bug: 21643067
Change-Id: Ida98bd04b4d77736b672b03af651c4eb97ce88c1
2016-10-07 12:38:04 -04:00
John Reck
06007a8b09 Merge "SystemClock JNI update" 2016-10-04 15:58:05 +00:00
John Reck
9481c9e842 SystemClock JNI update
Switch to @CriticalNative
Test: make & boot

Change-Id: I5ead83f5c201bf9bb50a39b5c6dcd8b6ac6b5ba5
2016-10-03 16:03:31 -07:00
John Reck
6be2cab50b Trace @FastNative
Test: make & boot
Change-Id: Ibd0160bd98639961b07f430b3fdf210a5796234b
2016-10-03 14:38:06 -07:00
John Reck
b8a5b9ad76 Merge "Switch Parcel to FastNative" 2016-10-03 16:50:36 +00:00
Tao Bao
a2108434fd Merge "Handle the race condition when calling uncrypt services." am: 42d25b5992 am: 86df8ecdf3 am: ade17dea88
am: 2a327506cf

Change-Id: I29cc6009fcd4d58a2f11adba425a6dafeeecb4ab
2016-10-01 00:01:03 +00:00
Tao Bao
473b048cf7 Merge "Handle the race condition when calling uncrypt services." into nyc-mr1-dev 2016-09-30 23:07:38 +00:00
Tao Bao
2a327506cf Merge "Handle the race condition when calling uncrypt services." am: 42d25b5992 am: 86df8ecdf3
am: ade17dea88

Change-Id: I617b48ed7e57a0903bdc577b18b45f9added0e65
2016-09-30 20:52:08 +00:00
Tao Bao
ade17dea88 Merge "Handle the race condition when calling uncrypt services." am: 42d25b5992
am: 86df8ecdf3

Change-Id: I1dc6ea14b4de99bf65f9efff4f22c0bd99e2f86f
2016-09-30 20:46:05 +00:00
Tao Bao
86df8ecdf3 Merge "Handle the race condition when calling uncrypt services."
am: 42d25b5992

Change-Id: Ia5d37580f8bf1489fcc5ccf9c74cf64b94858dc6
2016-09-30 20:40:03 +00:00
Tao Bao
42d25b5992 Merge "Handle the race condition when calling uncrypt services." 2016-09-30 20:30:43 +00:00
John Reck
71207b5a11 Switch Parcel to FastNative
Also fixes ParcelBenchmark to have bounded
memory usage to avoid OOM'ing during runs

Test: refactor, no behavior change

ParcelBenchmark results from bullhead
Before:
      timeReadByte 74.43ns
      timeReadInt 74.49ns
      timeReadLong 74.13ns
      timeWriteByte 81.81ns
      timeWriteInt 82.09ns
      timeWriteLong 81.84ns

After:
      timeReadByte 47.08ns
      timeReadInt 48.38ns
      timeReadLong 48.16ns
      timeWriteByte 55.90ns
      timeWriteInt 55.85ns
      timeWriteLong 56.58ns

Change-Id: I61b823d1d2beb86e00c196abd4dce65efa8fa7f0
2016-09-30 11:19:10 -07:00
Przemyslaw Szczepaniak
0053ff7e01 Merge "Add new StrictMode thread policy - DETECT_UNBUFFERED_IO" am: c60c70dcf9 am: 8297d74de5
am: 61eb1615a6

Change-Id: I00de82b6e9d12b7f6bd602515c21f6922d8d1983
2016-09-30 09:01:52 +00:00
Przemyslaw Szczepaniak
61eb1615a6 Merge "Add new StrictMode thread policy - DETECT_UNBUFFERED_IO" am: c60c70dcf9
am: 8297d74de5

Change-Id: Ic0778b573e1d9f0b1a9af6257ce91f9251beec30
2016-09-30 08:55:55 +00:00
Przemyslaw Szczepaniak
8297d74de5 Merge "Add new StrictMode thread policy - DETECT_UNBUFFERED_IO"
am: c60c70dcf9

Change-Id: I33ffda7e4e0ef230a4de28560262339cea102ec4
2016-09-30 08:50:41 +00:00
Tao Bao
1eabf53437 Handle the race condition when calling uncrypt services.
We call uncrypt services to setup / clear bootloader control block (BCB)
for scheduling tasks under recovery (applying OTAs, performing FDR).
However, we cannot start multiple requests simultaneously. Because they
all use the same socket (/dev/socket/uncrypt) for communication and init
deletes the socket on service exits.

This CL fixes the issue by a) adding synchronized blocks for the service
requests; b) checking the availability of the socket before initiating a
new one.

Note that adding synchronized blocks to RecoverySystem doesn't help,
because the calls could be made from different processes (e.g. priv-app,
system_server).

Bug: 31526152
Test: FDR works while a priv-app keeps calling clear BCB.

Change-Id: I95308989e849a9c98a9503ac509f2bc51ed3de19
(cherry picked from commit 794c8b0b3f)
2016-09-29 23:12:16 -07:00
Tao Bao
794c8b0b3f Handle the race condition when calling uncrypt services.
We call uncrypt services to setup / clear bootloader control block (BCB)
for scheduling tasks under recovery (applying OTAs, performing FDR).
However, we cannot start multiple requests simultaneously. Because they
all use the same socket (/dev/socket/uncrypt) for communication and init
deletes the socket on service exits.

This CL fixes the issue by a) adding synchronized blocks for the service
requests; b) checking the availability of the socket before initiating a
new one.

Note that adding synchronized blocks to RecoverySystem doesn't help,
because the calls could be made from different processes (e.g. priv-app,
system_server).

Bug: 31526152
Test: FDR works while a priv-app keeps calling clear BCB.

Change-Id: I95308989e849a9c98a9503ac509f2bc51ed3de19
2016-09-29 16:07:19 -07:00
Dianne Hackborn
f5ac9e6483 Merge "New infrastructure to switch remaining commands to "cmd" calls." 2016-09-29 19:57:05 +00:00
Tianjie Xu
e422b0b29f Merge "Log the error when uncrypt timeouts" into nyc-mr1-dev 2016-09-29 18:03:30 +00:00
Dianne Hackborn
354736e196 New infrastructure to switch remaining commands to "cmd" calls.
This introduces a new feature of the IBinder command protocol
to allow the shell command implementation to call back into
its caller to ask it to open files in the calling context.  This
is needed so that commands that have arguments specifying files
can open those files as the calling shell, not the system (or
whatever) process.

To test this all out, move the "am start" implementation over
to ActivityManagerShellCommand, in particular along with its
option to specify a file in which to write profiling data.

Test: Manual

Change-Id: I0c1e3857defefbd19a2ac29413aafbb34b1e48a3
2016-09-29 10:58:44 -07:00
Shubham Ajmera
c95b2c85f3 Add new StrictMode thread policy - DETECT_UNBUFFERED_IO
This will enable the developers to check if they could replace an unbuffered
I/O operation with a corresponding buffered I/O operation.

The policy can be set as follow:
     StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
        .detectUnbufferedIO().build());

Test: vogar BlockGuardTest
Bug: 3018772
Change-Id: Ib804a8e9980ae40abfd216f8b87c250fd413bd5c
(cherry picked from commit 9b7184a8fd)w
2016-09-29 16:36:12 +01:00