summaryrefslogtreecommitdiff
path: root/packages/PrintSpooler/src
diff options
context:
space:
mode:
author Ashish Kumar Gupta <kumarashishg@google.com> 2024-05-16 09:32:34 +0000
committer Ashish Kumar Gupta <kumarashishg@google.com> 2024-05-16 09:32:34 +0000
commitbdcd1b47b996f68c543b4d91270a99ed7391921f (patch)
tree86b18a50cf8bbd3e1d9f5963985dd91a01f85773 /packages/PrintSpooler/src
parente183503eac3b34077a5772d1ea7add2722b06353 (diff)
Set tracking state properly
When user selects printer from Select printer screen, we started tracking last selected printer instead of selected printer. It is happening due to race condition between onStart and onActivityResult callback. Add a support to start tracking printer from onActivityResult function. Bug: 341016728 Bug: 335214357 Test: atest frameworks/base/packages/PrintSpooler/tests/outofprocess/src/com/android/printspooler/outofprocess/tests/WorkflowTest.java Change-Id: I096bf15d3d3ebc45ffbb05db33ac5936dedc14fa
Diffstat (limited to 'packages/PrintSpooler/src')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index d25d5dcaac87..ff09084e24cd 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -785,6 +785,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
} else {
onPrinterUnavailable(printerInfo);
}
+ if (mPrinterRegistry != null) {
+ mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId());
+ }
mDestinationSpinnerAdapter.ensurePrinterInVisibleAdapterPosition(printerInfo);