summaryrefslogtreecommitdiffstats
path: root/packages/PrintSpooler
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-10-14 19:00:38 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-14 19:00:38 -0700
commit9773b379fecb7671bc02c1096ee23875d727f827 (patch)
treed27a51c86536e73283bb6de26cca33601e00cb4e /packages/PrintSpooler
parent0e10dfebf19efd3ebe6f70800c5a09243f7da2ac (diff)
parent796629422f3023c1cc3c8d970f5b66c1b34599d2 (diff)
downloadframeworks_base-9773b379fecb7671bc02c1096ee23875d727f827.zip
frameworks_base-9773b379fecb7671bc02c1096ee23875d727f827.tar.gz
frameworks_base-9773b379fecb7671bc02c1096ee23875d727f827.tar.bz2
am 79662942: am c89e5a6a: Merge "Layout may be called with invalid print attributes." into klp-dev
* commit '796629422f3023c1cc3c8d970f5b66c1b34599d2': Layout may be called with invalid print attributes.
Diffstat (limited to 'packages/PrintSpooler')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
index 22a9950..3a23b3e 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
@@ -1248,13 +1248,20 @@ public class PrintJobConfigActivity extends Activity {
continue;
}
+ // If nothing changed - done.
+ if (mCurrentPrinter.equals(printer)) {
+ return;
+ }
+
// If the current printer became available and has no
// capabilities, we refresh it.
if (mCurrentPrinter.getStatus() == PrinterInfo.STATUS_UNAVAILABLE
&& printer.getStatus() != PrinterInfo.STATUS_UNAVAILABLE
- && printer.getCapabilities() == null
- && !mCapabilitiesTimeout.isPosted()) {
- mCapabilitiesTimeout.post();
+ && printer.getCapabilities() == null) {
+ if (!mCapabilitiesTimeout.isPosted()) {
+ mCapabilitiesTimeout.post();
+ }
+ mCurrentPrinter.copyFrom(printer);
refreshCurrentPrinter();
return;
}
@@ -1268,10 +1275,10 @@ public class PrintJobConfigActivity extends Activity {
&& printer.getCapabilities() == null)) {
if (!mCapabilitiesTimeout.isPosted()) {
mCapabilitiesTimeout.post();
- mCurrentPrinter.copyFrom(printer);
- updateUi();
- return;
}
+ mCurrentPrinter.copyFrom(printer);
+ updateUi();
+ return;
}
// We just refreshed the current printer.