OSDN Git Service

Hold no locks when calling RemotePrintSpooler
authorPhilip P. Moltmann <moltmann@google.com>
Wed, 24 Aug 2016 16:27:46 +0000 (09:27 -0700)
committerPhilip P. Moltmann <moltmann@google.com>
Mon, 29 Aug 2016 21:29:34 +0000 (21:29 +0000)
commit1d6e7cc536cb7f49b318f630ad8f2eb348786716
tree47a22fa6576460c990226c3b3ef8022859e0eddb
parent6f200e69331d7311ada8b3360085285daeb7fdcb
Hold no locks when calling RemotePrintSpooler

The calls might be blocking and need the main thread of to be unblocked
to finish. Hence do not call while holding any monitors that might need
to be acquired the main thread.

The calls that have been moved out of the lock:
- Icon related calls: These are just caches. Hence we flush the cache we
  just request the icon again
- Prune call: This just removes not installed print service from some
  data structure. The order of two of these calls does not matter as
  the end result of both removals will be the same, regardless of order.

Testing done: Reinstalled a print service multiple times. Before the
first reinstallation locked up the userState, now not anymore

Change-Id: I4f4cdaba65132dc2ef054877cbb097b499a723f6
Fixes: 31043684
services/print/java/com/android/server/print/RemotePrintSpooler.java
services/print/java/com/android/server/print/UserState.java