Avoid NPE and add a warning log if a printing app misbehaves.

An app can print only from an activity. If the activity is finished
before printing completes we destroy the PrintDocumentAdapter. The
app may however invoke some of the print callbacks after destruction
resulting in a NPE. This change checks if the adapter is destroyed
and if so does not crash while printing a meaningful log error with
the mistake of the app developer.

bug:11675274

Change-Id: I66539cfbd7583f52cb863a84ef8e40856f92ceed
1 file changed