diff options
author | Svetoslav <svetoslavganov@google.com> | 2013-10-31 14:27:16 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2013-10-31 14:30:58 -0700 |
commit | d270cb9264f762257d1aadbeba9c4b38866e171c (patch) | |
tree | 3d02c1c04403b62f1e3fd5a546d40916cbf2df89 /packages/PrintSpooler/src | |
parent | b207ea960911867e7c1951338df24108d37ad189 (diff) | |
download | frameworks_base-d270cb9264f762257d1aadbeba9c4b38866e171c.zip frameworks_base-d270cb9264f762257d1aadbeba9c4b38866e171c.tar.gz frameworks_base-d270cb9264f762257d1aadbeba9c4b38866e171c.tar.bz2 |
Cancel current work in PrintDocumentAdatper if printing is cancelled.
Layout and write may take some time during which the user can
cancel printing. Currently we wait for the last operation,
being write or layout, to complete before closing the print
dialog. Now in such a scenario we request a cancellation of
the ongoing operation.
bug:11329523
Change-Id: Ia9d747163cc73509369a86c8b5afc83b7ee54859
Diffstat (limited to 'packages/PrintSpooler/src')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java | 3 | ||||
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 8f26361..6d0ecd7 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -357,6 +357,9 @@ public class PrintJobConfigActivity extends Activity { } public void cancel() { + if (isWorking()) { + mRemotePrintAdapter.cancel(); + } mControllerState = CONTROLLER_STATE_CANCELLED; } diff --git a/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java b/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java index fd14af9..d9ccb5d 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java +++ b/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java @@ -137,4 +137,15 @@ final class RemotePrintDocumentAdapter { Log.e(LOG_TAG, "Error calling finish()", re); } } + + public void cancel() { + if (DEBUG) { + Log.i(LOG_TAG, "cancel()"); + } + try { + mRemoteInterface.cancel(); + } catch (RemoteException re) { + Log.e(LOG_TAG, "Error calling cancel()", re); + } + } } |