From e3ce0a4051fd212157a059d5c503ea7a2e127cf2 Mon Sep 17 00:00:00 2001 From: "Philip P. Moltmann" Date: Fri, 20 Nov 2015 13:38:10 -0800 Subject: [PATCH] Create PrintDiscoverySession for future print services If we currently don't have any print services we still want to register a print observer so that when in the future a new service comes along we can connect this service to the observer. Bug: 25666802 Change-Id: I0cc28e92e0000fc9b5372733390095f3a8b19bc9 --- services/print/java/com/android/server/print/UserState.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/print/java/com/android/server/print/UserState.java b/services/print/java/com/android/server/print/UserState.java index f37bb9eb67753..6a50a6eaff21c 100644 --- a/services/print/java/com/android/server/print/UserState.java +++ b/services/print/java/com/android/server/print/UserState.java @@ -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) {