From d724a40136f168251f6f62e5a51ad73bf8fe5d1e Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Tue, 16 Sep 2014 11:53:15 -0700 Subject: [PATCH] Print preview disappearing on screen off/on. We were not clearing the tracked printer when the print activity is paused and then not setting the tracked printer when the activity is resumed. bug:17525271 Change-Id: Ib0fb29006bfcf5ad03dce24b3407cd96dc421442 --- .../src/com/android/printspooler/ui/PrintActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java index 693e5ac5a2723..e177b1f3f46c3 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java @@ -311,6 +311,14 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat setState(STATE_CONFIGURING); } + @Override + public void onResume() { + super.onResume(); + if (mState != STATE_INITIALIZING && mCurrentPrinter != null) { + mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId()); + } + } + @Override public void onPause() { PrintSpoolerService spooler = mSpoolerProvider.getSpooler(); @@ -347,6 +355,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat } mPrinterAvailabilityDetector.cancel(); + mPrinterRegistry.setTrackedPrinter(null); super.onPause(); }