diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-09-06 09:20:28 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2013-09-06 14:50:22 -0700 |
commit | 4e4518383f9212618cafa6c9ce2120becc6f6204 (patch) | |
tree | f326f122c723dd322adad33409a6e6db4ed78477 /services | |
parent | 86974463e9e28108e14fa255efd3c429358c0605 (diff) | |
download | frameworks_base-4e4518383f9212618cafa6c9ce2120becc6f6204.zip frameworks_base-4e4518383f9212618cafa6c9ce2120becc6f6204.tar.gz frameworks_base-4e4518383f9212618cafa6c9ce2120becc6f6204.tar.bz2 |
Printers for a disappearing print serivce incorrectly removed.
The code that removes printers for a disappearing print serivice was
using printer infos instead printer ids and also wrong map methods.
bug:10651739
Change-Id: Idb9ccdaad9a59b3b6d16b079b33afad56bc45255
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/print/UserState.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/java/com/android/server/print/UserState.java b/services/java/com/android/server/print/UserState.java index 8fe979b..b37a0d9 100644 --- a/services/java/com/android/server/print/UserState.java +++ b/services/java/com/android/server/print/UserState.java @@ -779,21 +779,21 @@ final class UserState implements PrintSpoolerCallbacks { return; } // Remove the printers for that service. - List<PrinterInfo> removedPrinters = null; + List<PrinterId> removedPrinterIds = null; final int printerCount = mPrinters.size(); for (int i = 0; i < printerCount; i++) { - PrinterInfo printer = mPrinters.get(i); - if (printer.getId().getServiceName().equals(serviceName)) { - if (removedPrinters == null) { - removedPrinters = new ArrayList<PrinterInfo>(); + PrinterId printerId = mPrinters.keyAt(i); + if (printerId.getServiceName().equals(serviceName)) { + if (removedPrinterIds == null) { + removedPrinterIds = new ArrayList<PrinterId>(); } - removedPrinters.add(printer); + removedPrinterIds.add(printerId); } } - if (!removedPrinters.isEmpty()) { + if (!removedPrinterIds.isEmpty()) { mHandler.obtainMessage( SessionHandler.MSG_DISPATCH_PRINTERS_REMOVED, - removedPrinters).sendToTarget(); + removedPrinterIds).sendToTarget(); } } |