1eabf5343719aaebd0582c8b83b73f77bbd434dc |
|
27-Sep-2016 |
Tao Bao <tbao@google.com> |
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 794c8b0b3fe16051843c22232d58d6b184dde49b)
/frameworks/base/services/core/java/com/android/server/RecoverySystemService.java
|
1284482898712e994d28203d71655f3254b0d4d5 |
|
22-Mar-2016 |
Tao Bao <tbao@google.com> |
RecoverySystemService: Dump exception stack on IOExceptions. We occasionally hit "java.io.IOException: Connection reset by peer" when communicating with uncrypt. Change to print verbose exception stack for future debugging. Also conservatively change the two potential causes: a) by removing the call to dos.flush() after sending the last status code; b) by closing the streams quietly instead. Bug: 27782920 Change-Id: Ice6da1f27cb1ee83207c9f34958c0e012270167e
/frameworks/base/services/core/java/com/android/server/RecoverySystemService.java
|
dd3baae7ed9d923c8cb8e832853cbaed01528523 |
|
26-Feb-2016 |
Tao Bao <tbao@google.com> |
Switch to socket communication with uncrypt. RecoverySystemService used to communicate with uncrypt via files (e.g. /cache/recovery/command and /cache/recovery/uncrypt_status). Since A/B devices may not have /cache partitions anymore, we switch to communicate via /dev/socket/uncrypt to allow things like factory reset to keep working. Bug: 27176738 Change-Id: I109aa9a9592ca6074eb210089963a846955c0768
/frameworks/base/services/core/java/com/android/server/RecoverySystemService.java
|
e8a403d57c8ea540f8287cdaee8b90f0cf9626a3 |
|
31-Dec-2015 |
Tao Bao <tbao@google.com> |
Add support for update-on-boot feature. Add a separate system service RecoverySystemService to handle recovery related requests (calling uncrypt to de-encrypt the OTA package on the /data partition, setting up bootloader control block (aka BCB) and etc). We used to trigger uncrypt in ShutdownThread before rebooting into recovery. Now we expose new SystemApi (RecoverySystem.processPackage()) to allow the caller (e.g. GmsCore) to call that upfront before initiating a reboot. This will reduce the reboot time and get rid of the progress bar ("processing update package"). However, we need to reserve the functionality in ShutdownThread to optionally call uncrypt if finding that's still needed. In order to support the update-on-boot feature, we also add new SystemApis scheduleUpdateOnBoot() and cancelScheduledUpdate() into android.os.RecoverySystem. They allow the caller (e.g. GmsCore) to schedule / cancel an update by setting up the BCB, which will be read by the bootloader and the recovery image. With the new SystemApis, an update package can be processed (uncrypt'd) in the background and scheduled to be installed at the next boot. Bug: 26830925 Change-Id: Ic606fcf5b31c54ce54f0ab12c1768fef0fa64560
/frameworks/base/services/core/java/com/android/server/RecoverySystemService.java
|