summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Philip P. Moltmann <moltmann@google.com> 2017-08-30 07:52:37 -0700
committer Philip P. Moltmann <moltmann@google.com> 2017-08-30 07:52:37 -0700
commit196784ac1da21eac2c6801484a68fb6b1718765e (patch)
tree21e7df3c87a53136e701aa259054c6b5a99eec68
parente022dfc11e709a7084d6735cb36f920e736c9130 (diff)
Reset update spec after canceled layout
When we cancel a layout there are two cases. Either we already scheduled the next layout. In this case operate as before as the update-spec was updated to the new update. In there is no new layout we have to reset the update spec as the last command was canceled and the state of the remotePrintDocument has become invalid. The resetted update spec forces a new update the next time update() is called. Fixes: 64911776 Test: cts-tradefed run cts-dev -m Print Added two new tests reproducing the scenarios mentioned in the bug. Change-Id: Icad8da5fd985aed1cc201076ee7262f6d6541380
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java7
1 files changed, 6 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 f11a9cde9520..b6a003de0eb9 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java
@@ -136,7 +136,12 @@ public final class RemotePrintDocument {
mState = STATE_CANCELED;
notifyUpdateCanceled();
}
- runPendingCommand();
+ if (mNextCommand != null) {
+ runPendingCommand();
+ } else {
+ // The update was not performed, hence the spec is stale
+ mUpdateSpec.reset();
+ }
}
}
};