Home | History | Annotate | Download | only in ui

Lines Matching defs:printers

76  * This class is responsible for loading printers by doing discovery
77 * and merging the discovered printers with the previously used ones.
120 /** Location used when the printers were updated the last time */
150 * @param dest The list the printers should be added to
165 * Compute the printers, order them appropriately and deliver the printers to the clients. We
166 * prefer printers that have been previously used (favorites) and printers that have been used
167 * previously close to the current location (near printers).
169 * @param discoveredPrinters All printers currently discovered by the print discovery session.
170 * @param favoritePrinters The ordered list of printers. The earlier in the list, the more
175 List<PrinterInfo> printers = new ArrayList<>();
178 // "printers" as they might have been taken from discoveredPrinters and the printerInfo does
184 // Add the favorite printers that have last been used close to the current location
188 // Only add a certain amount of favorite printers
189 if (printers.size() == MAX_FAVORITE_PRINTER_COUNT) {
199 updateAndAddPrinter(printers, favoritePrinter, discoveredPrinters);
206 // Add the other favorite printers
208 // Only add a certain amount of favorite printers
209 if (printers.size() == MAX_FAVORITE_PRINTER_COUNT) {
215 updateAndAddPrinter(printers, favoritePrinter, discoveredPrinters);
220 // Add other updated printers. Printers that have already been added have been removed from
228 printers.add(updatedPrinter);
232 // Add the new printers, i.e. what is left.
233 printers.addAll(discoveredPrinters.values());
235 // Update the list of printers.
237 mPrinters.addAll(printers);
240 // If stated deliver the new printers.
241 deliverResult(printers);
277 // started and to make sure obsolete printers are updated.
329 List<PrinterInfo> printers = mDiscoverySession.getPrinters();
331 updatePrinters(printers, mFavoritePrinters, getCurrentLocation());
335 private void updatePrinters(List<PrinterInfo> printers,
338 if (mPrintersUpdatedBefore && mPrinters.equals(printers)
347 // Some of the found printers may have be a printer that is in the
350 mPersistenceManager.updateHistoricalPrintersIfNeeded(printers);
353 final int printerCount = printers.size();
355 PrinterInfo printer = printers.get(i);
505 // Recompute and deliver the printers.
513 private static final String TAG_PRINTERS = "printers";
617 public void updateHistoricalPrintersIfNeeded(List<PrinterInfo> printers) {
620 final int printerCount = printers.size();
622 PrinterInfo printer = printers.get(i);
712 * Sort the favorite printers by weight. If a printer is in the list multiple times for
714 * actual favorite printers to display are computed in {@link #computeAndDeliverResult} as
718 * @param printers The printers to sort.
719 * @return The sorted printers.
722 List<Pair<PrinterInfo, Location>> printers) {
727 final int printerCount = printers.size();
729 PrinterId printerId = printers.get(i).first.getId();
736 record.printers.add(printers.get(i));
743 // Sort the favorite printers.
752 favoritePrinters.addAll(favoriteRecords.get(i).printers);
759 * A set of printers with the same ID and the weight associated with them during
764 * The printers, all with the same ID, but potentially different properties or locations
766 public final List<Pair<PrinterInfo, Location>> printers;
768 /** The weight associated with the printers */
775 printers = new ArrayList<>();
795 protected void onPostExecute(List<Pair<PrinterInfo, Location>> printers) {
812 final int printerCount = printers.size();
814 ComponentName printerServiceName = printers.get(i).first.getId()
817 printers.remove(i);
822 mHistoricalPrinters = printers;
824 // Compute the favorite printers.
830 // Deliver the printers.
837 // Loading the available printers if needed.
859 List<Pair<PrinterInfo, Location>> printers = new ArrayList<>();
862 parseState(parser, printers);
865 return printers;
1000 @SuppressWarnings("unchecked") List<Pair<PrinterInfo, Location>>... printers) {
1001 doWritePrinterHistory(printers[0]);
1005 private void doWritePrinterHistory(List<Pair<PrinterInfo, Location>> printers) {
1015 final int printerCount = printers.size();
1017 PrinterInfo printer = printers.get(i).first;
1034 Location location = printers.get(i).second;