Commit Graph

3670 Commits

Author SHA1 Message Date
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
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
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
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
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
Tony Mantler
8a03a064e4 AsyncTask terminating with exception calls onCancelled am: 5eb91a437c am: 3e51bb267d
am: 37c51f614c

Change-Id: Id37ed8aa1249837f4607749b40cf843393c37586
2016-09-29 02:52:54 +00:00
Tony Mantler
37c51f614c AsyncTask terminating with exception calls onCancelled am: 5eb91a437c
am: 3e51bb267d

Change-Id: I5d8766c0157541720118dd3d264875df58562907
2016-09-28 23:38:58 +00:00
Tony Mantler
5eb91a437c AsyncTask terminating with exception calls onCancelled
Test: cts/tests/tests/os/src/android/os/cts/AsyncTaskTest.java
b/30304893

Change-Id: Icb50cda8026ddd70d457b5e62eb29c81313ee47d
2016-09-28 21:16:56 +00:00
Tianjie Xu
0939ddf6f3 Merge "Log the error when uncrypt timeouts" am: c1973ecbd2 am: c68e6d6708 am: 3aeade44a9
am: 96ce9d16ed

Change-Id: Ideb0ba7ea8d251dae5a23c8fda7e777bbea784ac
2016-09-28 20:10:46 +00:00
Tianjie Xu
96ce9d16ed Merge "Log the error when uncrypt timeouts" am: c1973ecbd2 am: c68e6d6708
am: 3aeade44a9

Change-Id: I913474dbf87b30683267d8f6a458927b7d331c4c
2016-09-28 20:05:15 +00:00
Tianjie Xu
3aeade44a9 Merge "Log the error when uncrypt timeouts" am: c1973ecbd2
am: c68e6d6708

Change-Id: I23ee644fb2f73fc3cece4faf59eb63417cfe3ea6
2016-09-28 19:59:12 +00:00
Tianjie Xu
c68e6d6708 Merge "Log the error when uncrypt timeouts"
am: c1973ecbd2

Change-Id: I5bec3110f9a46cbc1f44bc07d86eea409667983e
2016-09-28 19:53:37 +00:00
Treehugger Robot
c1973ecbd2 Merge "Log the error when uncrypt timeouts" 2016-09-28 19:42:29 +00:00
Tianjie Xu
2a03586998 Log the error when uncrypt timeouts
Log the error code to uncrypt_status if uncrypt gets killed because
of timeout.

Test: We log the error code correctly in uncrypt_status when uncrypt timeouts.
Bug: 31603820
Change-Id: Ia623c333714295e68f4269257fbb4297a867e42b
(cherry picked from commit 036d08638e)
2016-09-28 11:19:03 -07:00
Andreas Huber
9105ca5559 Merge "Adds static methods HwBlob.WrapArray(<scalar-type>[] scalarArray)" am: 90acbd86ac am: 2849ee8b75 am: 0f7eb16fad
am: d321db4481

Change-Id: Idfc104b383a5e35573084d99486e6e70a37170b8
2016-09-28 17:47:48 +00:00
Andreas Huber
d321db4481 Merge "Adds static methods HwBlob.WrapArray(<scalar-type>[] scalarArray)" am: 90acbd86ac am: 2849ee8b75
am: 0f7eb16fad

Change-Id: I43c563eaba14573e94ced381791eb6ba787d3e51
2016-09-28 17:42:02 +00:00
Andreas Huber
0f7eb16fad Merge "Adds static methods HwBlob.WrapArray(<scalar-type>[] scalarArray)" am: 90acbd86ac
am: 2849ee8b75

Change-Id: I00d47819095dd8b52dae52f3d55d6b3bc9998aaf
2016-09-28 17:36:31 +00:00
Andreas Huber
2849ee8b75 Merge "Adds static methods HwBlob.WrapArray(<scalar-type>[] scalarArray)"
am: 90acbd86ac

Change-Id: Ia3013237296ccca46e3f4e0bc702b4ae90a7ea3a
2016-09-28 17:30:23 +00:00
Christopher Tate
f11313f763 Don't leak wakelock instances am: 4b17e984b6 am: cea6cc9d33
am: 5f00f298bf

Change-Id: I0ffb39930e7a989cc54c43f4defe96b2026bec50
2016-09-28 00:06:50 +00:00
Christopher Tate
5f00f298bf Don't leak wakelock instances am: 4b17e984b6
am: cea6cc9d33

Change-Id: I908ad297251b1abd8b8502059a53363cf3be9af2
2016-09-27 23:50:20 +00:00
Christopher Tate
4b17e984b6 Don't leak wakelock instances
Bug 31247436

Change-Id: I7c2ad956c43233b37e53856e9321cb87b01c35da
2016-09-27 15:00:48 -07:00
Tianjie Xu
036d08638e Log the error when uncrypt timeouts
Log the error code to uncrypt_status if uncrypt gets killed because
of timeout.

Test: We log the error code correctly in uncrypt_status when uncrypt timeouts.
Bug: 31603820
Change-Id: Ia623c333714295e68f4269257fbb4297a867e42b
2016-09-27 13:34:58 -07:00
Andreas Huber
906a679aa8 Adds static methods HwBlob.WrapArray(<scalar-type>[] scalarArray)
that convert a one-dimensional array of scalars into the corresponding
one-dimensional array of the associated "wrapped" type, i.e. byte[] -> Byte[].

Change-Id: I712b2bb5330bd660816d0ff536a55913904203b6
Bug: 31682327
Test: hidl_test_java
2016-09-27 11:20:44 -07:00
Vadim Tryshev
75ce3c4a1b Adding compatibility note for drag/drop in N. am: 06b9b60c6d am: 360031a944
am: 68f8fe590f

Change-Id: Ie6c383dfa97521ca8ce3884cde41d2bcd489eeea
2016-09-26 09:28:38 +00:00
Vadim Tryshev
68f8fe590f Adding compatibility note for drag/drop in N. am: 06b9b60c6d
am: 360031a944

Change-Id: Iaaaf125e0e58be896115eb94113170402627d4ef
2016-09-24 01:24:53 +00:00
Vadim Tryshev
06b9b60c6d Adding compatibility note for drag/drop in N.
Bug: 31702571
Change-Id: Ib4b839eec21ea8e1c2b3686595a45642eb8285ba
2016-09-23 15:32:33 -07:00
John Reck
be12cb08b0 Merge "Fix a bunch of repeated reads of a ro.* property" 2016-09-22 15:15:08 +00:00
Jeff Sharkey
15b0cc92cf Rename should behave like create: avoid conflict. am: 2c89a4c170
am: 0e033491ca

Change-Id: I071e31e47dd662d5a7816bc1c3326fe964a6daf8
2016-09-22 04:58:43 +00:00
John Reck
aa67f684ff 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
2016-09-21 16:10:54 -07:00