OSDN Git Service

Print spooler crash when printing after a rotation.
authorSvet Ganov <svetoslavganov@google.com>
Thu, 20 Nov 2014 15:43:30 +0000 (07:43 -0800)
committerSvet Ganov <svetoslavganov@google.com>
Sat, 22 Nov 2014 17:28:38 +0000 (09:28 -0800)
commitf6cd14dbc99b38af7afe1e5f72347395603d7de2
treef988eb9ef0101fe25ddec1c06195e72788cb5bba
parentc398f175cdc2ceb31bc45b6541f7cd9c3c52406a
Print spooler crash when printing after a rotation.

1. Available printers are provided by a loader driven by the activity
   lifecycle. After a rotation of an app that does not handle rotation
   the print activity is destroyed in a delayed fashion. When another
   print task is started the loader of the destroed activity gets two
   cancellations, one when the activity is stopped and one when it is
   destroyed but when the second cancellation happens the loader has a
   bad state that it is loading while it is not and a NPE occurs.

2. If a rotation happens early before the print activity is fully initialized
   (there are asyncrconous operations that take place) we get a NPE as
   the print preview controller is not created yet.

3. A lockup of the print preview process occurs if the print print
   activity is destroyed after we initiated binding to the rendering
   service but before we receive the remote interface. In this case no
   remote service is received as exepcted since we already unbound from
   it resulting in a missed signal.

bug:18238590

Change-Id: I81817d81702f649ded97dfbab7d7bba28f22fa91
packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java