diff options
author | Svetoslav <svetoslavganov@google.com> | 2013-10-11 14:36:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-11 14:36:56 -0700 |
commit | 0004010369ef713ae9bdbdeb8e16bfbdcd835811 (patch) | |
tree | ee77b92df1e3f4510c475167f9f421ddb6e5e002 /packages/PrintSpooler | |
parent | 94b518101c2b2587cb60664dde8931b11f154ec0 (diff) | |
parent | 8e80d1f953932ad867ff4f0b23b466565f1b15f0 (diff) | |
download | frameworks_base-0004010369ef713ae9bdbdeb8e16bfbdcd835811.zip frameworks_base-0004010369ef713ae9bdbdeb8e16bfbdcd835811.tar.gz frameworks_base-0004010369ef713ae9bdbdeb8e16bfbdcd835811.tar.bz2 |
am 8e80d1f9: am 33021d95: Merge "Adding timeout if the current printer or its capabilities disappear." into klp-dev
* commit '8e80d1f953932ad867ff4f0b23b466565f1b15f0':
Adding timeout if the current printer or its capabilities disappear.
Diffstat (limited to 'packages/PrintSpooler')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index a8c4f07..3ee1a64 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -1247,6 +1247,21 @@ public class PrintJobConfigActivity extends Activity { return; } + // If the current printer became unavailable or its + // capabilities go away, we update the UI and add a + // timeout to declare the printer as unavailable. + if ((mCurrentPrinter.getStatus() != PrinterInfo.STATUS_UNAVAILABLE + && printer.getStatus() == PrinterInfo.STATUS_UNAVAILABLE) + || (mCurrentPrinter.getCapabilities() != null + && printer.getCapabilities() == null)) { + if (!mCapabilitiesTimeout.isPosted()) { + mCapabilitiesTimeout.post(); + mCurrentPrinter.copyFrom(printer); + updateUi(); + return; + } + } + // We just refreshed the current printer. if (printer.getCapabilities() != null && mCapabilitiesTimeout.isPosted()) { |