OSDN Git Service

Fix a crash in print spooler.
authorSvet Ganov <svetoslavganov@google.com>
Sat, 13 Sep 2014 02:25:27 +0000 (19:25 -0700)
committerSvet Ganov <svetoslavganov@google.com>
Sat, 13 Sep 2014 02:25:32 +0000 (19:25 -0700)
A recent bug fix exposed another one where we were not updating
the internal state of the remote print document after it finishes
updating. This resulted in a crash on every print.

bug:16966145

Change-Id: I398ff7976533241e3d4cb6cd27f69cdc25e67be9

packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java

index 429437d..c53fcad 100644 (file)
@@ -107,11 +107,13 @@ public final class RemotePrintDocument {
                                         mDocumentInfo.info.getPageCount());
                             }
                             // Notify we are done.
+                            mState = STATE_UPDATED;
                             notifyUpdateCompleted();
                         }
                     }
                 } else {
                     // We always notify after a write.
+                    mState = STATE_UPDATED;
                     notifyUpdateCompleted();
                 }
                 runPendingCommand();