OSDN Git Service

RecoverySystem: Fix the issue in installPackage().
authorTao Bao <tbao@google.com>
Fri, 13 Jan 2017 17:45:14 +0000 (09:45 -0800)
committerTao Bao <tbao@google.com>
Fri, 13 Jan 2017 17:59:38 +0000 (09:59 -0800)
commit9f7a0acd2d383b825bcdcbef25d6b42f9875acfe
tree269220d6598eb263f36f25da1cdcd2da6f5abe55
parent0938b22c0ab3f28acfcbcc4099b93dc0a43a691a
RecoverySystem: Fix the issue in installPackage().

Commit 794c8b0b3fe16051843c22232d58d6b184dde49b 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
core/java/android/os/IRecoverySystem.aidl
core/java/android/os/RecoverySystem.java
services/core/java/com/android/server/RecoverySystemService.java