diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-08-26 15:19:52 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2014-08-26 15:19:56 -0700 |
commit | 9c9888b8c59e35717ecfc32e9b96fb8702ceb480 (patch) | |
tree | 4f38713e9852d891999df2d936e73f2cb8af1486 /packages/PrintSpooler/src/com/android | |
parent | 4610545dd28ebf316704e119572521e97dbbd6bd (diff) | |
download | frameworks_base-9c9888b8c59e35717ecfc32e9b96fb8702ceb480.zip frameworks_base-9c9888b8c59e35717ecfc32e9b96fb8702ceb480.tar.gz frameworks_base-9c9888b8c59e35717ecfc32e9b96fb8702ceb480.tar.bz2 |
Fix a crash in PrintSpooler.
If the user cancels printing we cancel the current
pring operation in the RemotePrintDocument which is
a state machine enforcing valid state transitions.
A valid transition was not allowed: finishing after
canceled.
bug:17182301
Change-Id: Iccf3a78d7dc736a64bf5c44941a8f8064dcd0ec3
Diffstat (limited to 'packages/PrintSpooler/src/com/android')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java b/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java index 9351078..d1aa33b 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java +++ b/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java @@ -258,7 +258,8 @@ public final class RemotePrintDocument { Log.i(LOG_TAG, "[CALLED] finish()"); } if (mState != STATE_STARTED && mState != STATE_UPDATED - && mState != STATE_FAILED && mState != STATE_CANCELING) { + && mState != STATE_FAILED && mState != STATE_CANCELING + && mState != STATE_CANCELED) { throw new IllegalStateException("Cannot finish in state:" + stateToString(mState)); } |