Commit Graph

3273 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Andreas Huber
60c722812c Merge "Removed legacy code used to read/write java arrays from HwBinder parcels." am: eda7bc5c84
am: 618e39a3be

Change-Id: If1d020f2d62980992ce82359922c1ebfde4c19f8
2016-09-20 20:59:31 +00:00
Andreas Huber
618e39a3be Merge "Removed legacy code used to read/write java arrays from HwBinder parcels."
am: eda7bc5c84

Change-Id: If256977b368ec830f1c01f86c3845d9313c38767
2016-09-20 20:48:53 +00:00
Dianne Hackborn
3da7e4e563 A little more on issue #30766518: Document what targeting N does
am: da6be5b871

Change-Id: Ie1fdb2b07ff8fa016a82a1405336db0dac119fef
2016-09-20 17:07:15 +00:00
Dianne Hackborn
bae14052a0 Cherrypick so we can publish N version code description ASAP
am: 491bc2b8d6

Change-Id: I27da25afcaca61ac0159699c0cfc8fbf2338aa2c
2016-09-20 17:05:09 +00:00
Andreas Huber
74c3b8edfe Removed legacy code used to read/write java arrays from HwBinder parcels.
More generalized functionality is now available through HwBlob.

Change-Id: Id6c713fb01af7593ea3ff8405f3a9e5325877412
Bug: 31438033
Test: run updated "hidl_test" and "hidl_test_java"
2016-09-19 14:09:14 -07:00
Dianne Hackborn
da6be5b871 A little more on issue #30766518: Document what targeting N does
(cherry picked from commit 5f1649e852)

Change-Id: Ieaad1f3ddfa7ef3444e3b513181555f87ecb8c3f
2016-09-19 20:05:07 +00:00
Dianne Hackborn
491bc2b8d6 Cherrypick so we can publish N version code description ASAP
Fix issue #30766518: Document what targeting N does

Also small documentation cleanup in a few other places.

(cherry picked from commit b34cbedb4e)

Change-Id: I9560b29faa4f2674277349272af8193122a1f95e
2016-09-19 19:31:19 +00:00
Tianjie Xu
1579ce8a1d Merge "Collect status on uncrypt time cost" am: bc19e00d35
am: 79d27bdeac

Change-Id: I64f13dbe40845eecb584c0f45a169e0c948275ab
2016-09-16 18:36:20 +00:00
Tianjie Xu
79d27bdeac Merge "Collect status on uncrypt time cost"
am: bc19e00d35

Change-Id: I867821b7575ee2e45bb86c46222e6cf34971689d
2016-09-16 18:30:38 +00:00
Tianjie Xu
bc19e00d35 Merge "Collect status on uncrypt time cost" 2016-09-16 18:19:23 +00:00
Tianjie Xu
3477efce30 Collect status on uncrypt time cost
Read and report time cost of uncrypt (in seconds) from last_install.

Bug: 31383361

Change-Id: I283970c33b2a0324f2f51cde328e3e527eff7c58
2016-09-09 11:35:15 -07:00
Robert Sesek
96b49848e7 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)

Merged-In: Ie673ee816cae34ac20ffb8c774ec3e6461c3fd0a
Change-Id: I104e6133a90dc93a9854836b5e92d3cd542163a3
2016-09-09 12:42:52 -04:00
Andreas Huber
50546a98ed Adds framework support for hidl-gen Java backend. (to support structs)
Bug: 30575790
Change-Id: Ida30d8fe7a1b210e98f1a0ea5d429a0112f9ef3f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-07 15:10:50 +02:00
Andreas Huber
e1eb45d8d6 Add Bool* APIs to HwParcel
Bug: 31045584
Change-Id: I202c4aa7caf92a4cd7e3a45ef6784638e41facc8
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-07 15:10:45 +02:00
Andreas Huber
281ac40c97 Support one-way methods in java support for hardware binder
Bug: 30922538
Change-Id: I5ff93126a29f6bff42dee3f9868fa794ca7c077f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-07 15:10:35 +02:00
Andreas Huber
7f5fcabacc Initial commit of Java support for hardware binder
Change-Id: If1098ab921a11bae8eca2a70a3c3070e4daa0ea2
2016-09-07 15:10:30 +02:00
Calin Juravle
0bc450ac05 [RFC] Special case system apps for profile optimizations am: 08313b0d95
am: 788e111cba

Change-Id: I8466811b44b623e23117d6554e69cc80e2c4485f
2016-09-06 21:25:44 +00:00
Calin Juravle
08313b0d95 [RFC] Special case system apps for profile optimizations
If the OTA updates a system app which was previously preopted to a non-
preopted state the app might end up being verified at runtime. That's
because by default the apps are verify-profile but for preopted apps
there's no profile.

Do a hacky check to ensure that if we have no profiles (a reasonable
indication that before the OTA the app was preopted) system apps get
compiled with a non-profile filter (by default interpret-only).

Bug: 30032273
Test: Andreas "has verified that Calin's change to A/B works as expected
and promotes things like SystemUI to speed. From my side, that's
ready to be merged"

Change-Id: I7a052a8ea76cab7f649dc993237ea05534d6c4b9
(cherry picked from commit 0bd7762079)
2016-09-06 10:41:04 -07:00
Andreas Huber
9266f9928d Adds framework support for hidl-gen Java backend. (to support structs) (DO NOT MERGE)
Bug: 30575790
Change-Id: Ida30d8fe7a1b210e98f1a0ea5d429a0112f9ef3f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-02 06:28:14 -07:00
Andreas Huber
86635bb45e Add Bool* APIs to HwParcel (DO NOT MERGE)
Bug: 31045584
Change-Id: I202c4aa7caf92a4cd7e3a45ef6784638e41facc8
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-02 06:28:14 -07:00
Andreas Huber
90349b3e11 Support one-way methods in java support for hardware binder (DO NOT MERGE)
Bug: 30922538
Change-Id: I5ff93126a29f6bff42dee3f9868fa794ca7c077f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-02 06:28:14 -07:00
Andreas Huber
dab5fc65b9 Initial commit of Java support for hardware binder (DO NOT MERGE)
Change-Id: If1098ab921a11bae8eca2a70a3c3070e4daa0ea2
2016-09-02 06:28:14 -07:00
The Android Automerger
f287780643 Manually merge commit 'b0b6afc' into nyc-dev-plus-aosp 2016-08-30 00:26:21 +00:00
Christopher Wiley
5de073a6b0 Remove WiFi related methods from NetworkManagementService
These are no longer necessary, since WiFi manages its own details.

Bug: 30041228
Change-Id: Ia3824da43367ae74d3f3a204318cfe5470d74957
Test: Compiles
(cherry picked from commit 212b95f587)
2016-08-29 11:26:50 -07:00
Christopher Wiley
31a513b461 Remove unused method from NetworkManagementService
Bug: 28598325
Test: Builds

Change-Id: I6a226b3410cda4e12a9225741ec81cd12b48892f
(cherry picked from commit 2103e78e0c)
2016-08-26 13:20:40 -07:00
Mark Lu
fc68813e5c docs: Fix typo and broken link in AsyncTask.java
am: 53415ff24e

Change-Id: Ib4fadd74bcf640bd28cb19e757e2cc7b605a69dd
2016-08-26 01:03:17 +00:00
Mark Lu
314d995ca1 Merge "docs: Fix typo and broken link in AsyncTask.java" into nyc-dev 2016-08-26 00:46:05 +00:00
Mark Lu
53415ff24e docs: Fix typo and broken link in AsyncTask.java
Bug: 29323321
Change-Id: Ie3a62480bfee881083b5d266cbc1481fb148d237
2016-08-12 13:02:32 -07:00
Narayan Kamath
448be0a622 Process: Fix communication with zygote.
Don't write partial requests, and don't return (or throw) early after
partially reading a response.

bug: 30143607
Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
2016-08-09 18:30:07 +01:00
Svet Ganov
ddb948896c Mark app pending intents in notification extras
We need to make every peniding intent that went in the notification
system to allow special handling of such intents when fired by a
notification listener. If a pending intent from a notification
is sent from a notification listener, we white-list the source app
to run in data saver mode for a short period of time. The problem is
that actions and the notificaion can have extras which bundles may
contain pending intents but the system cannot look into the bundles
as they may contain custom parcelable objects. To address this we
keep a list of all pending intents in the notification allowing
the system to access them without touching the bundle. Currently
the pending intents are written to the parcel twice, once in the
bundle and once as the explicit list. We can come up with a scheme
to optimize this but since pending itents are just a binder pointer
it is not worth the excecise.

bug:29480440

Change-Id: I7328a47017ca226117adf7054900836619f5679b
2016-06-27 17:32:25 -07:00
Dianne Hackborn
5f9afa968d Merge "Reduce race when connecting to an existing content provider." into nyc-dev 2016-06-21 19:18:39 +00:00
Dianne Hackborn
4de5a3ac66 Reduce race when connecting to an existing content provider.
We lost the code that checks to see if the target process still
exists and aborts trying to use it if so.  To reduce the race
there, we have a new explicit check of the state of the process.

Hopefully fixes some of issue #28737082.

Change-Id: I37a7a6e9767516d564168ef5e110c4adafe3fb76
2016-06-21 10:04:22 -07:00
TreeHugger Robot
c2e06a55f9 Merge "BatteryStats: record best estimated battery capacity" into nyc-dev 2016-06-20 19:49:46 +00:00
Adam Lesinski
f9b20a9ec4 BatteryStats: record best estimated battery capacity
Using the coulomb counter, record the estimated max battery
capacity.

Bug:28743761
Change-Id: I1270b062cf4a1e6fd69ea1da3de11a85a81b3663
2016-06-20 10:58:37 -07:00
Dianne Hackborn
47cfac6803 Merge "Fix issue #29371078: Foreground jobs should not count..." into nyc-dev 2016-06-16 18:39:03 +00:00
Dianne Hackborn
7ab4025474 Fix issue #29371078: Foreground jobs should not count...
...as active for idle maintenance

Nor jobs of whitelisted apps.

Now they don't.

Also remove the no longer used "active download" tracking code.

Change-Id: I553197801f6eabaf15716f3201dd65257a0d4e94
2016-06-15 17:30:24 -07:00