Merge changes from topic 'AddPrinters'
* changes: Create PrintDiscoverySession for future print services Update printer availability when printSpooler is paused. This makes the window update syncronously when in multi-window mode.
This commit is contained in:
committed by
Android (Google) Code Review
commit
c9137615e4
@@ -336,8 +336,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (mState != STATE_INITIALIZING && mCurrentPrinter != null) {
|
||||
mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId());
|
||||
}
|
||||
@@ -379,10 +379,15 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
}
|
||||
}
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
mPrinterAvailabilityDetector.cancel();
|
||||
mPrinterRegistry.setTrackedPrinter(null);
|
||||
|
||||
super.onPause();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -343,9 +343,7 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
|
||||
public void createPrinterDiscoverySession(IPrinterDiscoveryObserver observer) {
|
||||
synchronized (mLock) {
|
||||
throwIfDestroyedLocked();
|
||||
if (mActiveServices.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mPrinterDiscoverySession == null) {
|
||||
// If we do not have a session, tell all service to create one.
|
||||
mPrinterDiscoverySession = new PrinterDiscoverySessionMediator(mContext) {
|
||||
|
||||
Reference in New Issue
Block a user